I did a lot of experimentations with socat and pipes for my program
Gippy.
I found that Opencpn will only read from a pipe if the pipe is in a directory named 'dev' ... thus, Gippy ouptuts to '/tmp/dev/vgps0-5' for opencpn.
I also found that you will have to start piping data before launching opencpn... Opencpn will not see it otherwise.
I ended up not using socat in Gippy since I could spawn my own pts socket in python and emulate a 4800 baud serial port.
Anyhow, here is some experimentation examples I kept using socat:
Code:
WORKS sending to maxsea timezero & v12 over network
socat -d -d -u /dev/ttyUSB0,nonblock,raw,echo=0,b4800 UDP-SENDTO:10.254.254.62:10000
WORKS sending to coastal explorer over network
socat -d -d -u /dev/ttyUSB0,nonblock,raw,echo=0,b4800 TCP4-LISTEN:23002,fork
WORKS sending to virtual serial
socat -d -d -u /dev/ttyUSB0,nonblock,raw,echo=0,b4800 PTY,link=$HOME/dev/vmodem0,raw,echo=0,wait-slave
WORKS sending to pipe
socat -d -d -u /dev/ttyUSB0,nonblock,raw,echo=0,b4800 PIPE:/home/will/fifo,fork
@Dave,
UDP, TCP, and variable baud rate data sources for opencpn would be a cool feature for future versions