Page 1 of 1

Cellular / modem comunnications port

Posted: Mon Jul 18, 2022 12:25 pm
by kindmartin
Hi all, I asked this question on /librarys forum part long time ago without response. viewtopic.php?f=15&t=10001

After searching for a lib supporting cellular modem modules in latest micropython (now 1.19) and Im not finding anything but that old loboris ESP32 port freeze at 2018 that easily permit data connections from ESP32. A pity that the port didn't integrate into the main mpy branch.

Any hint for modules like sim800 or sim7600 or quectel ones? I need to connect a mqtt or blynk app in cases wifi access is not available.



M

Re: Cellular / modem comunnications port

Posted: Thu Jul 28, 2022 2:00 pm
by p_j
I have discovered that the easiest way to use modems with micropython is to use PPP. This provides a seamless network connection so you can use all the standard libraries like ntp, requests etc.. without dealing with the raw AT commands.

The trick to getting ppp working is to first put the modem in ppp mode, you shouldn't need a library for this. I use the SARA modems and all that I need to do is:

1. Wait for the modem to connect to a nework
2. Activate a GPRS connection "AT+UPSDA=0,3 " This will be different for the SIMCOM modems.
3. Create a ppp connection in micropython

Code: Select all

import network

qw = network.PPP(self.uart)
qw.active(True)

time.sleep(0.5)

qw.connect(authmode=qw.AUTH_PAP, username="", password="")

count = 0
while qw.isconnected == False:
    time.sleep(1)
    count += 1
    if count > 5:
        raise
    logger.debug(f'PPP connected')
I have some SIM7600 modules here that I will be using in a project soon. If I get some working code written I will share it here.

Re: Cellular / modem comunnications port

Posted: Sat Jul 30, 2022 2:56 am
by kindmartin
Thanks P_J. I will try that network.PPP and comment also over here. I have also SIM7600 SA also with PCIE for those Lilygo ttgo-PCIe ESP32 board. I will be trying first Quectel BG600 LTE/GPRS small factor with a ESP 32 s3 board as is what I chose for my project, if any is also aiming this modules.

Re: Cellular / modem comunnications port

Posted: Sat Jul 30, 2022 3:10 am
by kindmartin