Open Jens1985 opened 3 years ago
You must check your GPRS connection first (and reconnect it if isGprsConnected() == false
) and, after that, reconnect your MQTT client. For example:
void loop() {
if (!modem.isGprsConnected() {
modem.gprsConnect(apn, gprsUser, gprsPass); // TODO process return val
}
if (!mqtt.connected()) {
mqttConnect(); // TODO process return val
}
}
Hi there, after a loss of signal, the modem does not automatically reconnect to the network.
I have an Arduino MKR NB 1500 with a UBLOX SARA R410M modem. For testing I use the (TinyGSM) MQTTclient example.
Does anyone have a solution for this? That must be a common problem. Especially with portable devices, the signal breaks down regularly.
Here ist the debug output:
After the change suggested here(), there is this debug output:
Here is the Source: TinyGSM_MQTT_Github.zip