I am planning to use kplex on a raspberry pi to multiplex between an off-the-shelf multiplexer and a nexus server (previously silva, now garmin). The output of this goes to a tcp port and to freeboard. Freeboard takes in the nmea data and sends them on a java display together with maps and graphics so my ipad, computer or phone can become a display.
I'm fairly new to linux, but keep trying tngs until they work.
After getting the wifi ap thing to work, i need to send the consolidated nmea data to a named pipe (fifo) from which freeboard can read them. If i make a fifo (/dev/kplexout) and reboot the rpi, will the fifo still be active, or do I need to run a script on startup?
And in the config file for kplex, will that fifo be listed as [serial]?
Thanks again.
And in the config file for kplex, will that fifo be listed as [serial]?
I will definitely try that. And I will follow the other thread too. Great work!
I'm having some trouble with the wireless access point. It shows some errors on startup. I basically tried to follow the adafruit guide, but it doesn't fly entirely. Would itbe possible to have a look at your pi image?
I have tried to get the output to speak to freeboard, but it seems freeboard (java) only accepts connections like /dev/ttyUSBxx and requires a baud rate. So that rules out [file]. Do you have any hints where I can read up on this?
The slave pty is created with the uid kplex is running as, group tty if kplex is running as root, and permissions 0620.
Thank you for that. I will try and change the permissions in the start script. I understand that I am well outside my knowledge here...
start-stop-daemon --start --quiet --oknodo --exec $DAEMON --startas $DAEMON --chuid $RUN_AS_USER -- -f $KPLEXCONF -o mode=background
status=$?
log_end_msg $status
Great work on this. I tried first to insert as you wrote, but I got /etc/init.d/kplex: 35 Illegal number 0+1+1+1.....
count=`expr $count+1`
Works in the new beta 4. One small issue though. When i restart the kplex service, it complaints about the pty not existing. A reboot works to incorporate changes in config, but not restart.
[global]failover=GP***:0:nx:30:mux
#Arduino kompass[serial]filename=/dev/ttyACM0name=compassdirection=inbaud=38400
#Multiplexer[serial]filename=/dev/ttyUSB0name=muxdirection=bothbaud=4800optional=yes
#Nexus server[serial]filename=/dev/ttyUSB1name=nxdirection=bothbaud=4800optional=yes
#AIS[serial]filename=/dev/ttyUSB2name=aisdirection=bothbaud=38400optional=yes
[tcp]mode=serverport=10110direction=both
#[bcast]#device=eth0#address=255.255.255.255#port=55554
[file]name=logfilename=/home/pi/kplexlogs/nmea.logdirection=outappend=yeseol=n
[pty]name=freeboardmode=masterfilename=/dev/pty22baud=38400group=dialoutperm=0660I haven't either after that time. Let's ignore this.
pi@kplex ~/scripts/python $ sudo service kplex restart[ ok ] Stopping kplex multiplexer: kplex.[ ok ] Starting kplex multiplexer: kplex.pi@kplex ~/scripts/python $ cat /dev/pty23$IIVPW,,N,,*1F$TIROT,1.8,A*32$IIVPW,,N,,*1F^Cpi@kplex ~/scripts/python $ python pynmea_test2.pyTraceback (most recent call last): File "pynmea_test2.py", line 6, in <module> for msg in streamreader.next(): File "/usr/local/lib/python2.7/dist-packages/pynmea2/stream.py", line 33, in next return [nmea.NMEASentence.parse(line) for line in lines] File "/usr/local/lib/python2.7/dist-packages/pynmea2/nmea.py", line 106, in parse raise ParseError('could not parse data: %r' % input)pynmea2.nmea.ParseError: could not parse data: u'30$TIROT,1.8,A*32\r'pi@kplex ~/scripts/python $ python pynmea_test2.pyTraceback (most recent call last): File "pynmea_test2.py", line 2, in <module> pty = open("/dev/pty23")IOError: [Errno 2] No such file or directory: '/dev/pty23'
IOError: [Errno 2] No such file or directory: '/dev/pty23'This is basically a python test trying to parse the pty output on /dev/pty23. As you can see, it throws a kplex unrelated error first, then complains about missing pty.