Data transmission is handled entirely within the STM32 embedded firmware using FreeRTOS tasks.
Each task runs independently and continuously transmits data over UART1 at its own interval:
GPS Task — sends GPS data (fix, lat, lon, speed, time) every 1 second
Digital IO Task — sends digital input/output states every 2 seconds
Accelerometer Task — sends IMU data every 3 seconds
Modem Task — sends network status periodically
RS485 Task — sends clock frame to board 03 every 10 seconds
All tasks run in parallel using FreeRTOS scheduler. Data is transmitted over UART1 using HAL_UART_Transmit() protected by a mutex (uart1Mutex) to prevent conflicts between tasks.
Okay, your RX stops working after some time. Can you tell me what the largest chunk (maximum number of bytes) transferred from STM32 to VAAMAN is in a single receive operation?
Also, please share a screenshot of the last 50 lines from the dmesg --follow log, along with screenshots of the periplexer and rah service status using the commands sudo systemctl status periplexer and sudo systemctl status rah.
Could you also share the JSON configuration file? Additionally, when your RX stops working, please share a screenshot of the last 50 lines from the dmesg --follow log, along with screenshots of the periplexer and rah service status using the commands sudo systemctl status periplexer and sudo systemctl status rah."
The STM32 continuously transmits structured binary frames over UART1 at 115200 baud. Each frame has an opcode, payload length, JSON payload and CRC16 checksum:
GPS Task (opcode 0x01) — 165 bytes payload, sends GPS data (fix, lat, lon, speed, time) every 1 second
Modem Task (opcode 0x02) — small frame, sent periodically
Digital IO Task (opcode 0x03) — 278 bytes payload, sends digital input/output states every 2 seconds
Accelerometer Task (opcode 0x04) — 52 bytes payload, sent every 3 seconds
Log frames (opcode 0x05) — small, sent on events
RS485 Task — receives route, stop, default and driver display commands from VAAMAN over UART1 and forwards them to the RS485 display boards (boards 01, 02, 04) over UART3 at 4800 baud. Also sends IST clock frame to board 03 every 10 seconds. When GPS signal is lost, sends the stored default message to board 03.
All tasks run in parallel under FreeRTOS and all transmissions are protected by uart1Mutex to prevent frame overlap.
VAAMAN Side:
VAAMAN receives all frames continuously, parses them by opcode, displays the data on the GUI and performs calculations based on the received values (GPS position, digital IO states, accelerometer data, network status). VAAMAN also sends display commands (route, stop, default, driver) to STM32 over UART1 which are then forwarded to the RS485 boards.