sunnuntai 25. elokuuta 2013

Actisense NGT-1: shortcut to N2K data

After googling around for CAN on Raspberry and looking at Pican installation instructions with associated kernel tweaking I decided to cough up the cash for Actisense NGT-1.
Instead of using Raspberry for the initial test I decided that everything would be a tad easier with my Macbook. I would have needed the Macbook for ssh to Raspberry anyway, so I decided to try NGT-1 out with that.
After a bit of jury rigging the cabling (NGT-1 comes with Micronet connector, I have SeaTalk NG) and installing the Actisense FTDI driver I could admire flashing lights, but actisense_serial was not giving me anything. Debug messages showed that open() call never returned, so after  a bit of googling I added the O_NONBLOCK flag in the best "try something, maybe it will work" programming fashion and lo and behold, I got data!

{"timestamp":"2013-08-24-15:36:10.113","prio":"3","src":"105","dst":"255","pgn":"128267","description":"Water Depth","fields":{"SID":"0","Depth":"8.50","Offset":"0.000"}}
{"timestamp":"2013-08-24-15:36:10.140","prio":"2","src":"105","dst":"255","pgn":"130306","description":"Wind Data","fields":{"SID":"0","Wind Speed":"2.93","Wind Angle":"341.9","Reference":"Apparent"}}
{"timestamp":"2013-08-24-15:36:10.140","prio":"2","src":"105","dst":"255","pgn":"128259","description":"Speed","fields":{"SID":"0","Speed Water Referenced":"0.00","Speed Water Referenced Type":"-0"}}
{"timestamp":"2013-08-24-15:36:10.140","prio":"6","src":"105","dst":"255","pgn":"128275","description":"Distance Log","fields":{"Log":"1424188","Trip Log":"1424188"}}

Now I have all the data I need from the N2K bus, plus some unrecognized PGN 130822, coming from either i70 or ITC-5:

{"timestamp":"2013-08-24-15:36:09.140","prio":"7","src":"105","dst":"255","pgn":"130822","description":"Unknown PGN","fields":{ "Manufacturer Code": "Raymarine","Industry Code":"Marine"}}


Ei kommentteja:

Lähetä kommentti