Can not ppp success on esp32
Hi,
My esp32 is running this build(MicroPython v1.11-665-gfb0141559 on 2019-12-14; ESP32 module with ESP32)
I can ppp success on raspberry with GSM module but cannot success on ESP32 board.
Commands as below, anyone can help on it? thanks.
`
from machine import UART
import network
GSM = UART(1, baudrate=115200, rx=18, tx=19)
I (31450) uart: ALREADY NULL
GSM.write('AT\r\n')
4
GSM.read()
b'AT\r\n\r\nOK\r\n'
GSM.write('AT+CGDCONT=1,"IP","3GNET"\r\n')
27
GSM.read()
b'AT+CGDCONT=1,"IP","3GNET"\r\n\r\nOK\r\n'
GSM.write('AT+CGDATA="PPP",1\r\n')
19
GSM.read()
b'AT+CGDATA="PPP",1\r\n\r\nCONNECT\r\n'
GPRS=network.PPP(GSM)
GPRS.active(True)
True
GPRS.connect()
GPRS.isconnected()
False
GPRS.ifconfig()
('0.0.0.0', '0.0.0.0', '255.255.255.255', '0.0.0.0')`
ports/esp32: Updated network_ppp.c to match current documentation
Summary
This MR updates the network.PPP module of the ESP32 port to match the current documentation. The status() method should behave like the common LwIP implementation and the poll() method will raise an RuntimeError indicating that this is not really supported on this port. Also did some minor resorting to match the common LwIP implementation.
This would solve https://github.com/micropython/micropython/issues/16998
Testing
Tested on ESP32_GENERIC and ESP32_GENERIC_S3 boards with SIMCOM800L and SIMCOM7080G modules. At least with ESP32_GENERIC the PPP connection is connected at least 18 hours.