1Remote Serial Ports 2=================== 3 4It is possible to connect to any networked remote serial port that supports `RFC2217 <http://www.ietf.org/rfc/rfc2217.txt>`__ (Telnet) protocol. To do this, specify the serial port to esptool as ``rfc2217://<host>:<port>``. For example, to read information about your chip's SPI flash, run: 5 6:: 7 8 esptool.py --port rfc2217://192.168.1.77:4000 flash_id 9 10Custom baud rates and DTR/RTS automatic resetting are supported over the RFC2217 protocol, the same as for a local serial port. 11 12Pyserial Example Servers 13------------------------ 14 15PySerial (which is a dependency of esptool) includes two RFC2217 example programs - `a single-port example <http://pyserial.readthedocs.io/en/latest/examples.html#single-port-tcp-ip-serial-bridge-rfc-2217>`__ and a `multi-port example <http://pyserial.readthedocs.io/en/latest/examples.html#multi-port-tcp-ip-serial-bridge-rfc-2217>`__. 16These example servers can run on any OS that supports pyserial, and are the simplest way to connect to an Espressif SoC over the network. 17 18There is an issue with `automatic resetting due to network latency <https://github.com/espressif/esptool/issues/383>`__. In order to work around this issue, a modified version of the single-port server example called ``esp_rfc2217_server.py`` is provided with esptool. 19 20On server: 21 22:: 23 24 esp_rfc2217_server.py -p 4000 /dev/ttyUSB1 25 26On client: 27 28:: 29 30 esptool.py --port rfc2217://ADDRESS_OF_SERVER:4000?ign_set_control flash_id 31 32 33Raw Sockets 34----------- 35 36For servers or hardware network/serial adapters which don't support the full RFC2217, it is also possible to specify ``--port socket://<host>:<port>`` syntax for a simple "raw TCP socket" protocol. 37 38These raw sockets don't support setting the baud rate or automatic resetting into the bootloader. If using this mode, don't pass the ``--baud`` option to esptool. You need to set the baud rate manually on the server, and manually reset the chip into the bootloader mode (or use some other signalling/control method to tell the server to do so). 39 40Here's a very basic example using the common Linux/OSX command line "netcat" and "stty" commands: 41 42On server: 43 44:: 45 46 stty -F /dev/ttyUSB1 230400 # set baud rate 47 nc -p 4000 -lk < /dev/ttyUSB1 > /dev/ttyUSB1 48 49On client: 50 51:: 52 53 esptool.py -p socket://localhost:4000 flash_id 54 55.. note:: 56 57 Using RFC2217 is strongly recommended where possible. 58 59More Details 60------------ 61 62All of the remote serial port support comes via pyserial. Read more `here <http://pyserial.readthedocs.io/en/latest/url_handlers.html>`__. (Please keep in mind that the link points to documentation for the most recent pyserial version. You may have an older version.) 63