Skip to content

espflash using pseudo-terminal slave device #823

Open
@dan-corneanu

Description

@dan-corneanu

I’m trying to flash an ESP32 DevKitC board using espflash from a Docker development container on OSX. The board is connected to my host via USB, and I’m using ser2net on the host to forward the serial connection to a TCP port. Inside the container, I use socat to connect the TCP port to a pseudo serial device.

Here are the commands I’m using:

  1. On the host:
ser2net -n -c ./ser2net-esp32.yml
  1. In the Docker container:
sudo socat pty,link=/tmp/dev/tty-esp32,waitslave tcp:host.docker.internal:1234

The ser2net-esp32.yml file looks like this:

connection: &toS0telnet
  accepter: telnet(rfc2217),tcp,1234
  connector: serialdev,/dev/tty.usbserial-130,local

Then, I try to flash the ESP32 with:

espflash flash -p /tmp/dev/tty-esp32 --monitor --chip esp32 target/xtensa-esp32-none-elf/release/esp32-blink

However, I get the following error:

× The serial port '/dev/pts/2' could not be found
  help: Make sure the correct device is connected to the host system

Both /tmp/dev/tty-esp32 and /dev/pts/2 exist in the container:

esp@e86dc5ff0d16:/app$ ls -all /tmp/dev
total 8
drwxr-xr-x 2 esp  esp  4096 Mar 31 06:42 .
drwxrwxrwt 1 root root 4096 Mar 31 06:42 ..
lrwxrwxrwx 1 root root   10 Mar 31 06:42 tty-esp32 -> /dev/pts/2

esp@e86dc5ff0d16:/app$ ls -all /dev/pts/2
crw--w---- 1 root tty 136, 2 Mar 31 07:10 /dev/pts/2

I expect espflash to detect and use the pseudo terminal (/tmp/dev/tty-esp32), but it cannot find it.
Any advice on resolving this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus:needs-investigationIssue requires further investigation

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions