Page 1 of 1

WIFI and GSM Module (PPP module) working with the same MQTT or Azure IoT hub libary

Posted: Sun Jan 16, 2022 2:09 pm
by djoshi
Hi

We aim to use ESP32-­WROVER-­E module with the Quectel BG-95-M3 or EG-9x , the purpose is to have the ability to connect to the internet using WIFI or GSM/GPRS/4G/CATM1 or NB-IOT.

If I am correct we would need to use a PPP library, so that TCP stack be controlled within the ESP32 instead module, instead of using additional AT commands?


I would like to develop my code to firstly check the internet connection on both the WIFI and GSM module. If WIFI is not available then to use the GSM module.

Once connected, then using the same MQTT library or Azure Iot Hub library.

I would like to avoid have two sets of MQTT or Azure Iot Hub libraries or processes.

Can this be achieved?

Re: WIFI and GSM Module (PPP module) working with the same MQTT or Azure IoT hub libary

Posted: Mon Jan 17, 2022 12:46 am
by chegewara
Yes, it is possible without any special code to handle mqtt. The only thing you have to take care of is to start and stop LTE module when wifi connect/disconnect.

Re: WIFI and GSM Module (PPP module) working with the same MQTT or Azure IoT hub libary

Posted: Mon Jan 17, 2022 10:44 am
by djoshi
Handling the module is not an issue, this can easily done with a combination of GPIO and AT commands. The AT commands would simply connect the module on to mobile network and the PPP would take over.

I intend to use https://github.com/espressif/esp-azure This required a WIFI connection to be made. Is it possible to set it up so that GSM and WIFI is available for both?

Re: WIFI and GSM Module (PPP module) working with the same MQTT or Azure IoT hub libary

Posted: Tue Jan 18, 2022 3:30 am
by chegewara
Like i said, as long as you will have code that will work when you diconnect and re-connect wifi, it should works with LTE too, assuming LTE is in PPP mode.

Re: WIFI and GSM Module (PPP module) working with the same MQTT or Azure IoT hub libary

Posted: Tue Jan 18, 2022 10:02 am
by djoshi
So would I need to edit anything in esp-azure for it send any data using ppp instead of wifi?

Re: WIFI and GSM Module (PPP module) working with the same MQTT or Azure IoT hub libary

Posted: Tue Jan 18, 2022 10:22 am
by chegewara
I didnt work with PPP + azure yet, but i believe you dont have to change anything in azure-iot to make it works with LTE.

Re: WIFI and GSM Module (PPP module) working with the same MQTT or Azure IoT hub libary

Posted: Tue Jan 18, 2022 10:25 am
by djoshi
But I guess both wifi and gsm can not work at the same time.

e.g.

WIFI connected to server 1

GSM connected to server 2

This just for for my knowledge i do not intend to use in this way.