[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: garmin serial probe or force garmin serial mode.
From: |
Philip Lamb |
Subject: |
Re: garmin serial probe or force garmin serial mode. |
Date: |
Tue, 31 Mar 2020 16:39:35 +1300 |
On 31/03/2020, at 1:01 PM, Gary E. Miller <address@hidden> wrote:
> According the their manual, The Geko is NMEA only. It does not support
> Garmin Binary. See Appendix A, and Appendix C.
>
> http://static.garmin.com/pumac/Geko201_OwnersManual.pdf
>
> When the config offers "Garmin", that is just enabling some proprietary
> NMEA sentences: $PGRME, $PGRMM, $PGRMZ, and $PSLIB.
Actually, that’s not correct. The Geko 201 and 301 do output NMEA (and it
outputs the proprietary sentences even when NMEA mode is selected) but also
support Garmin binary, and I’ve got other tools that use the Garmin binary
protocol over serial to query and set waypoints, tracks, and routes using that
protocol which work with the Geko 301.
>>> No probe needed. When the Garmin sends garmin binary it is
>>> auto-detected in packet.c
>>
>> OK, but how would a packet ever be generated if gpsd doesn't know
>> what protocol it should be using to *request* that the device start
>> sending position data?
So, this motivated me to go and look at why the stream is not starting, and
with a small change in driver_garmin.c I have found a fix and it works now:
What was required was to replace the NULL value for the field '.event_hook' in
the structure driver_garmin_ser_binary, with ‘garmin_event_hook’ (i.e. so that
it matches the one used in driver_garmin_usb_binary).
With this change, once a client opens a connected the packet driver detects a
garmin binary format, activates the correct module, and it all just works. See
log output below [1].
I’m happy to submit this one-line change as a patch, although I don’t know
enough about the rest of the gpsd serial system to know whether this would have
side-effects elsewhere. Any thoughts?
Kind regards,
Phil.
—
[1] Relevant log data with this change:
gpsd:INFO: device /dev/tty.usbserial activated
gpsd:INFO: running with effective group ID 20
gpsd:INFO: running with effective user ID 503
gpsd:INFO: startup at 2020-03-31T03:16:47.000Z (1585624607)
gpsd:PROG: switching to match packet type 9:
103340f50f2743666658420000f041000034420300a848261aeb880641dbcb4eab6f45e8bf4f7854e5691d08403909acbf327fac4000000000705915c11200262b0000111003
gpsd:PROG: switch_driver(Garmin Serial binary) called...
gpsd:PROG: selecting Garmin Serial binary driver...
gpsd:INFO: /dev/tty.usbserial identified as type Garmin Serial binary, 0 sec @
9600bps
gpsd:PROG: Garmin: Get Product Data
gpsd:PROG: Garmin: Appl, Product Data req
gpsd:PROG: Garmin: SendPacket(), wrote 6 bytes
gpsd:PROG: Garmin: Set to send reports every 1 second
gpsd:PROG: Garmin: Appl, Command Data: Start Xmit PVT data
gpsd:PROG: Garmin: SendPacket(), wrote 8 bytes
gpsd:PROG: Garmin: PVT Data (51) Sz: 64
gpsd:PROG: Garmin: time_l: 1585624587
gpsd:PROG: Garmin: Appl, mode 3, status 1
gpsd:INFO: Garmin: UTC Time: 1585624587
gpsd:INFO: Garmin: Geoid Separation (MSL-WGS84): from garmin 9.334335,
calculated 9.544527
gpsd:INFO: Garmin: [PVT etc REDACTED]
gpsd:PROG: Garmin: ACK