vshymanskyy / TinyGSM

A small Arduino library for GSM modules, that just works
GNU Lesser General Public License v3.0
1.91k stars 708 forks source link

Stable connections + GSM USSD Codes #779

Open bill210kouk opened 4 months ago

bill210kouk commented 4 months ago

[ x] I have read the Troubleshooting section of the ReadMe

What type of issues is this?

[ ] Request to support a new module

[ ] Bug or problem compiling the library [ ] Bug or issue with library functionality (ie, sending data over TCP/IP) [ x] Question or request for help

What are you working with?

Modem: A7670E Main processor board: ESP32 GSM LILYGO A7670E TinyGSM version: Latest Code:Loop code : if (!modem.isGprsConnected()){ Serial.println("Setup GPRS"); gprsSetup(); } if (!mqtt.connected()){ Serial.println("Setup MQTT"); mqttConnection(); } mqtt.loop();

Scenario, steps to reproduce

I would like to ask the community. Im producing a custom solution in which it is mandatory to keep connections 24/7 and be able to use ussd commands to retrieve balance and remaining MB + a check to reliably read unread sms. In my case with this loop and functions implemented to achieve i have managed to maintain a stable connection to a broker with gprs connection. The problem i noticed is that when i try to use USSD commands with AT+CUSD=1 or the function implemented inside the library my gsm module restarts thus disconnecting and failing to achieve the command asked. If there any way to optimize all functionalities without restarts?

Expected result

Actual result

Controller when asked about USSD commands restarts the gsm modul

Debug and AT command log

ATREADY1 most of the times. Low successful rate on commands