Skip to contentSkip to conversation

Serial-to-socket conversion

DISCUSSION Joshua Lamorie 2 participants 4 messages May 25, 2004

lore
Share & tools
lore
#0 lore raw

Gidday there,

I want to remotely access a serial port, but I can't just open a shell on the remote computer. What I would like to do is open minicom (or kermit or pppd) point it to some device local to my computer which then bridges through a socket to my funky remote serial port. I can't find any references to similar code other than perhaps pty-redir. Sorry for polluting this mailing list, but if you can point me towards something more appropriate, I would appreciate it.

Thanks

Joshua

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 8 lines · In message <[email protected]> you wrote:

I want to remotely access a serial port, but I can't just open a shell on the remote computer. What I would like to do is open minicom (or kermit or pppd) point it to some device local to my computer which then bridges through a socket to my funky remote serial port. I can't find any references to similar code other than perhaps pty-redir. Sorry for polluting this mailing list, but if you can point me towards something more appropriate, I would appreciate it.

We're running a modified version of netkit-rsh which allows to use "rlogin <host> -l <portname>" to connect to a remote serial port; for example, this config file might be used:

	#
	# tserver.conf
	#
	# This file should contain one line for each board.
	#
	# The first field is the name of the board.
	# The next field is the device to which the board is attached.
	# Next comes a comma-separated list of parameters in the form
	# BAUDRATE,DATABITS,PARITY,STOPBITS,FLOWCONTROL.
	#
	# port  device          parameters
	#
	board1	/dev/ttyS0      19200,8,N,1
	board2	/dev/ttyS1      57600,8,N,1,CRTSCTS
	board3	/dev/ttyUSB0	9600,8,N,1
	board4	/dev/ttyUSB1    115200,8,N,1

If you want I can send you the stuff; if ther eis more interest I can put it on our FTP server.

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to
reality. -- Albert Einstein

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw

Thank you for your suggestions.

Quoted 5 lines · Wolfgang Denk

We're running a modified version of netkit-rsh which allows to use "rlogin <host> -l <portname>" to connect to a remote serial port; for example, this config file might be used:

Quoted 5 lines · Gerald (AGRE)

At this point you should be able to telnet into your target computer, port 1234 (in the above example), from your remote computer:
telnet 192.168.1.1 1234
(filling in the proper IP address and port number). Anything you type should go out the serial port and anything that comes in the serial port should be sent to your telnet session.

However, my problem remains at the local end. I want to be able to attach anything that would normally talk to a serial port to this socket, without using an actual serial port because at the remote end I have a 'funky serial port'. It's actually some logic talking SPI in a way that allows bi-directional emulation of a serial port.

I really want to be able to aim minicom at /dev/ttySFAKESERIALPORT which is really a bi-directional pipe to some socket program (possibly nc) and then I'll take care of the rest. I want to do some file transfers through this 'funky serial port', with error checking and I really don't want to have to write my own.

Thanks again for your suggestions, and if I didn't have to make this happen today, I'd probably try to write something lower level. My current solution is to have two serial ports on the local computer. Minicom talks out ttyUSB0 through a null modem to ttyUSB1. serial_client.c listens on ttyUSB1 and has a socket open to the remote computer. The remote computer does some funky shimmy sham and passes every octet on to the embedded system. Ugly, but I think it will work (at low speeds with no hardware flow control).

Joshua

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw
In reply to Wolfgang Denk
Quoted 1 line · In message <[email protected]> I wrote:

...

Quoted 3 lines

We're running a modified version of netkit-rsh which allows to use "rlogin <host> -l <portname>" to connect to a remote serial port; for example, this config file might be used:

...

Quoted 2 lines

If you want I can send you the stuff; if ther eis more interest I can put it on our FTP server.

OK, OK, OK - please stop sending requests...

You can find our "terminal server" package at

	ftp://ftp.denx.de/pub/tools/tserver-0.17-3.i386.rpm
	ftp://ftp.denx.de/pub/tools/tserver-0.17-3.src.rpm

The first is a RPM for RH 9; the second is the Source RPM.

As mentioned before, this is an extension/add-on to netkit-rsh-0.17 which requires the following acknowledgement:
This product includes software developed by the University of California, Berkeley and its contributors.
Our extension itself is available under GPL.

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] "Data is a lot like humans: It is born. Matures. Gets married to other data, divorced. Gets old. One thing that it doesn't do is die.
It has to be killed." - Arthur Miller

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/