Artikel mit ‘RGM 3800 royaltek linux osm OpenStreetMap GPS’ getagged

Modified script for the RGM 3800

Montag, 09. März 2009

Here’s a modified Version, of the rgm3800py script. It let’s you download tracks and configure your Royaltek RGM-3800. So far I’ve tested it only under Linux but it should work on Windows and Mac OS too.

  • Here’s whats changed so far:
  • Added an additional “get ” command, which stores the received NMEA records in the current directory. And automaticly names the file after the according date. In default mode* it groups the records in one file per day.
  • The date function has been “fixed”, well actually it created a valid timestamp in some way (I think something tactical), but it wasn’t really useable, so it’s now yyyy-mm-dd (HH:MM:SS), pretty, ain’t it? :)
  • For all switches (see below) you can now set default values at the beginning of the script. Also the default device is set to /dev/ttyUSB0 (set this according to your configuration), it saves you to type that -d every time :)

There’ve been some switches added:

  • -s –separate-tracks Creates a new file for every track. Naming scheme is: yyyy-mm-dd_counter.nmea
  • -z:int –zeros=int which sets the number of leading zeros (i.e. if you, for some reason have more than 100 tracks of one single day you might want to set -z:3 so you’ll get 0001 and even 0333 is sorted correctly
  • -c:int –counter-offset=int Imaging this: You just downloaded all tracks from your device (including 7 tracks you created today) and delete your device. What happens? A fellow mapper comes by and what the heck, you go out and tagg a round, but now the script would create a file yyyy-mm-dd_0.nmea, which already exists, since we’ve downloaded it earlier, counter offset to the rescue! With -c:8 you’ll get a file named yyyy-mm-dd_8.mnea and will go on with yyyy-mm-dd_9.nmea … (the next date will start with a counter of 0 again :) )

Usage examples:

./rgm -s -z 3 get 17-  (will get all tracks starting from 17 and store them in individual files with the naming scheme date_000x.nmea )

Note: You must place the switches before the actual command (get, track, etc. )!

Things still left to do:

  • A function to erease the device
  • Geoid correction
  • GPX output
  • Check if file already exists
  • Make it possible to pass a directory as option

UPDATE:

HAHA! You wouldn’t believe it, just the day I finished with the script the original author released an update (to be percicse 2 hours later), jumping from rev. 14 to rev 19 (aaaah, whyyy?! And we thought he isn’t working on it anymore …), well quick changelog: Added GPX output (trackx) and the possibility to erease the memory :)

UPDATE²:

The modifications of rev14 are now adapted to the script of rev19.

UPDATE (March 15, 200):

It’s now also possible to directly download/write files in GPX format with the ‘getx’ command, the other switches also apply to this one (separate/single files, leading zeros, offset counter … ). You’ll notice that a single gpx file, that consists of several tracks, will have several tracks inside, which can be edited manually (i.e. with viking)

You can get the modified version here: http://www.michael-skiba.de/rgm.txt (You might want to rename it to rgm.py or something like that)

The original version can be found here: http://code.google.com/p/rgm3800py/