Using Linux Socat virtual serial port with IDE

I have an Arduino nano connected to the usb port of a raspberry pi and want to program it remotely over a network using a laptop, Debian (Buster) os and the Arduino IDE.

I setup ser2net on the pi and installed Socat on the Debian box. I now have a virtual serial port (ttyNET0) on the laptop and can read data from the Arduino via the pi with a python script. So far, so good.

Only thing left is to get the Arduino IDE (v.1.8.10) to use the virtual serial port. It doesn't appear in the IDE port list. Any body know if this is possible and how?

I also tried running Arduino as root (sudo) from a terminal window but this doesn't solve the issue.

Made some progress on getting my Socat remote serial link to work.

The only available port in my Arduino IDE in the Tools->Port menu is /dev/ttyS0. This is normally the first serial port (of a PC). As I don’t have a physical serial port I reconfigured Socat to use ttyS0 as the virtual serial port. Good news is that the Serial Monitor function in the Arduino IDE is now working ok. Bad news is that I still am unable to download a sketch to my Arduino. I get the error messages as shown in the attached screenshot.

Hope that it is just a question of configuring Socat differently…

You are better inserting error messages as text either as a code ( </> ) sample or using the quote options as picture size in here is pretty dismal for that type of use.

Bob.

This is the output with the upload info set to verbose in the preferences.

Arduino: 1.8.10 (Linux), Board: "Arduino Nano, ATmega328P"

Sketch uses 444 bytes (1%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
/opt/arduino-1.8.10/hardware/tools/avr/bin/avrdude -C/opt/arduino-1.8.10/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyS0 -b115200 -D -Uflash:w:/tmp/arduino_build_133862/BareMinimum.ino.hex:i 

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/opt/arduino-1.8.10/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/pi/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyS0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
ioctl("TIOCMGET"): Invalid argument
ioctl("TIOCMGET"): Invalid argument
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x64
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x65
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x66
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x0d
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x0a
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x64
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x65
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x66
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x0d
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x0a

avrdude done.  Thank you.

An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Guessing that socat doesn't propogate the DTR manipulation used to reset the Arduino...

Opened for RC3105

ballscrewbob:
Opened for RC3105

Thanks.

This is perhaps not an Arduino specific question, but it's definitely Arduino related.

I have Raspbien Buster installed on a Raspberry pi 4, a full install of the 1.8.13 IDE, and various board support installed and working properly. (Most of my projects lately have been based on ESP 8266/32)

I'm trying to do something very simple which has me stumped. Use the Arduino IDE serial monitor and serial plotter with data from a TCP or UDP connection. The esp8266, esp32, python and such are sending data just fine. Listening with "nc -l 1234" dumps it to the console. My first thought was to use a FIFO pipe, but the Arduino IDE won't recognize them as an openable com port. Socat can emulate a tty device buty it doesn't appear as a valid com port to the Arduino IDE.

here's my syntax for socat, nc, and minicom which all work correctly

sudo socat pty,link=/dev/ttyV0,waitslave tcp:127.0.0.1:1234

nc -l 1234

sudo minicom -D /dev/ttyV0

It's probably a Java issue but that's not my bailiwick. Anyone know why the Arduino IDE can't seem to open this port?

thx

Arduino seems to be very picky about identifying "Serial Ports."
For example, you can't symlink /dev/tty.MyUno --> /dev/tty.usbserial-A20e1Kh4 and have it show up.
I thought I saw a patch someone made recently to relax some of this pickiness, which might help you as well...

Umm.... Arduino IDE under Linux serials port list · Issue #5096 · arduino/Arduino · GitHub

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.