ESP32 GPRS/PPP support

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
cable134
Posts: 28
Joined: Sun Aug 20, 2017 10:51 pm

ESP32 GPRS/PPP support

Post by cable134 » Tue Sep 05, 2017 11:26 am

Dear all,

Could you please provide any advice regarding following?

I need to build an app that will work as a gateway between ESP32 UART port and Web Socket via GPRG/EDGE connection.
I've seen that that for this I need a LWIP module.

Now I'm using MicroPython_ESP32_psRAM_LoBo firmware.
On the build stage I enabled PPP support in the IDF components.
CONFIG_PPP_SUPPORT=y
CONFIG_PPP_PAP_SUPPORT=y
CONFIG_PPP_CHAP_SUPPORT=y
CONFIG_PPP_MSCHAP_SUPPORT=y
CONFIG_PPP_MPPE_SUPPORT=y
CONFIG_PPP_DEBUG_ON=y
CONFIG_L2_TO_L3_COPY=y

As I understand I need a LWIP python module.
How to inject it into the firmware ?

Or is the any easy way to get GPRS connectivity on ESP32 uPython ?

Thank you in advance.

loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

Re: ESP32 GPRS/PPP support

Post by loboris » Tue Sep 05, 2017 2:34 pm

I have GSM/GPRS support implemented in my MicroPython port.
It uses esp-idf/lwip PPPoS support, so that any network function can be used over GSM the same way as with WiFi.
The implementation is in testing phase, I expect to merge it to GitHub repository next week.
I'm testing with Simcom modules (SIM900, SIM800 (2G), SIM5300E (3G)), but it should work with any GSM module.

cable134
Posts: 28
Joined: Sun Aug 20, 2017 10:51 pm

Re: ESP32 GPRS/PPP support

Post by cable134 » Tue Sep 05, 2017 2:38 pm

Awesome news.
We will wait for it.

Thank you.

jiXO
Posts: 4
Joined: Fri Oct 13, 2017 11:32 am

Re: ESP32 GPRS/PPP support

Post by jiXO » Fri Oct 13, 2017 11:40 am

Hello.
Could you pls give an example of how the PPPoS function works in your port?

loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

Re: ESP32 GPRS/PPP support

Post by loboris » Fri Oct 13, 2017 4:29 pm

Completed GSM/PPPoS support and the related documentation will be pushed to GitHub next week.

The usage is quite simple, here are the available functions:

network.GSM.start(tx, rx [,rts] [,cts] [,baudrate] [, user] [, password], apn [, wait]) - starts the GSM/PPPoS task and initializes GSM module
network.GSM.stop() - stops the GSM/PPPoS task
network.GSM.status() - returns the task status
network.GSM.connect() - connects to the Internet, all network functions works the same as with WiFi Internet connection
network.GSM.disconnect([endtask] [, rfoff]) - disconnects from Internet, other GSM functions can be used

The following functions can be executed only when disconnected from Internet:
network.GSM.sendSMS(gsmnum, msg) - send sms
network.GSM.readSMS() - read all received messages
network.GSM.deleteSMS(index) - delete sms message
network.GSM.onSMS(function) - register callback function to be executed when the new sms is received

While GSM/PPPoS is started, WiFi can only be used in AP mode.

jiXO
Posts: 4
Joined: Fri Oct 13, 2017 11:32 am

Re: ESP32 GPRS/PPP support

Post by jiXO » Wed Oct 25, 2017 11:33 am

loboris,

I tried to buld a port with the CONFIG_MICROPY_USE_GSM option enabled.
However, when I try to use a connection

import network
network.GSM.start(pin1, pin2, apn)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'GSM'

Thanks in advance!

loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

Re: ESP32 GPRS/PPP support

Post by loboris » Thu Oct 26, 2017 8:02 am

The gsm functions are now in the gsm module.
Instead of using network.GSM.<method> use gsm.<method>()

Code: Select all

import gsm
gsm.start(tx=27, rx=26, apn='my_provoder_apn' [,connect=True|False])
Default value for the optional connect argument is False, if not set to True you must execute gsm.connect() to go online.
You can use gsm.debug(True|False) to turn debuging messages on|off.

The full documentation will be pushed today or tomorrow.

jiXO
Posts: 4
Joined: Fri Oct 13, 2017 11:32 am

Re: ESP32 GPRS/PPP support

Post by jiXO » Thu Oct 26, 2017 3:30 pm

It works with my SIM868!

Many thanks for your excellent work!

ajie_dirgantara
Posts: 81
Joined: Fri Sep 02, 2016 9:26 am

Re: ESP32 GPRS/PPP support

Post by ajie_dirgantara » Thu Mar 15, 2018 5:03 pm

It isn't working with sim5360. here is wher its fail :

>>> I (404831) [PPPOS CLIENT]: AT COMMAND: [AT..]
I (404865) [PPPOS CLIENT]: AT RESPONSE: [AT...OK..]
I (404965) [PPPOS CLIENT]: AT COMMAND: [AT+CFUN=4..]
I (405004) [PPPOS CLIENT]: AT RESPONSE: [AT+CFUN=4...OK..]
I (405004) [PPPOS CLIENT]: GSM initialization start
I (405604) [PPPOS CLIENT]: AT COMMAND: [AT..]
I (405637) [PPPOS CLIENT]: AT RESPONSE: [AT...OK..]
I (405737) [PPPOS CLIENT]: AT COMMAND: [ATZ..]
I (405769) [PPPOS CLIENT]: AT BAD RESPONSE: [ATZ.]
W (405769) [PPPOS CLIENT]: Wrong response, restarting...


any ideas?

filzer
Posts: 1
Joined: Mon Mar 29, 2021 1:27 pm

Re: ESP32 GPRS/PPP support

Post by filzer » Mon Mar 29, 2021 1:32 pm

loboris wrote:
Thu Oct 26, 2017 8:02 am
The gsm functions are now in the gsm module.
Instead of using network.GSM.<method> use gsm.<method>()

Code: Select all

import gsm
gsm.start(tx=27, rx=26, apn='my_provoder_apn' [,connect=True|False])
Default value for the optional connect argument is False, if not set to True you must execute gsm.connect() to go online.
You can use gsm.debug(True|False) to turn debuging messages on|off.

The full documentation will be pushed today or tomorrow.
Hi Loboris,

I am new on this forum.
I am trying to get an esp32cam working with a SIM7600 using websockets...how?!
I see you said full documentation would be available ... where can I find the documentation?

Thanks!

Phil

Post Reply