cancel
Showing results for 
Search instead for 
Did you mean: 

Best approach for robust SIM7600G-H driver on STM32L4 + ThingsBoard MQTT

mohamed981
Visitor

Hello everyone,

I am developing a cellular IoT device using STM32L4 + SIM7600G-H 4G module. The goal is to create a highly reliable driver that can handle every possible disconnection, network drop, MQTT event, and recovery scenario without losing data or getting stuck.

Requirements:

  • Heavy use of UART DMA (Circular RX buffer + IDLE line detection)
  • Full finite state machine for modem management (Power on → Network → PDP → MQTT → Operational → Recovery)
  • Robust parsing of all URCs (+CMQTTDISC, +CLOSED, registration changes, etc.)
  • MQTT communication with ThingsBoard (telemetry, client attributes, shared attributes, RPC, firmware OTA/FOTA)
  • Reliable reconnection logic with exponential backoff, message queuing during offline periods, and modem watchdog (power cycle on repeated failures)

Questions:

  1. What is currently the best recommended way in 2026 to implement such a driver on STM32L4?
  2. Has anyone successfully used X-CUBE-CELLULAR with SIM7600 series? Is it worth porting, or is it too LPWAN-oriented for a Cat.1 module like SIM7600G-H?
  3. Would you recommend:
    • Custom AT command layer + MaJerle-style UART DMA + own FSM
    • Porting TinyGSM logic into STM32 HAL
    • Using SIMCOM’s built-in AT+CMQTT* commands with custom state machine
    • Or another middleware / example I might have missed?
  4. Any production-grade open source projects or examples for SIM76xx on STM32L4/L5 that handle long-term stability (days/weeks of operation)?

I prefer maximum control and resilience over ease of use, so I’m ready to implement a solid custom solution if needed.

Any guidance, experiences, or recommended repositories would be greatly appreciated!

Thank you in advance.

Best regards,
Mohamed

0 REPLIES 0