esp32s2 flash remotely, socat
Posted: Wed Dec 06, 2023 6:55 am
Hello!
I'm trying to forward the ESP serial port for remote firmware.
ESP is connected to the Windows machine and the flashing port is com41, the port in normal mode (usb>serial) is com43. First I try the normal mode.
On this computer I start a connection to the Linux server:
socat /dev/ttyS42,raw,echo=0 TCP:serverip:1723 (com43 to remote)
The server is running: socat -d -d -d PTY,link=/dev/ttyS10,raw,echo=0 tcp-listen:1723 (remote to virtual ttyS10)
I uploaded a sketch to ESP that outputs the test line to the serial and it works on the server: cat /dev/ttyS10 shows the lines "test" from esp. Everything is working.
However, when I put the ESP into download mode and try to connect com41 for flashing remotelly:
socat -d -d -d /dev/ttyS40,raw,echo=0 TCP:serverip:1723
I get instantly:
2023/12/06 06:45:23 socat[4324] I interpreting address "/dev/ttyS40" as file name
2023/12/06 06:45:23 socat[4324] I setting option "raw"
2023/12/06 06:45:23 socat[4324] I setting option "echo" to 0
2023/12/06 06:45:23 socat[4324] I "/dev/ttyS40" is not a socket, open()'ing it
2023/12/06 06:45:23 socat[4324] N opening character device "/dev/ttyS40" for reading and writing
2023/12/06 06:45:23 socat[4324] I open("/dev/ttyS40", 012, 0666) -> 3
2023/12/06 06:45:23 socat[4324] W cannot query current terminal settings on fd 3: Invalid argument
2023/12/06 06:45:23 socat[4324] E tcgetattr(3, 0x28a844): Invalid argument
2023/12/06 06:45:23 socat[4324] N exit(1)
What's wrong?
I'm trying to forward the ESP serial port for remote firmware.
ESP is connected to the Windows machine and the flashing port is com41, the port in normal mode (usb>serial) is com43. First I try the normal mode.
On this computer I start a connection to the Linux server:
socat /dev/ttyS42,raw,echo=0 TCP:serverip:1723 (com43 to remote)
The server is running: socat -d -d -d PTY,link=/dev/ttyS10,raw,echo=0 tcp-listen:1723 (remote to virtual ttyS10)
I uploaded a sketch to ESP that outputs the test line to the serial and it works on the server: cat /dev/ttyS10 shows the lines "test" from esp. Everything is working.
However, when I put the ESP into download mode and try to connect com41 for flashing remotelly:
socat -d -d -d /dev/ttyS40,raw,echo=0 TCP:serverip:1723
I get instantly:
2023/12/06 06:45:23 socat[4324] I interpreting address "/dev/ttyS40" as file name
2023/12/06 06:45:23 socat[4324] I setting option "raw"
2023/12/06 06:45:23 socat[4324] I setting option "echo" to 0
2023/12/06 06:45:23 socat[4324] I "/dev/ttyS40" is not a socket, open()'ing it
2023/12/06 06:45:23 socat[4324] N opening character device "/dev/ttyS40" for reading and writing
2023/12/06 06:45:23 socat[4324] I open("/dev/ttyS40", 012, 0666) -> 3
2023/12/06 06:45:23 socat[4324] W cannot query current terminal settings on fd 3: Invalid argument
2023/12/06 06:45:23 socat[4324] E tcgetattr(3, 0x28a844): Invalid argument
2023/12/06 06:45:23 socat[4324] N exit(1)
What's wrong?