Skip to content

Remove the fragile and heavy json libraries from the firmware#10152

Open
caveman99 wants to merge 15 commits intodevelopfrom
strip-json
Open

Remove the fragile and heavy json libraries from the firmware#10152
caveman99 wants to merge 15 commits intodevelopfrom
strip-json

Conversation

@caveman99
Copy link
Copy Markdown
Member

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.

… 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.
@caveman99 caveman99 requested review from Copilot and jp-bennett April 13, 2026 09:17
@github-actions github-actions bot added needs-review Needs human review enhancement New feature or request labels Apr 13, 2026
@caveman99 caveman99 requested a review from thebentern April 13, 2026 09:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.cpp to 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.

Comment thread src/mqtt/MQTT.cpp
@caveman99 caveman99 added triaged Reviewed by the team, has enough information and ready to work on now. tech debt Code or lib references that are not up to date or propper standards requires-protos Requires changes to protobufs to work requires-docs Documentation must be updated 2.8 cleanup Code cleanup or refactor needs-tacos Every night can be taco night and removed needs-review Needs human review labels Apr 13, 2026
@caveman99 caveman99 marked this pull request as ready for review April 13, 2026 12:35
@jp-bennett
Copy link
Copy Markdown
Collaborator

I would like to retain the JSON capabilities on Meshtasticd, if possible. Ideally in a simplified form.

@caveman99
Copy link
Copy Markdown
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.
@jp-bennett
Copy link
Copy Markdown
Collaborator

So the JSON logging in debug trace? And packet content logging?

Yes exactly. I know of at least one professional user of the JSON dump to file.

Comment thread src/mesh/HardwareRNG.cpp Outdated
… 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.8 cleanup Code cleanup or refactor enhancement New feature or request needs-tacos Every night can be taco night requires-docs Documentation must be updated requires-protos Requires changes to protobufs to work tech debt Code or lib references that are not up to date or propper standards triaged Reviewed by the team, has enough information and ready to work on now.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants