In my project I have custom board connecting to MQTT broker. Board will be connected either with Ethernet or with GSM. GSM module is BG95-M3. In code there is lwIP internet stack and two network interfaces one for ETH-ARP and one for GSM-PPP. GSM is connected with PPP over serial. Device is connecting correctly using both interfaces and I am able to transmit and receive data on both interfaces. Unfortunately about 40 to 60 minutes after connecting with GSM I am facing disconnect problem. I am sending keepalive package every 60 s and after about 40 minutes device doesn’t receive response from broker for two keepalive packages and I am being disconnected from PPP by lwIP stack. When keepalive packages don’t get responses also messages send to device topics don’t arrive to board.
On the other hand Ethernet connection is stable for and I don’t see any problems there. Please help me to find root of problem and help me to fix it. I would like to have continue connection to broker as device needs to be connected 24/7 without service breaks.