jeelabs / esp-link

esp8266 wifi-serial bridge, outbound TCP, and arduino/AVR/LPC/NXP programmer
Other
2.84k stars 723 forks source link

Port 23 Observations #97

Open jcable opened 8 years ago

jcable commented 8 years ago

Hi. This firmware is great. I'm building an NMEA-0183 to wifi bridge and I will based it on your code - I have a lua implementation working but your web interface is excellent and lua only lets me listen on one tcp port. I'll keep full attribution of course.

I played with connecting to port 23 using netcat and I wanted to share my findings. Only one of them is remotely like a bug. My setup is a laptop with USB serial connected to a 1 MB ESP-01. I'm using a fresh clone of esp-link from git on 14th Jan 2016.

  1. The first time I connected a second tcp client the firmware rebooted. I haven't been able to reproduce this.
  2. The code transmits one character at a time. This makes sense for your intended application of debugging attached microcontrollers. I need to line buffer so this will be the main code changes I will make.
  3. With three tcp clients connected, when I type at the serial console the text is only send to the web console and two of the three tcp clients. This seems to be reliably the first two connected. If I drop two clients and start a 4th then the two active clients get the text.
  4. With two tcp clients connected It pretty much keeps up with the auto repeat rate of my console sending the text to both clients.
  5. With two tcp clients connected if I paste text into the console, one tcp client gets only the first two characters. The other tcp client gets all the characters up to at least 240 characters.

So esp-link supports one tcp client properly but two works at low speed and three doesn't work.

cheers.

Julian

tve commented 7 years ago

I'm seeing that with 2 clients and some reasonable output rate it's running out of tx buffers.