Upgrade ArduinoJson to ^6
https://github.com/1technophile/OpenMQTTGateway/blob/3db54b4266429707adec5d3de71ff9d04b8be867/platformio.ini#L117
There is a bug in the current version with serialization/de-serialization causing malformed nested objects. I have updated without any noticeable issues.
In my personal setup (rf,rf2,pilight and rtl_433) i use ArduinoJson 7.3.0
Had to do some tweak, elsewhere the discovery (rtl_433) messages were not ok https://github.com/peshovec/OpenMQTTGateway/commit/b6847f6ac323e51d8c24b6c8b90b2d1fb0d0b921
This modification was not needed with ArduinoJson 7.2.1
Share that, as it seems ArduinoJson 7 implement some nice goodies - for example ability to safely read json key, even if the key does not exist (returns null in this case). It is claimed that this can lead to smaller code (when refactored). However containsKey is deprecated in favor of checking the type of the key value (general check, regardless of the type exist too)
Probably it is worth to have in mind if update to latest ArduinoJson is in the plans. Did not dig very deep, based on my observation, potential roadmap could be:
- "one" time effort to go to 7.2.1
- refactor the deprecations (containsKey) when a change in the code is needed , e.g. on demand
- follow the 7.3 and latest.
This issue is stale because it has been open for 90 days with no activity.
Not stale
This issue is stale because it has been open for 90 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.