NaviLink for Linux

Navilink Usage help As you already know, I own a NaviGPS with which I'm very happy. There was only one dark spot: no Linux support. Locosys (which seems to be the real manufacturer, the device is branded by different companies) provides a utility to down- and upload tracks, routes and waypoints for Windows only and my previous attempts to understand the protocol weren't successful.

But yesterday I received a PDF document from Roger Liou at Locosys who saw my previous work at my Wiki1). The document contained the specifications of the NaviLink protocol.

With this kind of help I were finally able to write the first version of a Perl NaviLink client today. While doing so I discovered quite a few errors in the document, so I transfered the contents to a new Wiki page while fixing some of the specs. There are probably some more errors in it, because I haven't implemented the full protocol, yet.

Anyway, for everyone who wants to try it, here is the script:

It's a single Perl script only dependent on Device::SerialPort. It's licensed under the BSD license, so feel free to do whatever you want with it.

Currently only tracklog downloads are supported. Feel free to improve the script by sending patches ;-)

Update: I added a few more modes. The link above always points to the most up to date version, before sending any patches make sure you have a recent release.

Update 2: The script now has a proper project page. Uploading waypoints is finished as well.

Tags:
gps,
navilink,
perl,
linux
Similar posts:
1) well, I received it from Marcel who Roger obviously thought to be responsible for the mentioned Wiki page

 
Posted on Sunday April the 15th, 2007 (16 months ago).

Comments

1
Hi,

Very very nice. Just what we needed (we have 10 of these devices and would really like to be able to use then under linux. I had to make several changes, you can get my version here:

http://kleptog.org/temp/navili … k-fixed.pl

The biggest issue was with the packet reading. Just because a packet ends with b0b3 doesn't mean whenever you see that it's the end of the packet. My trackpoint data happened to contain those two bytes. I fixed that, as well as many other warnings general.

Have a nice day,
2007-04-15 18:44:24
Martijn
2
You're right about the reading. I implemented the simplest thing I could think of first and somehow forgot to take a look at it again. I guess your implementation could be improved speed wise (unpacking the length for each iteration shouldn't be needed) but I applied your changes for now. I'll see if I can come up with something even better in the next days.

Good catch with the comparisons! I did so much PHP coding in the last months that I have a hard time remembering to think of the difference between ne and !=.
2007-04-15 23:38:45
3
Thanks.  Seems to work for me.

If I were to start to create a GUI to front this code are there any preferences at to which library to use.  My initial thoughts are to use Tk, unless anyone has strong feelings about it.

Dave
2007-04-16 14:36:32
Dave Whiteley
4
Personally I have no need for a GUI my self, but I guess others might be very happy about it. I'd say a Tk GUI is pretty enough for such a basic app. The windows application is no beauty itself ;-)
2007-04-18 20:56:15
5
I am adding getwaypoints support, should get that finished today after work, whereupon I will put a patch somewhere and add a note here. After that I'll work on uploading waypoints.
2007-04-23 11:07:19
6
getwaypoints is already supported (redownload the script!) uploading is half finished.
2007-04-23 11:15:18
7
Oops, well, the only other thing I added was a way to download everything in one go (I factored the GPX headers out, then called both download functions and then wrote the </gpx>) but you seem to be racing along so I'll leave you be.

Thanks for all this work, especially the early reverse engineering, which I know from experience (writing firmware uploader for my USB MP3 player) is the frustrating part.
2007-04-23 19:55:11
8
http://devel.tlrmx.org/misc/

has a fix which Works For Me™ to fix a problem I found where the second half of the trackpoints wouldn't stay deleted. I found that the 'delete' feature overwrites 4096 trackpoints with 0xFF, but there are 8192 trackpoints in total, so I added a patch which calls the same delete routine again with a different memory offset. There might be other ways to achieve the same effect, but this worked for me so far.
2007-05-09 01:03:49
9
Thanks Nick, patch applied.
2007-05-12 11:15:23
10
Just a note to say thank you very much for this - works a treat now that I have got Device-SerialPort installed properly. It might be worth mentioning for Ubuntu users that this is available in the universe repository as libdevice-serialport-perl.
2007-06-30 14:36:21
Neil
11
This works lovely for my amaryllo triptracker.  If I find some spare time I might have a go at adding route upload support.
2007-07-13 12:58:23
12
This script didn't work for me, which I suspect is some fault in the GPS itself as it doesn't work getting stuff off using the windows software either.

There is hope for me, though, as the current beta firmware for NaviGPS supports dumping waypoints to the SD card. Trouble is, it appears to be some binary format that I haven't the knowledge to work out how to read.

I can supply a test file if anyone feels the need to have a go. Else looks like I'm stuck for a bit.

Thanks for your efforts!
2007-08-29 16:33:02
Tom Higgy
13
I failed to read the data from my NaviGPS. I get the following error:

florian@migdal:/opt$ perl ./navilink.pl gettp
Timeout while reading. Last bytes where 'b0 b3 '.
Failed to start the communication. Did you enable the NaviLink mode?

same is for navilink.pl info. I'm using a Testing Firmware: V1.61(B0608T). Any hint what i'm doing wrong? Thanks in advance!
2007-09-16 15:13:58
florians
14
Well, just to be sure: you did enable the Navilink mode, right?

I haven't tested the script with your firmware version, yet. Maybe Locosys changed something in the communication protocol.
2007-09-16 21:10:31
15
Strange - now it works! I'm sure i've had NaviLink enabled yesterday, maybe it was because i haven't used the original usb cable. So i can assert navilink.pl works also with firmware V1.61(B0608T) :-)
2007-09-17 08:12:09
16
It runs on OSX on a ppc powerbook with three issues:
1) the device is /dev/tty.usbserial0 not /dev/ttyUSB0
2) It only works once after that I get:
"chris$ ./navilink.pl -d /dev/tty.usbserial0 info  
Timeout while reading. Last bytes where ''.
Failed to start the communication. Did you enable the NaviLink mode?"
(although sometimes with different last bytes), untill I unplug and replug the usb cable (is this related to florians issue above?). Yes it is in NaviLink mode ;)
3) The lat and lon data is garbage. I suspect this is byte order problem somewhere.

1 and 2 I can live with, I may try and fix 3, or I may just use a sensible computer instead.
2007-12-08 15:37:46
chris procter
17
I have a similar problem to Chris Procter (above) on my Macbook Pro running OS X 10.5. I'm happy to help try and diagnose it, but I don't know where to start. Get in touch if you'd like a hand.
2008-02-16 19:55:43
CAPTCHA

No HTML allowed. URLs will be linked with nofollow attribute. Whitespace is preserved.

 
 

Blog

Older Weblog articles are available in the Archive, subscribe to the
Full Content RSS Feed
to stay tuned. (learn more)

Subscribe to the Feed

Recent Blog Entries

 

This is the personal web site of Andreas Gohr - human being, blogger and web geek from Berlin, Germany.

This page was last updated at 2007/04/27 10:38.
Imprint/Impressum

Tagged at del.icio.us:
No tags, yet. Why don't you bookmark it?

View blog reactions

Recent readers: