Just like the topic, is it possible to use esp8266(NodeMCU) as a server,
and then links more than one client at the same?
I search on the net and found out that '' micro python does not support multi-threads ''.
and I found out a function called ' socketServer()', which supports server to link many clients at the same time,
but everyone uses this on the computer rather than the esp8266.
I need help QAQ thx!
esp8266-be the server and links many clients at the same time
Re: esp8266-be the server and links many clients at the same time
You can use MicroPython devices as a server. However, due to its restrained resources the esp8266 may not be the best choice. The ESP32, especially the model with SPIRAM, is better suited and also supports threading, just like the PyBoards. The new PyBoard model comes with integrated WiFi/Bluetooth.
It is possible to implement some kind of service to multiple clients on an esp8266 using a callback mechanism, but only for very simple services, which respond fast and do not use much memory.
The socketserver module is not implemented in MicroPython, and I do not know if anyone has ported/implemented that yet.
It is possible to implement some kind of service to multiple clients on an esp8266 using a callback mechanism, but only for very simple services, which respond fast and do not use much memory.
The socketserver module is not implemented in MicroPython, and I do not know if anyone has ported/implemented that yet.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: esp8266-be the server and links many clients at the same time
It is possible to write a server using uasyncio rather than threading to handle concurrency. This is much more efficient on resource constrained devices.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.