Ubuntu 9.04 Serial application to telnet to serial device

Hello!

I am working on an application which reads environmental instruments which have serial ports. The application requires a serial port to be present to talk to the device (i.e. /dev/ttyS0 ). In some instances the environmental devices will be 100's of yards away from the computer, so a serial cable becomes a liability. In these scenarios we would like to use a multi-port terminal server which serves up multiple serial connections via telnet.

I have almost solved the problem...but need some help finishing. DETAILS:
The configuration we have is:

Computer/Ubuntu 9.04 --> Ethernet ----> Telnet Based Serial Device Server --> Serial Device

I have run remserial and am able to interact with the serial device using socat or netcat from the terminal. However, SJINN as with as other serial port viewers are unable to connect to the generated pseudo serial port. I get an error about ioctrl.

DETAILED STEPS I FOLLWED:

1) Create a file in /dev called �remserial1� and chmod this to 777.

2) Run

./remserial -d -r XXX.XXX.XXX.XXX -p 10001 -l /dev/remserial1 /dev/ptmx &

3) When I do the following command

socat - /dev/remserial1,raw,crnl &

I can interact with the serial device as if I had a serial connection to it.

The Issue: When I use a normal serial viewer (in this case SJINN or Serial Port Terminal gtkterm) with gtkterm I get �Control signals read: Invalid argument�. With SJINN I get an error involving ioctrl.

I believe that it has to do with trying to read a pseudo terminal, but am at my wits end :confused:, any advice would be appreciated. Also, before linking netcat or socat examples, please remember that an application on the computer must speak with a serial port, which is then relayed over telnet and back to a serial device without buying some serial port redirector package.

1) Create a file in /dev called �remserial1� and chmod this to 777.

What is this file? How do you create it?

I might try putty's serial device option in raw mode.

I used some command like

echo " " > /dev/remserial1; chmod 777 remserial1

I use PuTTy allot. I will try the raw mode. I do know that the pseudo terminal is in raw mode, maybe that's the ticket. Will write back when I try.:wink:

Putty in raw mode dosen't do it. I can use screen /dev/remserial1 and that works fine. I think I need to specify the baud rate and comm settings of the virtual device.

What does it do, exactly?

Sounds like setting the baud rate is what these serial programs are failing on... it's not acting like a serial port, it's acting like a virtual terminal. A terminal emulator that insists on a real serial port might never accept it.

---------- Post updated at 02:34 PM ---------- Previous update was at 02:26 PM ----------

That's a very odd way to create a device file... Have you tried not doing this and just letting remserial create the device itself?

I thought that you needed a fifo file for simultating serial communication? You should try something along the lines of:

mkfifo /dev/remserial1