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

djoshi
Posts: 53
Joined: Wed Jan 12, 2022 9:59 pm

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

Postby djoshi » Sun Jan 16, 2022 2:09 pm

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?

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

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

Postby chegewara » Mon Jan 17, 2022 12:46 am

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.

djoshi
Posts: 53
Joined: Wed Jan 12, 2022 9:59 pm

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

Postby djoshi » Mon Jan 17, 2022 10:44 am

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?

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

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

Postby chegewara » Tue Jan 18, 2022 3:30 am

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.

djoshi
Posts: 53
Joined: Wed Jan 12, 2022 9:59 pm

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

Postby djoshi » Tue Jan 18, 2022 10:02 am

So would I need to edit anything in esp-azure for it send any data using ppp instead of wifi?

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

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

Postby chegewara » Tue Jan 18, 2022 10:22 am

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.

djoshi
Posts: 53
Joined: Wed Jan 12, 2022 9:59 pm

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

Postby djoshi » Tue Jan 18, 2022 10:25 am

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.

Who is online

Users browsing this forum: Bing [Bot] and 128 guests