1

I have an IoT project which utilizes two ESP8266 which serve as UART bridges over wifi and I'm trying to make them communicate with a Raspberry pi using Python.

And since the protocol used by these chips is telnet, I tried using the telnetlib library to do so, which works pretty well... Except I have not found any way to make it connect to the two ESPs at the same time.

Is it possible to connect to multiple clients simultaneously using this library? If not, is running two separate python scripts both using this library at the same time a good idea? Could I even make those two scripts communicate with each other?

R3D34THR4Y
  • 51
  • 6
  • This is a common problem which is solved by creating a thread for each arriving client, so that the server can get back to accepting the next client. This problem was described and solved in multiple other SO questions: https://stackoverflow.com/questions/18377318/python-multiple-telnet-sessions, https://stackoverflow.com/questions/27787842/cannot-parallelize-threads-telnet-connections-with-python – Maximilian Gerhardt Jun 30 '17 at 14:11
  • Thanks, I never thought about the threading library for doing that, I'll try it then – R3D34THR4Y Jun 30 '17 at 22:46
  • Possible duplicate of [Python multiple telnet sessions](https://stackoverflow.com/questions/18377318/python-multiple-telnet-sessions) – Maximilian Gerhardt Jul 01 '17 at 09:50
  • I have read that servicing network connections can be a challenge for the ESP8266 since it only has a single core. The upgraded version of this chip (the ESP32) has dual cores to make this a LOT easier. – markshancock Jan 08 '18 at 21:24

0 Answers0