diff --git a/.gitignore b/.gitignore
index d255f72cb8269cca6d6a2e61cd168ac73e7b1d64..7964d0371548d6b7c5ef39cfcf7530ca799c2cd8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,5 @@
 *.o
 /build
+/src/app/prototest/nanopb.pb.h
+/src/app/prototest/nanopb.pb.cc
+/src/app/prototest/nanopb.proto
diff --git a/src/app/prototest/Makefile.inc b/src/app/prototest/Makefile.inc
index 36cfb490ba72cd97a7eabe4b257b973cdf5a6020..9bd4ac6d2368d4dad7e0bdf0d1fa27e3d6f1ecb9 100644
--- a/src/app/prototest/Makefile.inc
+++ b/src/app/prototest/Makefile.inc
@@ -1,11 +1,20 @@
 loop ?= 1
 
+ifeq (${prototest_include_global}, 1)
+	COMMON_FLAGS += -DPROTOTEST_INCLUDE_GLOBAL
+endif
+
+ifeq (${prototest_include_local}, 1)
+	COMMON_FLAGS += -DPROTOTEST_INCLUDE_LOCAL
+endif
+
 ifeq (${prototest_arduinojson}, 1)
 	COMMON_FLAGS += -DPROTOTEST_ARDUINOJSON
 endif
 
 ifeq (${prototest_modernjson}, 1)
 	COMMON_FLAGS += -DPROTOTEST_MODERNJSON
+	ostream = 1
 endif
 
 ifeq (${prototest_mpack}, 1)
diff --git a/src/app/prototest/main.cc b/src/app/prototest/main.cc
index c1d835908b0e36e007885bcddc75f5f3271e8c21..238493095df31215a3e9697dd2771e9e6cb24ef5 100644
--- a/src/app/prototest/main.cc
+++ b/src/app/prototest/main.cc
@@ -28,6 +28,10 @@
 
 #include <stdint.h>
 
+#ifdef PROTOTEST_INCLUDE_GLOBAL
+#include "prototest_global.cc.inc"
+#endif
+
 #ifdef PROTOTEST_XDR
 char buf[256];
 #endif
@@ -50,6 +54,10 @@ void loop(void)
 {
 	static uint16_t ts = 0;
 
+#ifdef PROTOTEST_INCLUDE_LOCAL
+#include "prototest_local.cc.inc"
+#endif
+
 	/*
 	 * XDR
 	 */
@@ -98,6 +106,32 @@ void loop(void)
 	kout << "sensor: " << sensor << endl;
 #endif
 
+	/*
+	 * ModernJSON
+	 */
+
+#ifdef PROTOTEST_MODERNJSON
+	nlohmann::json js1;
+	js1["sensor"] = "gps";
+	js1["time"] = ts;
+	js1["data"] = {48.756080, 2.302038};
+	kout << js1.dump() << endl;
+
+	nlohmann::json js2 = {
+		{"sensor", "gps"},
+		{"time", ts},
+		{"data", {48.756080, 2.302038} }
+	};
+	kout << js2.dump() << endl;
+
+	std::vector<std::uint8_t> v_cbor = nlohmann::json::to_cbor(js2);
+	kout << "CBOR vector is " << hex;
+	for (unsigned int i = 0; i < v_cbor.size(); i++) {
+		kout << v_cbor[i] << " ";
+	}
+	kout << endl;
+#endif
+
 	/*
 	 * NanoPB
 	 */