pythings / Drivers

Some drivers for MicroPython
Apache License 2.0
63 stars 22 forks source link

Feature request: TCP client support #11

Closed Sebbb closed 3 years ago

Sebbb commented 3 years ago

Hello,

would it be possible to add TCP client support (CIPSTART/CIPSEND/CIPRXGET)?

Thanks Sebastian

Sebbb commented 3 years ago

Never mind. Just figured out how to use PPP on the ESP32. Easier than using AT commands :)


modem_uart.write("AT+CNMI=0,0,0,0,0\r\n")
  [check return value, ...]
modem_uart.write('AT+CGDCONT=1,"IP","internet.t-mobile"\r\n')
  [check return value, ...]
modem_uart.write('AT+CGDATA="PPP",1\r\n')
time.sleep(0.1)
print(modem_uart.readline())
print(modem_uart.readline())
ppp = network.PPP(modem_uart)

ppp.active(True)
ppp.connect()

sleep 5
ppp.ifconfig()
ManishSahu53 commented 2 years ago

@Sebbb Is this working? If establish PPP link then do you mean we can setup tcp connection easily? I am trying to establish websocket connection but struggling very much to do with AT.

Sebbb commented 2 years ago

@ManishSahu53 Yes, that works for me. Then I can simply use the regular python socket functions, no need for any further AT... stuff.