Remove the fragile and heavy json libraries from the firmware#10152
Open
Remove the fragile and heavy json libraries from the firmware#10152
Conversation
… JSON topics on MQTT, remove JSON Logging/Tracing, replace JSON output on webserver with simple string concatenation, since they use a fixed set of templates anyway. The Heltec solar node still uses ArduinoJSON for god knows what in its included custom library.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes JSON-based features and dependencies from the firmware (MQTT JSON topics, JSON packet logging/tracing, and the internal JSON serialization library), replacing the webserver’s JSON responses with manual string construction.
Changes:
- Removed MQTT JSON uplink/downlink topics and related packet JSON serialization code paths.
- Removed SimpleJSON + MeshPacketSerializer (including nRF52 ArduinoJson serializer) and deleted the corresponding unit tests.
- Reworked webserver JSON responses in
ContentHandler.cppto build JSON strings directly; removed Portduino JSON/trace file logging config and plumbing.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| variants/nrf52840/rak4631_eth_gw/platformio.ini | Drops nRF52 JSON build flag and ArduinoJson dependency for this variant. |
| test/test_meshpacket_serializer/test_serializer.cpp | Removes JSON serializer unit test runner (serializer feature removed). |
| test/test_meshpacket_serializer/test_helpers.h | Removes JSON serializer test helpers and JSON parsing dependency. |
| test/test_meshpacket_serializer/ports/test_waypoint.cpp | Removes waypoint JSON serialization tests. |
| test/test_meshpacket_serializer/ports/test_text_message.cpp | Removes text message JSON serialization tests. |
| test/test_meshpacket_serializer/ports/test_telemetry.cpp | Removes telemetry JSON serialization tests. |
| test/test_meshpacket_serializer/ports/test_position.cpp | Removes position JSON serialization tests. |
| test/test_meshpacket_serializer/ports/test_nodeinfo.cpp | Removes nodeinfo JSON serialization tests. |
| test/test_meshpacket_serializer/ports/test_encrypted.cpp | Removes encrypted-packet JSON serialization tests. |
| src/serialization/MeshPacketSerializer.h | Removes the MeshPacket JSON serializer API. |
| src/serialization/MeshPacketSerializer.cpp | Removes the non-nRF52 SimpleJSON-based serializer implementation. |
| src/serialization/MeshPacketSerializer_nRF52.cpp | Removes the nRF52 ArduinoJson-based serializer implementation. |
| src/serialization/JSONValue.h | Removes SimpleJSON value type (library elimination). |
| src/serialization/JSONValue.cpp | Removes SimpleJSON implementation. |
| src/serialization/JSON.h | Removes SimpleJSON parser/stringifier header. |
| src/serialization/JSON.cpp | Removes SimpleJSON parser/stringifier implementation. |
| src/RedirectablePrint.cpp | Removes JSON logging buffer sizing and Portduino trace special-casing. |
| src/platform/portduino/PortduinoGlue.h | Removes Portduino trace/JSON file globals and related config fields/YAML emission. |
| src/platform/portduino/PortduinoGlue.cpp | Removes Portduino trace/JSON file open and YAML config parsing for those options. |
| src/mqtt/MQTT.h | Removes JSON topic member and JSON include. |
| src/mqtt/MQTT.cpp | Removes JSON MQTT downlink handling, JSON subscriptions, and JSON publishes. |
| src/mesh/Router.cpp | Removes JSON trace logging of decoded/encrypted packets. |
| src/mesh/http/ContentHandler.cpp | Replaces SimpleJSON usage with hand-built JSON strings for web endpoints. |
| bin/config-dist.yaml | Removes commented-out TraceFile/JSONFile logging configuration examples. |
Collaborator
|
I would like to retain the JSON capabilities on Meshtasticd, if possible. Ideally in a simplified form. |
Member
Author
|
So the JSON logging in debug trace? And packet content logging? |
… JSON topics on MQTT, remove JSON Logging/Tracing, replace JSON output on webserver with simple string concatenation, since they use a fixed set of templates anyway. The Heltec solar node still uses ArduinoJSON for god knows what in its included custom library.
Collaborator
Yes exactly. I know of at least one professional user of the JSON dump to file. |
jp-bennett
reviewed
Apr 17, 2026
… JSON topics on MQTT, remove JSON Logging/Tracing, replace JSON output on webserver with simple string concatenation, since they use a fixed set of templates anyway. The Heltec solar node still uses ArduinoJSON for god knows what in its included custom library.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
remove JSON topics on MQTT, remove JSON Logging/Tracing, replace JSON output on webserver with simple string concatenation, since they use a fixed set of templates anyway.
The Heltec solar node still uses ArduinoJSON for god knows what in its included custom library.