flash-programming using rfc2217

felted67
Posts: 1
Joined: Sat Sep 16, 2017 6:22 pm

flash-programming using rfc2217

Postby felted67 » Sat Sep 16, 2017 6:30 pm

Hello everyone,

well, does have anyone experience with flash-programming via rfc2217-aware com-ports ?

I´d like to develop on a virtual linux machine, with a windows backend with a connected ESP-develboard.
As I would like to program the esp32 directly via this rfc2217-connection and learned, that I could use

Code: Select all

rfc2217://{ip}:{port} 
as the com-port in menuconfig. The documentary from pyserial says it supports rfc2217.

Now I´ve tested several rfc2217-servers on windows (som commercial, too), but espflash.py
complains with something like "not rfc2217 aware" or "remote doesn´t accept parameter change".

So, anyone´s help about this will be highly appreciated.

Thanks !

Greetz.......Detlef

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: flash-programming using rfc2217

Postby kolban » Sun Sep 17, 2017 2:54 am

Here is a link to the RFC2217 specification:

https://www.rfc-editor.org/rfc/rfc2217.txt

This is a quite old spec (nearly 20 years now). The high level appears that one can use a telnet client to connect to a telnet server that then drivers a UART/Serial port. For example, to drive an "old fashioned" dialup-modem connection.

My gut feel is that there would be little value in this for flashing from an ESP32 perspective. We would basically need a telnet server that is RFC2217 aware that would be UART connected to the ESP32. Then we would need a telnet client to connect to that telnet server over which the image and related protocols would be streamed to the RFC2217 compliant telnet server. This would mean that we would need to construct an ESP32 "flasher" (eg. esptool) to become a telnet client. And its here where I start to raise questions.

For me, telnet was always a human <-> computer piece of function. Telnet clients "owned" user interaction plus TCP/IP networking to a peer server app (the telnet server) which interacted with the OS to receive user input and return system output. If we were to use RFC2217 to drive the ESP32 UART interface, it seems we wouldn't be leveraging and user interface function of a telnet client ... and hence our "telnet client" compatible esptool would be an odd beast. While, in principle, we could leverage the pieces defined here, I would question if we didn't have a better story.

For example, today we have the ability to run up a socket server in a few lines of code, receive a stream of data (the file to be flashed) and upon receipt, invoke a system command (esptool for example).

With that in mind, let us not look at the technology available, but rather clearly state the problem we are trying to solve. From the story so far, I am guessing:

1. I have a PC to which an ESP32 is attached.
2. I have a second PC which is networked to the first PC.
3. From the second PC, I want to be able to flash the ESP32 attached to the first PC.

I think we can "chain" a solution together to do this with sftp, ssh, node.js or a variety of other tools without wandering into "old fashioned" (opinion) telnet based stories.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: flash-programming using rfc2217

Postby ESP_igrr » Sun Sep 17, 2017 4:54 am

felted67: Have you tried using the rfc2217-server.py script from pyserial? I haven't tried it on Windows, but at least on Linux (raspbian) it works fine with esptool.py, allowing us to flash dev boards connected to a remote raspberry pi.

cranphin
Posts: 8
Joined: Mon Apr 02, 2018 12:31 pm

Re: flash-programming using rfc2217

Postby cranphin » Sat Dec 01, 2018 4:00 pm

This works for me using rfc2217_server.py, with some caveats:
- The latest version of esptool that works is 2.4.1, after that they set a timeout, which is not supported by the python rfc2217 client library used.
- Actually getting the board in flash mode does not work, so I manually need to press the buttons, but after that flashing works fine.
I'm guessing the way the protocol and/or server and/or client is set up results in the timings being off too much. Will have to investigate how flashing on these boards was supposed to work, and where things go wrong.

The reason to do this for me is that i'm building the image in docker for windows, which doesn't have access to the serial port.
So I'm creating a TCP connection from the docker container to rfc2217_server.py, which runs on Windows itself, where the serial port is accessible.

cranphin
Posts: 8
Joined: Mon Apr 02, 2018 12:31 pm

Re: flash-programming using rfc2217

Postby cranphin » Sat Dec 01, 2018 4:01 pm

[quote=ESP_igrr post_id=14185 time=1505624053 user_id=241]
felted67: Have you tried using the rfc2217-server.py script from pyserial? I haven't tried it on Windows, but at least on Linux (raspbian) it works fine with esptool.py, allowing us to flash dev boards connected to a remote raspberry pi.
[/quote]

Hi! Did this also put the board in flash mode, or did you have to manually press the buttons?

cranphin
Posts: 8
Joined: Mon Apr 02, 2018 12:31 pm

Re: flash-programming using rfc2217

Postby cranphin » Sat Dec 01, 2018 4:10 pm

[quote=kolban post_id=14184 time=1505616872 user_id=105]
I think we can "chain" a solution together to do this with sftp, ssh, node.js or a variety of other tools without wandering into "old fashioned" (opinion) telnet based stories.
[/quote]

Hi!

One reason to prefer the 'telnet' approach is to keep the IDF functionality, especially the monitor and integrated debug stuff, and flashing based on the sdkconfig settings.

cranphin
Posts: 8
Joined: Mon Apr 02, 2018 12:31 pm

Re: flash-programming using rfc2217

Postby cranphin » Mon Dec 17, 2018 4:57 pm

For anyone interested, more info here:
https://github.com/espressif/esptool/issues/383

Who is online

Users browsing this forum: No registered users and 355 guests