Skip to main content

OSynaptic-TX

TX-only OpenSynaptic packet encoder for 8-bit MCUs

C89 Version AVR ESP32 License

OSynaptic-TX encodes sensor readings into the OpenSynaptic wire format (FULL frames) using pure C89, no heap, and a stack peak as low as 21 bytes on AVR. Pairs directly with the OpenSynaptic server and OSynaptic-FX gateway over any serial transport.

GitHub: https://github.com/OpenSynaptic/OSynaptic-TX


Why OSynaptic-TX?

FeatureDetails
TX-only, no decode codeFlash cost is a fraction of a full-duplex library
C89 cleanCompiles on every toolchain targeting 8-bit MCUs: avr-gcc, SDCC, IAR, MPLAB XC8
No heapZero malloc/free calls; all buffers are stack or static
Three API tiersPick the tier that matches your MCU's RAM budget
Spec-compatiblePackets decode directly by OpenSynaptic server without glue code

Try In 30 Seconds

Arduino IDE → Sketch > Include Library > Add .ZIP Library → select OSynaptic-TX.zip
File > Examples > OSynaptic-TX > BasicTX → Upload

Open Serial Monitor at 115200 baud — FULL packets stream out once per second.


Three API Tiers

Choose the tier that matches your MCU's available RAM:

TierStack peakStatic RAMFlash (~1 sensor)When to use
Aostx_sensor_pack()~137 B96 B~600 BDynamic runtime strings; most flexible
Bostx_static_pack()~51 B96 B~430 BCompile-time sensor descriptor in Flash
Costx_stream_pack()~21 B0 B~760 BZero-buffer streaming via callback — minimum RAM

All three tiers produce identical wire frames. The linker drops unused modules automatically.


Memory Footprint

ResourceValue
Stack peak~21 bytes
Static RAM0 bytes
Flash (Uno/Nano, 1 sensor)~760 bytes

Minimum supported MCU

ResourceValueExample devices
RAM≥ 128 BATtiny25 / ATmega48
Flash≥ 2 KBATtiny25 / ATmega48

Quick Navigation

SectionDescription
Quick StartAPI C, B, and A code examples
InstallationArduino IDE, CMake, find_package
API TiersWhen to use A vs B vs C
Wire FormatByte-level packet layout
Configurationostx_config.h macros
Unit ValidationUCUM unit codes and SI prefix rules
MCU DeploymentPer-MCU capability table
Transport SelectionUART, UDP, LoRa, nRF24 guidance
API ReferenceComplete function and struct reference
ExamplesFive annotated examples

  • OSynaptic-RX — the receiver side: GitHub · Docs
  • OSynaptic-FX — high-level C99 runtime: GitHub · Docs
  • OpenSynaptic — the Python/Rust server hub: GitHub