GARMIN OREGON 300のログがおかしくなる

GPSロガーにGARMIN OREGON 300を使っています.大分前に販売は終了していて,バッテリーボックスや外装がへたっていますが未だ使えています.単3電池2本で12〜16時間程は動作するしいざとなったらUSB経由でも動作します.防水(手持ちのは外装が破損してもう防水ではない)で雨の中も普通に使えるし,地図にOpenStreetMapのデータを使うことも出来ます.




もしかしてOREGON 300は2019年のデータを扱えない?



$ grep trkpt ~/ |head
<trkpt lat="31.254590" lon="130.854801"><ele>28.50</ele><time>1999-05-17T20:55:26Z</time></trkpt>
<trkpt lat="31.254776" lon="130.854894"><ele>29.46</ele><time>1999-05-17T20:55:31Z</time></trkpt>
<trkpt lat="31.254912" lon="130.854996"><ele>31.38</ele><time>1999-05-17T20:55:36Z</time></trkpt>
<trkpt lat="31.254953" lon="130.855057"><ele>31.38</ele><time>1999-05-17T20:55:39Z</time></trkpt>
<trkpt lat="31.255113" lon="130.855215"><ele>33.30</ele><time>1999-05-17T20:55:46Z</time></trkpt>
<trkpt lat="31.255165" lon="130.855251"><ele>33.30</ele><time>1999-05-17T20:55:48Z</time></trkpt>
<trkpt lat="31.255219" lon="130.855322"><ele>34.26</ele><time>1999-05-17T20:55:51Z</time></trkpt>
<trkpt lat="31.255249" lon="130.855343"><ele>35.23</ele><time>1999-05-17T20:55:54Z</time></trkpt>
<trkpt lat="31.255276" lon="130.855375"><ele>34.74</ele><time>1999-05-17T20:55:56Z</time></trkpt>
<trkpt lat="31.255384" lon="130.855460"><ele>35.71</ele><time>1999-05-17T20:56:01Z</time></trkpt>
$ grep trkpt ~/ |tail
<trkpt lat="31.253258" lon="130.851111"><ele>138.09</ele><time>1999-05-18T03:57:15Z</time></trkpt>
<trkpt lat="31.253231" lon="130.851065"><ele>137.61</ele><time>1999-05-18T03:57:16Z</time></trkpt>
<trkpt lat="31.253209" lon="130.851040"><ele>136.64</ele><time>1999-05-18T03:57:17Z</time></trkpt>
<trkpt lat="31.253189" lon="130.851033"><ele>135.68</ele><time>1999-05-18T03:57:19Z</time></trkpt>
<trkpt lat="31.253162" lon="130.851021"><ele>137.13</ele><time>1999-05-18T03:57:22Z</time></trkpt>
<trkpt lat="31.253105" lon="130.850987"><ele>136.64</ele><time>1999-05-18T03:57:30Z</time></trkpt>
<trkpt lat="31.253046" lon="130.850972"><ele>136.64</ele><time>1999-05-18T03:57:36Z</time></trkpt>
<trkpt lat="31.253009" lon="130.850969"><ele>136.16</ele><time>1999-05-18T03:57:41Z</time></trkpt>
<trkpt lat="31.252981" lon="130.850972"><ele>136.64</ele><time>1999-05-18T03:57:48Z</time></trkpt>
<trkpt lat="31.252978" lon="130.850982"><ele>136.64</ele><time>1999-05-18T03:57:54Z</time></trkpt>


$ sed -e "s/1999-05-1[7|8]/2018-12-31/g" 2019-01-01.gpx > 2019-01-01-tr.gpx

10年前の機械だからもう駄目なんだろうかと思いながらOREGON 300のFirmwareのバージョンを見ると3.01でした.



Changes made from version 4.10 to 4.20:
Updated magnetic Earth data
Improved GPS performance
Improved support for BirdsEye™ Satellite Imagery (each provider's imagery can be configured independently)
Increased the maximum number of supported JNX files to 250 from 200
Fixed issues with WAAS/EGNOS
Fixed issue with track navigation sometimes not adding waypoints to the Active Route list
Fixed issue with MPC map labels disappearing
Fixed shutdown on the map page when you have a geocache dashboard active and return after pressing the geocache name
Fixed issue with photo viewer not displaying correctly
Fixed issue with 3D view
Fixed issue with track navigation not adding waypoints to the Active Route list when they are exactly equal to a track point
Fixed shutdown when the device had more than the maximum number of JNX files on it
Fixed shutdown related to topographical maps and land cover text size
Fixed shutdown associated with certain custom POI files
Fixed Glide Ratio to Destination field
Fixed an issue related to adding a geocache as a point in a route
Fixed an issue with magnetic north reference and waypoint headings
Modified the 'Arriving at Destination' message banner so that it no longer appears when navigating to a geocache
Changes made from version 4.00 to 4.10:
Added support for chirp™ (Oregon 300, Oregon 400).
Fixed problem with certain custom maps.
Changes made from version 3.90 to 4.00:
Fixed issue on 3D View where vehicle could move after using the map.
Fixed issue on map page where back button would jump to the main menu.
Fixed issues with odometer distance.
Fixed shutdown while panning the map for extended periods of time.
Changes made from version 3.80 to 3.90:
Added ability to set user declination direction
Added Automatic Shaded Relief option
Added brightness adjustments for BirdsEye imagery
Added Geocache filtering. Select Setup > Geocaches to add custom filters
Added multicaching support
Improved WAAS performance
Fixed elevation profiles to always use the most detailed DEM data loaded
Fixed issue with calculator % function
Fixed issue with map POI's showing twice for a single point
Fixed issue with Oblique Mercator User grid
Fixed occasional shutdowns
Fixed spot sounding display on certain maps
Changes made from version 3.70 to 3.80:
Added BirdsEye control to profiles.
Added screen calibration option to Oregon 200.
Fixed issue changing marine modes.
Fixed map display problems.
Changes made from version 3.60 to 3.70:
Added support for Garmin BirdsEye.
Added mmHg pressure units.
Added ability to change active track color.
Added option to calibrate screen under Setup->Display.
Changes made from version 3.50 to 3.60:
Increased the map drawing range to allow maps to draw farther south.
Corrected issue with route line sometimes not drawing.
Corrected issues with marine POI.
Corrected issues with GB Discoverer maps.
Corrected issue with project waypoint bearing sometimes not showing the input value.
Changes made from version 3.40 to 3.50:
Added ability to view elevation plot of upcoming active route or currently navigated track in blue.
Added display of icons to the lists in Where To? > Waypoints and the Geocaching application.
Added phone numbers when available to POI review pages.
Added Compass, Stopwatch, Active Geocache, and Elevation Plot dashboard options.
Introduced dashboard options to the Compass and Map pages.
Improved track navigation.Visit for more information.
Changes made from version 3.30 to 3.40:
Added profile support for Garmin Custom Maps
Fixed lockup while using GB Discoverer maps
Changes made from version 3.20 to 3.30:
Added support for Garmin Custom Maps
Improved along road routing performance
Changes made from version 3.10 to 3.20:
Added LKS92 map datum
Added support for GPS firmware 3.70
Added support for GPI routes
Improved compass responsiveness
Fixed potential shutdown related to drawing 32-bit map points
Fixed potential issues during power on.
Changes made from version 2.80 to 3.10:
Added Waypoint Averaging application (For more information visit our new Trail Tech website at
Added Sight 'N Go application for the Oregon 300/400i/400c/400t
Added Man Overboard application
Added big numbers option to the trip computer
Added customizable text to unit power-on screen (see \Garmin\startup.txt)
Added ability to load maps from any img file in the Garmin directory
Added new trip computer dashboards
Added option to display four configurable data fields on the map
Added 'search near' option to Geocaches search
Added the ability to view geocache logs separate from the description
Added ability to see a list of points from the map when several points are at the same location
Added ability to edit a waypoint from the waypoint review
Added support for Custom POI database and category selection
Added distance and bearing to point when reviewing a Custom POI
Added POI subcategories
Added change location to Sun and Moon
Added change location to Hunt and Fish
Added ability to force the Oregon into mass storage mode by holding the power button for 30 seconds while plugged into a USB cable
Added NMEA 9600 baud
Improved render quality of GB Discoverer maps and maps with satellite imagery
Improved map zooming
Improved map draw speed
Improved map panning and zooming when shaded relief is turned on
Improved automatic route recalculation
Improved Custom POI spell search
Improved Main Menu setup and added option to add and remove items
Improved readability of configurable data fields
Improved display of numeric degrees and mils
Improved GPS performance at slow speeds in tree cover
Improved compass responsiveness in challenging GPS environments
Improved battery gage for NiMH batteries
Improved stability when changing profiles
Improved Wherigo stability
Improved connection reliability with Spanner
Improved Spanish keyboard
Fixed airport points not displaying on the map
Fixed lockup when a search returns no results
Fixed elevation errors when reviewing a point other than a waypoint
Increased the number of waypoints viewable from the Waypoint Manager and Where To?>Waypoints

仮想環境のWindows 10 Pro 64bitを使ってアップデートできました.



ちなみに今 $11.80 でWindows 10 Pro OEM ライセンスがセールしてたりするので環境がない人はこれを買って仮想環境に入れとくと今回みたいなときに便利です.

そして庭に出て測位してログを確認したら正しい日付のログが録れていました :)


OREGON だと600以降かな?カメラはいらないので600/600t/700?


$ uname -m
$ lsb_release -rd
Description:    Debian GNU/Linux buster/sid
Release:        unstable
$ dpkg-query -W gpsprune gpsbabel
gpsbabel        1.5.4-2
gpsprune        19.2-1





先ずカメラ内時計と実際の時計の差分を求めます.正確な時間を撮影(今回はNICTのJST Clockを撮影)した結果はこんな感じでした.

$ ls --full-time DP1M0608.JPG
-rw-r--r-- 1 mk mk 9043186 2012-01-02 10:27:01.000000000 +0900 DP1M0608.JPG

写真に写った時間 -> 2018-07-17 07:32:00

それぞれUNIX EPOCに変換して引き算をすると差分は206312699秒でした.

$ date +%s -d '2012-01-02 10:27:01'
$ date +%s -d '2018-07-17 07:32:00'
$ expr 1531780320 - 1325467621


$ cp -p ./DP1M0608.JPG /tmp/DP1M0608.JPG
$ exiv2 -a +206312699 /tmp/DP1M0608.JPG
$ exiftime /tmp/DP1M0608.JPG
exiftime: field count mismatch (DateTime)
exiftime: field count mismatch (DateTimeOriginal)
exiftime: field count mismatch (DateTimeDigitized)
exiftime: field count mismatch (ImageUniqueID)
/tmp/DP1M0608.JPG: no timestamps available
$ exif /tmp/DP1M0608.JPG|grep -i date
Date and Time       |25548:01:17 21:27:01
Date and Time       |2012:01:02 10:27:01
Date and Time (Origi|25548:01:17 21:27:01
Date and Time (Digit|25548:01:17 21:27:01


       -a time
              Time  adjustment  in  the  format  [-]HH[:MM[:SS]]. This option is only used with the 'adjust' action. Examples: 1 adds one
              hour, 1:01 adds one hour and one minute, -0:00:30 subtracts 30 seconds.

計算するのが面倒なので差分を秒で指定できるツールはないだろうかと探してみると,exiftags packageのexiftimeが使えそうです.

              If val is numeric, one of either y, m, w, d, H, M, or S must be used to specify which part of the date is to be adjusted.



$ cp -p ./DP1M0608.JPG /tmp/DP1M0608.JPG
$ exiftime /tmp/DP1M0608.JPG
exiftime: field count mismatch (ImageUniqueID)
Image Created: 2012:01:02 10:27:01
Image Generated: 2012:01:02 10:27:01
Image Digitized: 2012:01:02 10:27:01


$ exiftime -v +206312699S /tmp/DP1M0608.JPG
exiftime: field count mismatch (ImageUniqueID)
Image Created: 2018:07:17 07:32:00
Image Generated: 2018:07:17 07:32:00
Image Digitized: 2018:07:17 07:32:00


$ exiftime -v +206312699S -w /tmp/DP1M0608.JPG
exiftime: field count mismatch (ImageUniqueID)
adjust time created in /tmp/DP1M0608.JPG from
  2012:01:02 10:27:01 to 2018:07:17 07:32:00? (y/n [n]) y
Image Created: 2012:01:02 10:27:01 -> 2018:07:17 07:32:00
adjust time generated in /tmp/DP1M0608.JPG from
  2012:01:02 10:27:01 to 2018:07:17 07:32:00? (y/n [n]) y
Image Generated: 2012:01:02 10:27:01 -> 2018:07:17 07:32:00
adjust time digitized in /tmp/DP1M0608.JPG from
  2012:01:02 10:27:01 to 2018:07:17 07:32:00? (y/n [n]) y
Image Digitized: 2012:01:02 10:27:01 -> 2018:07:17 07:32:00
$ exiftime /tmp/DP1M0608.JPG
exiftime: field count mismatch (ImageUniqueID)
Image Created: 2018:07:17 07:32:00
Image Generated: 2018:07:17 07:32:00
Image Digitized: 2018:07:17 07:32:00


$ exiftool "-FileModifyDate<DateTimeOriginal" /tmp/DP1M0608.JPG
Warning: Bad PrintIM size - /tmp/DP1M0608.JPG
    1 image files updated
$ ls --full-time /tmp/DP1M0608.JPG
-rw-r--r-- 1 mk mk 9043186 2018-07-17 07:32:00.000000000 +0900 /tmp/DP1M0608.JPG



$ exiftime -v +206312699S -w -f ./*.JPG
exiftime: field count mismatch (ImageUniqueID)
Image Created: 2012:01:01 08:46:51 -> 2018:07:16 05:51:50
Image Generated: 2012:01:01 08:46:51 -> 2018:07:16 05:51:50
Image Digitized: 2012:01:01 08:46:51 -> 2018:07:16 05:51:50
exiftime: field count mismatch (ImageUniqueID)
Image Created: 2012:01:01 08:55:16 -> 2018:07:16 06:00:15
Image Generated: 2012:01:01 08:55:16 -> 2018:07:16 06:00:15
Image Digitized: 2012:01:01 08:55:16 -> 2018:07:16 06:00:15
$ exiftime -v +206312699S -w -f ./*.X3F


$ gpscorrelate -g ./2018-07-16鹿屋ポタ.gpx -z +9 -n *.JPG
$ gpscorrelate -g ./2018-07-16鹿屋ポタ.gpx -z +9 *.JPG


$ exiftool "-FileModifyDate<DateTimeOriginal" ./*

うまく行ったようです :)


$ dpkg-query -W exiv2 exiftags exif
exif    0.6.21-2
exiftags        1.01-6build1
exiv2   0.25-3.1ubuntu0.18.04.1
$ lsb_release -d
Description:    Ubuntu 18.04.1 LTS
$ uname -m

ExifTool で任意の geotag 埋め込み


撮影した写真への位置情報の書き込みにいつもは GPSロガーで記録したGPSログを使い,gpscorrelateコマンドを利用しています.




       exiv2 -M"set Exif.GPSInfo.GPSLatitude 4/1 15/1 33/1" \
              -M"set Exif.GPSInfo.GPSLatitudeRef N" image.jpg
              Sets  the  latitude to 4 degrees, 15 minutes and 33 seconds north. The Exif standard stipulates that the GPS‐
              Latitude tag consists of three Rational numbers for the degrees, minutes and seconds of the latitude and GPS‐
              LatitudeRef contains either 'N' or 'S' for north or south latitude respectively.

ExifToolを見ると変換なしで行けそうなのでこれで試してみました.(-geotag optionでgpscorrelateと同じこともできそう)

       -geotag TRKFILE
            Geotag images from the specified GPS track log file.  Using the -geotag option is equivalent to writing a value
            to the "Geotag" tag.  After the -geotag option has been specified, the value of the "Geotime" tag is written to
            define a date/time for the position interpolation.  If "Geotime" is not specified, the value is copied from
            "DateTimeOriginal#" (the "#" is added to copy the unformatted value, avoiding potential conflicts with the -d
            option).  For example, the following two commands are equivalent:

                exiftool -geotag trk.log image.jpg
                exiftool -geotag trk.log "-Geotime<DateTimeOriginal#" image.jpg

            When the "Geotime" value is converted to UTC, the local system timezone is assumed unless the date/time value
            contains a timezone.  Writing "Geotime" causes the following tags to be written (provided they can be
            calculated from the track log, and they are supported by the destination metadata format):  GPSLatitude,
            GPSLatitudeRef, GPSLongitude, GPSLongitudeRef, GPSAltitude, GPSAltitudeRef, GPSDateStamp, GPSTimeStamp,
            GPSDateTime, GPSTrack, GPSTrackRef, GPSSpeed, GPSSpeedRef, GPSImgDirection, GPSImgDirectionRef, GPSPitch and
            GPSRoll.  By default, tags are created in EXIF, and updated in XMP only if they already exist.  However,
            "EXIF:Geotime" or "XMP:Geotime" may be specified to write only EXIF or XMP tags respectively.  Note that
            GPSPitch and GPSRoll are non-standard, and require user-defined tags in order to be written.


$ exiftool -v IMGP5011.JPG|grep GPS
  | 12) GPSInfo (SubDirectory) -->
  | + [GPS directory with 11 entries]
  | | 0)  GPSVersionID = 2 0 0 0
  | | Warning = Tag ID 0x0000 out of sequence in GPS
  | | 1)  GPSVersionID = 2 3 0 0
  | | 2)  GPSLatitudeRef = N
  | | 3)  GPSLatitude = 31 19 18.23 (31/1 19/1 1823/100)
  | | 4)  GPSLongitudeRef = E
  | | 5)  GPSLongitude = 130 53 57.6 (130/1 53/1 5760/100)
  | | 6)  GPSAltitudeRef = 0
  | | 7)  GPSAltitude = 7.8833 (78833/10000)
  | | 8)  GPSTimeStamp = 7 10 37 (7/1 10/1 37/1)
  | | 9)  GPSMapDatum = WGS-84
  | | 10) GPSDateStamp = 2018:01:13


  • GPSLongitudeRef=E -> 東経, 西経
  • GPSLongitude=130.86455555555557 -> 経度
  • GPSLatitudeRef=N -> 北緯, 南緯
  • GPSLatitude=31.386555555555553 -> 緯度
  • GPSAltitude=41.47 -> 海抜標高


$ exiftool -GPSLongitudeRef=E -GPSLongitude=130.86455555555557 -GPSLatitudeRef=N -GPSLatitude=31.386555555555553 -GPSAltitude=41.47 IMGP5021.JPG

座標系がないとまずいかなと思いましたがJOSMやGpsPruneにこの写真を読み込んでみると想定していた座標にプロットされました :)


exiftoolは既定値ではIMGP5021.JPG_originalのようにオリジナルファイルのバックアップが作成されるので  問題なかったらこれは消しておきましょう.

$ rm *_original




$ jmtpfs android/
$ ls -ltrA android/内部ストレージ/OsMoDroid | tail -1
-rw-r--r--  1 mk mk  803382  2月 25 21:35 20170225070457.gpx
$ find android -iname "*osmo*"
$ ls -ltrA android/内部ストレージ/OsMoDroid/ | tail -1
-rw-r--r-- 1 mk mk  803382  2月 25 21:35 20170225070457.gpx



$ w3m -dump_source '' | sed -n "s/^.*getJSON('\([^']*\)'.*$/\1/p"


$ w3m -dump_source '' | sed -n "s/^.*getJSON('\([^']*\)'.*$/\1/p" | jq -r .gpx


$ wget


$ w3m -dump_source '' | sed -n "s/^.*getJSON('\([^']*\)'.*$/\1/p" | xargs w3m -dump_source | jq -r .gpx | wget -i -

GPX Viewerで開こうとするとファイルオープン画面から帰ってこなかったですが,GpsPruneだと開けました.ちょっと荒いけど無いよりは全然いいですね.



LGL22 にmineo のSIM を挿して運用していますが,どうもGPS の動作がおかしい.IngressGPS Status & Toolbox を起動して1時間とかずっと置いといても測位できなかったりする.
以下のページを見るとキャリアが用意したA-GPS 情報を配布しているサーバは外からアクセスできなくてMVNO だと使えない,Google提供のA-GPS サーバがあってこれは外から使えるらしいということが分かりました.A-PGS 使えなかった時はタイムアウトして欲しい気もしますが….

  • トークセッション. MVNOとGPSについて (大内)


ということで,/etc/gps.conf のSUPL 部分を以下のように書き換えてみました. と SUPL_PORT=7275 or SUPL_PORT=7276 部分.書き換えた後再起動しても症状は変わらないよう.

Cinnamon Mod だと元々Google のサーバを向いているとのことなので CM12 をそのまま真似してみる.

ただ,この方法は /system 領域の編集が必要なので通常は要root
もうすぐキャリア端末のSIM Free がやりやすくなるようですが,この辺りも解決して欲しいですね.APN みたいに設定画面から書き換えできるようにするとか.


$ ./adb shell
$ su
# mount -o rw,remount /system
# cp -p /etc/gps.conf /etc/
# vi /etc/gps.conf
# cat /etc/gps.conf
# mount -o ro,remount /system
# exit
$ exit