ssh and the serial port

Hi all,

I have a (very simple) sketch running on my arduino (Duemilanove) which monitors two temperature-sensors. Ouput in the serial port works fine, but now I would like to do 'remote monitoring': transfer the data from my laptop running arduino over ssh to my PC in another room. Does someone know a way to transfer data from the serial port over ssh?
Thanks for any suggestions!

Ko.

What OS is the laptop running? If it's running a *nix variant, you can just use a command-line serial client, such as screen.

And when you say 'transfer data', what do you mean?

Running Linux on both machines, I'd set up a daemon process on the laptop to read the serial data and stick it in a file. That way, you won't have data loss if your ssh session dies for any reason. Then, the daemon process could also use use something like netcat to transfer the data.

I thought of what might be a very simple approach. I make a couple assumptions, but I think with a bit of substitution, as appropriate, this could be the easiest way to do this, using Linux. (Unless I completely misunderstand the nature of the serial connection)

I'm assuming USB serial, but this would work on a std. serial port as well.

On your PC in the other room:

$netcat -l {appropriate options for host:port} > arduino.log

On your laptop connected to the Arduiono:

$ cat /dev/usb/ttyUSB0 | tee /path/to/arduino.log | netcat {appropriate options for host:port}

So whatever the Arduino writes out to serial, the cat command cat sends to the tee command, which both writes it to a logfile, and sends it, via stdout, to netcat, which sends it over the network to your remote PC. The netcat command on the other end receives it and copies it, via stdout, to a file.

You can set up an ssh tunnel, and have netcat use it too.