From 5f65c758e0b81a9111e5fba85b950100b9aaee94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Miko=C4=8Devi=C4=87?= Date: Sat, 18 May 2024 18:14:02 +0200 Subject: [PATCH 1/2] ArduinoJson 5->7 --- example/OOK_Receiver/OOK_Receiver.ino | 13 +++++++------ example/OOK_Receiver/platformio.ini | 6 +++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/example/OOK_Receiver/OOK_Receiver.ino b/example/OOK_Receiver/OOK_Receiver.ino index 7be5f3fb..7f780293 100644 --- a/example/OOK_Receiver/OOK_Receiver.ino +++ b/example/OOK_Receiver/OOK_Receiver.ino @@ -20,19 +20,20 @@ rtl_433_ESP rf; // use -1 to disable transmitter int count = 0; void rtl_433_Callback(char* message) { - DynamicJsonBuffer jsonBuffer2(JSON_MSG_BUFFER); - JsonObject& RFrtl_433_ESPdata = jsonBuffer2.parseObject(message); - logJson(RFrtl_433_ESPdata); + JsonDocument jsonDocument; + deserializeJson(jsonDocument,message); + logJson(jsonDocument); count++; } -void logJson(JsonObject& jsondata) { +void logJson(JsonDocument jsondata) { #if defined(ESP8266) || defined(ESP32) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) - char JSONmessageBuffer[jsondata.measureLength() + 1]; + char JSONmessageBuffer[measureJson(jsondata) + 1]; + serializeJson(jsondata, JSONmessageBuffer, measureJson(jsondata) + 1); #else char JSONmessageBuffer[JSON_MSG_BUFFER]; + serializeJson(jsondata, JSONmessageBuffer, JSON_MSG_BUFFER); #endif - jsondata.printTo(JSONmessageBuffer, sizeof(JSONmessageBuffer)); #if defined(setBitrate) || defined(setFreqDev) || defined(setRxBW) Log.setShowLevel(false); Log.notice(F(".")); diff --git a/example/OOK_Receiver/platformio.ini b/example/OOK_Receiver/platformio.ini index 4d8e69ff..726bb1da 100644 --- a/example/OOK_Receiver/platformio.ini +++ b/example/OOK_Receiver/platformio.ini @@ -15,7 +15,11 @@ src_dir = . [libraries] arduinolog = https://github.com/1technophile/Arduino-Log.git#d13cd80 -arduinojson = ArduinoJson@5.13.4 +arduinojson = + ArduinoJson + ; ArduinoJson @ 7.0.4 + ; ArduinoJson @ 6.21.5 + ; ArduinoJson @ 5.13.4 ; deprecated rtl_433_ESP = symlink://../../../rtl_433_ESP ; Builds library from source directory [env] From 0f852371b278dc17c8cd9df099537f963a13419e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Miko=C4=8Devi=C4=87?= Date: Sun, 19 May 2024 15:22:50 +0200 Subject: [PATCH 2/2] fix small typo in README.md enabaled -> enabled --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e297ca1..47d6ba46 100644 --- a/README.md +++ b/README.md @@ -336,7 +336,7 @@ DEVICE_DEBUG ; Validate fields are mapped to response object ( rtl_433 MEMORY_DEBUG ; display heap usage information RESOURCE_DEBUG : Monitor HEAP and STACK usage and report large jumps MY_DEVICES ; Only include my personal subset of devices -NO_DEAF_WORKAROUND ; Workaround for issue #16 ( by default the workaround is enabaled ) +NO_DEAF_WORKAROUND ; Workaround for issue #16 ( by default the workaround is enabled ) PUBLISH_UNPARSED ; Enable publishing of MQTT messages for unparsed signals, e.g. {model":"unknown","protocol":"signal parsing failed"… RAW_SIGNAL_DEBUG ; display raw received messages RSSI_SAMPLES ; Number of rssi samples to collect for average calculation, defaults to 50,000