Skip to content

Add optional JSON serial API for external controlAdd optional JSON serial API#332

Open
samuelcoustet wants to merge 1 commit into
esp32-si4732:mainfrom
samuelcoustet:feature/json-serial-api
Open

Add optional JSON serial API for external controlAdd optional JSON serial API#332
samuelcoustet wants to merge 1 commit into
esp32-si4732:mainfrom
samuelcoustet:feature/json-serial-api

Conversation

@samuelcoustet
Copy link
Copy Markdown

This PR adds an optional JSON line-based serial API for ATS Mini ESP32-S3 + SI4732.

Goals:

  • external control from Python / Flask / desktop applications
  • preserve backward compatibility with the existing serial protocol
  • minimal code changes
  • no impact on UI responsiveness

Features:

  • JSONL serial protocol
  • automatic JSON detection using {
  • protocol versioning
  • read-only mode by default
  • token-protected read-write mode
  • automatic RW timeout
  • lightweight and full status endpoints
  • frequency/mode/volume/BFO control
  • seek support
  • busy/event reporting

Implementation details:

  • adds JsonAPI.h / JsonAPI.cpp
  • minimal changes to Remote.cpp
  • no modification of Remote.h
  • existing serial protocol remains unchanged

Safety/stability:

  • blocking scan API intentionally omitted
  • seek operations expose busy/event state
  • API designed to avoid accidental radio control on USB connection

Tested:

  • JSON parsing
  • coexistence with existing serial commands
  • read-only protection logic
  • serial auto-detection logic

Future possible extensions:

  • async events
  • websocket bridge
  • web dashboard integration
  • non-blocking scan engine

@samuelcoustet
Copy link
Copy Markdown
Author

Compiled successfully with Arduino IDE after installing required libraries.

Environment:

  • Arduino IDE 2.x
  • esp32 by Espressif Systems
  • TFT_eSPI
  • PU2CLR SI4735
  • ArduinoJson

Current status:

  • JSON API compiles correctly
  • Event subscription extension compiles correctly
  • No build errors detected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant