Using CANboat

canboat edited this page Nov 24, 2014 · 2 revisions

CANboat as published can be used to:

  1. Read and write output from the CAN bus via an Actisense NGT-1 -- see actisense-serial.
  2. Translate the output to 'human readable' form or JSON and a little NMEA-0183 -- see analyzer.
  3. Provide this output to multiple clients using a TCP/IP server -- see n2kd.
  4. Write PGNs to the CAN bus when nothing else is reading from the bus -- see below.
  5. Write PGNs to the CAN bus when the TCP/IP server is reading from the bus -- see below.

Writing to the CAN bus (exclusively)

If there is no actisense-serial program using the serial device emulated by the NGT-1, you can send output in the normal ASCII format to the standard input of actisense-serial to write to the bus.

For example:

echo 2012-06-17-15:02:11.000,6,59904,0,255,3,14,f0,01 | actisense-serial /dev/ttyUSB0

Note that the actisense-serial program does not program the NGT-1 to tell it which PGNs to pass through to the bus, so whether the PGN is actually sent is up to the NGT-1. You can use the Actisense NMEA reader to set what it passes on.

Writing to the CAN bus (shared)

If you are already using a copy of actisense-serial to read from the bus you can use one of the following strategies.

Create a UNIX fifo and write to it when you want to write a command:

mknod /tmp/canbus-write p
actisense-serial /dev/ttyUSB0 < /tmp/canbus-write | analyzer | ...
...
echo 2012-06-17-15:02:11.000,6,59904,0,255,3,14,f0,01 > /tmp/canbus-write

Create a TCP or UDP listener with nc or netcat:

nc -lk localhost 5000 | actisense-serial /dev/ttyUSB0 < /tmp/canbus-write | analyzer | ...
...
echo 2012-06-17-15:02:11.000,6,59904,0,255,3,14,f0,01 | nc localhost 5000
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.