07 June 2009

Packetlogger update

The packetlogger suite (v20090607) can be downloaded here. It still requires a Lawicel CANUSB device to sniff new data from the NMEA 2000 bus, but it is now split into two parts: the actual "sniffer" called canreader.exe that talks to the bus, and a separate analyzer called analyzer.exe.

Both programs operate in UNIX filter style; canreader can only log CAN data to stdout. It runs until a line is entered on stdin. analyzer reads stdin and write analyzed output to stdout.

Analyzer can run without a CANusb present. Without raw N2K log files though the only thing it can do is show what NMEA PGNs and fields therein the program understands.

Here are some typical usage examples:

analyze -explain # Show what PGNs are understood by the program
canreader | analyzer # read data and analyze immediately
canreader > rawnmea.log # write data that can be analyzed at a later date
cat rawnmea.log | analyze -raw -data # interpret file later date, show three stages of interpreted data
cat rawnmea.log | analyze 129038 # focus on single PGN

Here is a link to the output of analyze -explain that shows the current list of supported PGNs.

PGNs that have improved in this release:
  • 127505 - Fluid Level (now complete)
  • 129038 - AIS Class A Position Report (now usable)
  • 129283 - Cross Track Error (one field left to explain)
  • 129794 - AIS Class A Static and Voyage Related Data (now usable, ETA still wrong)
  • 130836 - Simnet: Configure? (understands EP65R configuration data)


  1. Kees,

    I'm very interested in the work you are doing. It's similar to a project I'm about to start. Regarding your logger, is it Lawicel-specific, or are you running on top of the CANUSB serial drivers? I have a Actisense USB-N2K interface that I'd like to try out and was planning on writing my own logging code but I'd definitely prefer to give yours a try if the drivers work in a similar fashion.

    Thanks for posting!

  2. Hi Adam,

    I used the CANUSB DLL which is Lawicel specific. This doesn't matter much as the CAN adapter has to put a protocol on the emulated RS-232 port anyway, and I doubt that Actisense has the same protocol.

    However, since the split this is easy: all you need to do is write your own 'actisensereader' program that interfaces with your Actisense device and spits out formatted bytes on stdout.

    The format that canreader produces and that analyzer requires is:


    where byte repeats len times (max 8) and contains a hex value. Every line represents a single CAN packet. The analyzer performs Fast Packet concatenation, so all you need to worry about is getting the packets.

    An example of something analyzer can read:


  3. Kees:

    Makes sense. I actually assumed that the N2K bytestream would be put onto the virtual serial bus directly. Is that not the case? You are obviously doing some processing to convert the data stream into your CSV output.

    I'll take a look at the Actisense software on the CD they shipped with the interface. Now I just need a sensor of some kind to generate some data... :)