TCP socket. Need more speed

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
VladVons
Posts: 60
Joined: Sun Feb 12, 2017 6:49 pm
Location: Ukraine

TCP socket. Need more speed

Post by VladVons » Mon Feb 13, 2017 9:13 am

for driving small aircraft from a PC/Android i need more speed to send and receive packets.

Now i reached 0,15 sec for each transaction.
Duration of 1000 cycles of data transmission from a PC to ESP8266
sockets - 146 sec
JSON serialization - 2 sec
lamps toggling - 1.5 sec

Is this slow MicroPython socket realisation or ESP8266 WiFi or something else...

Perhapse UDP will be a little fester?
In MP documentation mentioned IPPROTO_UDP
https://docs.micropython.org/en/latest/ ... ocket.html
but i got error:
object has no attribute 'socket.IPPROTO_UDP'
Just cant find worked UDP example for MicroPython.

---------------------TCP ----------------------------
simple server on an ESP8266:

Code: Select all

Sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Sock.bind( ("0.0.0.0.0", 50000)
Sock.listen(1)
Conn, Addr = Sock.accept()

while (True):
  Data = Conn.recv(512)
  if (Data):
    ...JSON serialization
    ...Lamps toggling
    Conn.send('get ' + Data)
     
Conn.close()
Sock.close()
Last edited by VladVons on Mon Feb 13, 2017 9:59 pm, edited 1 time in total.

VladVons
Posts: 60
Joined: Sun Feb 12, 2017 6:49 pm
Location: Ukraine

Re: TCP socket. Need more speed

Post by VladVons » Mon Feb 13, 2017 9:48 pm

relative post about UDP discussed here
viewtopic.php?f=16&t=3012&p=17907

Post Reply