Garmin GPSMAP 276C with serial port

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Garmin GPSMAP 276C with serial port

Pierre Brial
Hi all,

I know this is quite old stuff, but I use GPS Babel in a program of
mine, to send waypoints to a Garmin GPS V, in a linux machine via an
USB/serial converter (port /dev/ttyUSB0).

Everything works fine.

Recently, I try the same program with a GPSMAP 276C connected to the
same port, but it doesn't work.

So I tried this simple command in a terminal :

$ gpsbabel -D9 -i garmin -f /dev/ttyUSB0

And the answer is :

------------------------
GPSBabel Version: 1.4.3
Tx Data:10 fe 00 02 10 03 : ...(PRDREQ  )
Rx Data:10 06 02 fe 00 fa 10 03  .. (ACK     )
Rx Data:10 ff b2 1d 01 3a 02 47 50 53 6d 61 70 20 32 37 36 43 20 53 59
53 20 53 6f 66 74 77 61 72 65 20 56 65 72 73 69 6f 6e 20 35 2e 37 30 00
56 45 52 42 4d 41 50 20 41 6d 65 72 69 63 61 73 20 41 75 74 6f 72 6f 75
74 65 20 42 61 73 65 6d 61 70 20 34 2e 30 30 00 56 45 52 53 4d 41 50 20
52 45 55 4e 49 4f 4e 2c 20 4d 61 72 69 6e 65 20 30 2e 30 30 00 56 45 52
41 55 44 20 47 50 53 6d 61 70 20 32 37 36 43 2f 32 39 36 20 41 75 64 20
32 2e 32 30 00 56 45 52 53 50 4c 53 43 52 4e 20 47 50 53 6d 61 70 20 32
37 36 43 20 53 70 6c 61 73 68 20 32 2e 30 30 00 b4 10 03
....GPSmap.276C.SYS.Software.Version.5.70.VERBMAP.Americas.Autoroute.Basemap.4.00.VERSMAP.REUNION..Marine.0.00.VERAUD.GPSmap.276C.296.Aud.2.20.VERSPLSCRN.GPSmap.276C.Splash.2.00.
(PRDDAT  )
Tx Data:10 06 02 ff 00 f9 10 03 : .....(ACK     )
Unit: GPSmap 276C SYS Software Version 5.70
ID: 285
Version: 5.70Rx Data:10 f8 00 08 10 03   (UNKNOWN )
Waypoint type: -1
Chosen waypoint length 10
[ERROR] Get_Waypoint: Unknown waypoint protocol
GARMIN:Can't get waypoint from /dev/ttyUSB0
------------------------

So the GPS is recognised but there is trouble with waypoints.
This command works perfectly with the GPS V.
I tried also with GPSBabel 1.5.0, with the same result.

I got protocol info by connecting the GPS to Oziexplorer. According to
this software GPS V uses waypoint protocol A100, ang GPSMAP 276C uses
A101, so may be there is a slight difference somewhere.

Do some of you successfully use a GPSMAP 276C with GPSBabel with a
serial port ? Is there some options to be added to the command line ?

All the best

Pierre

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Garmin GPSMAP 276C with serial port

Robert Lipe-4
Unlike the V, the 276C isn't actually a serial device.  It's a USB device.  I'm on the road and far away from the one I bought for GPSBabel, but I'm 99% sure it's a USB model and not a serial one.  Granted, it's a ten year old product or so and it's not like I've tested it on EVERY build, but at one time the 276C absolutely worked.

Far more likely, you're using the kernel module in your unnamed version of Linux that makes Garmin USB devices pretend to be Garmin serial devices that's been broken for years. If you can read that with our native usb support (-f usb) and it fails with the emulated serial support (-f /dev/ttyANYTHING) please please please contact your Linux vendor and get them to quit shipping broken code by default.


On Sun, Jun 15, 2014 at 12:34 PM, Pierre Brial <[hidden email]> wrote:
Hi all,

I know this is quite old stuff, but I use GPS Babel in a program of
mine, to send waypoints to a Garmin GPS V, in a linux machine via an
USB/serial converter (port /dev/ttyUSB0).

Everything works fine.

Recently, I try the same program with a GPSMAP 276C connected to the
same port, but it doesn't work.

So I tried this simple command in a terminal :

$ gpsbabel -D9 -i garmin -f /dev/ttyUSB0

And the answer is :

------------------------
GPSBabel Version: 1.4.3
Tx Data:10 fe 00 02 10 03 : ...(PRDREQ  )
Rx Data:10 06 02 fe 00 fa 10 03  .. (ACK     )
Rx Data:10 ff b2 1d 01 3a 02 47 50 53 6d 61 70 20 32 37 36 43 20 53 59
53 20 53 6f 66 74 77 61 72 65 20 56 65 72 73 69 6f 6e 20 35 2e 37 30 00
56 45 52 42 4d 41 50 20 41 6d 65 72 69 63 61 73 20 41 75 74 6f 72 6f 75
74 65 20 42 61 73 65 6d 61 70 20 34 2e 30 30 00 56 45 52 53 4d 41 50 20
52 45 55 4e 49 4f 4e 2c 20 4d 61 72 69 6e 65 20 30 2e 30 30 00 56 45 52
41 55 44 20 47 50 53 6d 61 70 20 32 37 36 43 2f 32 39 36 20 41 75 64 20
32 2e 32 30 00 56 45 52 53 50 4c 53 43 52 4e 20 47 50 53 6d 61 70 20 32
37 36 43 20 53 70 6c 61 73 68 20 32 2e 30 30 00 b4 10 03
....GPSmap.276C.SYS.Software.Version.5.70.VERBMAP.Americas.Autoroute.Basemap.4.00.VERSMAP.REUNION..Marine.0.00.VERAUD.GPSmap.276C.296.Aud.2.20.VERSPLSCRN.GPSmap.276C.Splash.2.00.
(PRDDAT  )
Tx Data:10 06 02 ff 00 f9 10 03 : .....(ACK     )
Unit:   GPSmap 276C SYS Software Version 5.70
ID:     285
Version:        5.70Rx Data:10 f8 00 08 10 03   (UNKNOWN )
Waypoint type: -1
Chosen waypoint length 10
[ERROR] Get_Waypoint: Unknown waypoint protocol
GARMIN:Can't get waypoint from /dev/ttyUSB0
------------------------

So the GPS is recognised but there is trouble with waypoints.
This command works perfectly with the GPS V.
I tried also with GPSBabel 1.5.0, with the same result.

I got protocol info by connecting the GPS to Oziexplorer. According to
this software GPS V uses waypoint protocol A100, ang GPSMAP 276C uses
A101, so may be there is a slight difference somewhere.

Do some of you successfully use a GPSMAP 276C with GPSBabel with a
serial port ? Is there some options to be added to the command line ?

All the best

Pierre

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Garmin GPSMAP 276C with serial port [SOLVED]

Pierre Brial
Hi Robert,

I've succeeded to use Gpsbabel with a Garmin 276C through the serial
port, but I didn't fully unterstand why the original program doesn't work.

The classical transaction between a computer host and a Garmin GPS
follows this exchange of packets :

1- Host : 10 FE 00 02 10 03 : ask for product data (Pid_Product_Rqst)
2- GPS  : 10 06 02 FE 00 FA 10 03 : Acknowledge (ACK)
3- GPS  : 10 FF ... : Pid_Product_Data (id, name, version, etc...)
4- Host : 10 06 02 ff 00 f9 10 03 : ACK
5- GPS  : 10 FD ... : Pid_Protocol_Array (list of supported protocols)

The GPSMAP 276C behaves differently, as it adds another packet before
Pid_Protocol_Array :

1- Host : 10 FE 00 02 10 03 : ask for product data (Pid_Product_Rqst)
2- GPS  : 10 06 02 FE 00 FA 10 03 : Acknowledge (ACK)
3- GPS  : 10 FF ... : Pid_Product_Data (id, name, version, etc...)
4- Host : 10 06 02 ff 00 f9 10 03 : ACK
5- GPS  : 10 F8 00 08 10 03 : Pid_Ext_Product_Data
6- Host : 10 06 02 F8 00 00 10 03 : ACK
7- GPS  : 10 FD ... : Pid_Protocol_Array (list of supported protocols)

Gpsbabel anticipates this behaviour by entering a loop between steps 3
and 7, where it collects packets until it retrieves the Pid_Protocol_Array.

The loop is located in jeeps/gpsapp.cc, between lines 318 and 354.
Packet are retrieved line 328-330 by :

if (GPS_Packet_Read(fd, &rec) <= 0) {goto carry_on;}

For an unknown reason, GPS_Packet_Read return a 0 between steps 4 and 6,
which breaks the loop, so the Pid_Protocol_Array is not retrieved, and
Gpsbabel can't communicate with the 276C.

So I simply replaced the '<=0' by '<0' in the 'if' line 328, and now
Gpsbabel works perfectly with the 276C through the serial port.

Unfortunately I didn't understand the workings of GPS_Packet_Read,
neither why it returns a 0, so I don't know if it is a safe fix.

I will be very glad if you could check this.

All the best

Pierre Brial

On 18/06/2014 10:00, Robert Lipe wrote:
 > The code you'll need to debug is in jeeps/gpsapp.cc  Something's jumping
 > the rails in the decode of the 'A' or the 'D' packets and gps_waypt_type
 > isn't getting set.
 >
 > It's pretty wretched, because Garmin's doc and their reality was so far
 > apart in that era that pretty much every model was a reverse engineering
 > exercise.  Firmware updates of shipping units would frequently change
 > the protocol in incompatible ways.
 >
 >
 > On Mon, Jun 16, 2014 at 2:10 AM, Pierre Brial <[hidden email]
 > <mailto:[hidden email]>> wrote:
 >
 >     Hi Robert,
 >
 >     Thanks for your answer.
 >     Actually, there is two ways to connect the 276C to a computer : With
 >     a serial cable or with a USB cable.
 >
 >     The command given below works with the USB cable, but for some
 >     reasons I would like to use the serial cable.
 >
 >     The 276C works fine with the serial cable with Mapsource,
 >     Oziexplorer and GPSTrackMaker.
 >
 >     The faulty garmin-usb kernel module is not used with /dev/ttyUSB0. I
 >     have absolutely no trouble using this port with a garmin GPS V.
 >
 >     Anyway, the serial connection itself between GPSBabel and the 276C
 >     works, as GPSBabel identifies correctly the unit :
 >
 >     -------------
 >
 >     Unit:    GPSmap 276C SYS Software Version 5.70
 >     ID:    285
 >     Version:    5.70Rx Data:10 f8 00 08 10 03   (UNKNOWN )
 >     Waypoint type: -1
 >     Chosen waypoint length 10
 >     -------------
 >
 >     All the best
 >
 >     Pierre
 >
 >
 >     On 16/06/2014 10:36, Robert Lipe wrote:
 >
 >         Unlike the V, the 276C isn't actually a serial device.  It's
a USB
 >         device.  I'm on the road and far away from the one I bought for
 >         GPSBabel, but I'm 99% sure it's a USB model and not a serial one.
 >            Granted, it's a ten year old product or so and it's not
like I've
 >         tested it on EVERY build, but at one time the 276C absolutely
 >         worked.
 >
 >         Far more likely, you're using the kernel module in your unnamed
 >         version
 >         of Linux that makes Garmin USB devices pretend to be Garmin
serial
 >         devices that's been broken for years. If you can read that
with our
 >         native usb support (-f usb) and it fails with the emulated serial
 >         support (-f /dev/ttyANYTHING) please please please contact your
 >         Linux
 >         vendor and get them to quit shipping broken code by default.
 >
 >
 >         On Sun, Jun 15, 2014 at 12:34 PM, Pierre Brial <[hidden email]
 >         <mailto:[hidden email]>
 >         <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
 >
 >              Hi all,
 >
 >              I know this is quite old stuff, but I use GPS Babel in a
 >         program of
 >              mine, to send waypoints to a Garmin GPS V, in a linux
 >         machine via an
 >              USB/serial converter (port /dev/ttyUSB0).
 >
 >              Everything works fine.
 >
 >              Recently, I try the same program with a GPSMAP 276C
 >         connected to the
 >              same port, but it doesn't work.
 >
 >              So I tried this simple command in a terminal :
 >
 >              $ gpsbabel -D9 -i garmin -f /dev/ttyUSB0
 >
 >              And the answer is :
 >
 >              ------------------------
 >              GPSBabel Version: 1.4.3
 >              Tx Data:10 fe 00 02 10 03 : ...(PRDREQ  )
 >              Rx Data:10 06 02 fe 00 fa 10 03  .. (ACK     )
 >              Rx Data:10 ff b2 1d 01 3a 02 47 50 53 6d 61 70 20 32 37 36
 >         43 20 53 59
 >              53 20 53 6f 66 74 77 61 72 65 20 56 65 72 73 69 6f 6e 20 35
 >         2e 37 30 00
 >              56 45 52 42 4d 41 50 20 41 6d 65 72 69 63 61 73 20 41 75 74
 >         6f 72 6f 75
 >              74 65 20 42 61 73 65 6d 61 70 20 34 2e 30 30 00 56 45 52 53
 >         4d 41 50 20
 >              52 45 55 4e 49 4f 4e 2c 20 4d 61 72 69 6e 65 20 30 2e 30 30
 >         00 56 45 52
 >              41 55 44 20 47 50 53 6d 61 70 20 32 37 36 43 2f 32 39 36 20
 >         41 75 64 20
 >              32 2e 32 30 00 56 45 52 53 50 4c 53 43 52 4e 20 47 50 53 6d
 >         61 70 20 32
 >              37 36 43 20 53 70 6c 61 73 68 20 32 2e 30 30 00 b4 10 03
 >
 >
....GPSmap.276C.SYS.Software.__Version.5.70.VERBMAP.Americas.__Autoroute.Basemap.4.00.__VERSMAP.REUNION..Marine.0.00.__VERAUD.GPSmap.276C.296.Aud.2.__20.VERSPLSCRN.GPSmap.276C.__Splash.2.00.
 >              (PRDDAT  )
 >              Tx Data:10 06 02 ff 00 f9 10 03 : .....(ACK     )
 >              Unit:   GPSmap 276C SYS Software Version 5.70
 >              ID:     285
 >              Version:        5.70Rx Data:10 f8 00 08 10 03   (UNKNOWN )
 >              Waypoint type: -1
 >              Chosen waypoint length 10
 >              [ERROR] Get_Waypoint: Unknown waypoint protocol
 >              GARMIN:Can't get waypoint from /dev/ttyUSB0
 >              ------------------------
 >
 >              So the GPS is recognised but there is trouble with
waypoints.
 >              This command works perfectly with the GPS V.
 >              I tried also with GPSBabel 1.5.0, with the same result.
 >
 >              I got protocol info by connecting the GPS to Oziexplorer.
 >         According to
 >              this software GPS V uses waypoint protocol A100, ang GPSMAP
 >         276C uses
 >              A101, so may be there is a slight difference somewhere.
 >
 >              Do some of you successfully use a GPSMAP 276C with GPSBabel
 >         with a
 >              serial port ? Is there some options to be added to the
 >         command line ?
 >
 >              All the best
 >
 >              Pierre
 >
 >
 >
------------------------------__------------------------------__------------------
 >              HPCC Systems Open Source Big Data Platform from
LexisNexis Risk
 >              Solutions
 >              Find What Matters Most in Your Big Data with HPCC Systems
 >              Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
 >              Leverages Graph Analysis for Fast Processing & Easy Data
 >         Exploration
 >         http://p.sf.net/sfu/__hpccsystems 
<http://p.sf.net/sfu/hpccsystems>
 >              _________________________________________________
 >              Gpsbabel-misc mailing list http://www.gpsbabel.org
 >         [hidden email]
 >         <mailto:[hidden email]>
 >              <mailto:[hidden email]
 >         <mailto:[hidden email]>>
 >
 >              To unsubscribe, change list options, or see archives, visit:
 >         https://lists.sourceforge.net/__lists/listinfo/gpsbabel-misc
 >         <https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc>
 >


On 18/06/2014 11:04, Pierre Brial wrote:

> Hi Robert,
>
> I've succedeed to retrieve waypoints by manually sending commands to the
> GPS using a serial port terminal (gtkterm). So this confirm that there
> isn't hardware or driver trouble with /dev/ttyUSB0.
>
> Thanks for pointing me the source file. I will try to check it.
>
> All the best
>
> Pierre Brial
>
>
> On 18/06/2014 10:00, Robert Lipe wrote:
>> The code you'll need to debug is in jeeps/gpsapp.cc  Something's jumping
>> the rails in the decode of the 'A' or the 'D' packets and gps_waypt_type
>> isn't getting set.
>>
>> It's pretty wretched, because Garmin's doc and their reality was so far
>> apart in that era that pretty much every model was a reverse engineering
>> exercise.  Firmware updates of shipping units would frequently change
>> the protocol in incompatible ways.
>>
>>
>> On Mon, Jun 16, 2014 at 2:10 AM, Pierre Brial <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>     Hi Robert,
>>
>>     Thanks for your answer.
>>     Actually, there is two ways to connect the 276C to a computer : With
>>     a serial cable or with a USB cable.
>>
>>     The command given below works with the USB cable, but for some
>>     reasons I would like to use the serial cable.
>>
>>     The 276C works fine with the serial cable with Mapsource,
>>     Oziexplorer and GPSTrackMaker.
>>
>>     The faulty garmin-usb kernel module is not used with /dev/ttyUSB0. I
>>     have absolutely no trouble using this port with a garmin GPS V.
>>
>>     Anyway, the serial connection itself between GPSBabel and the 276C
>>     works, as GPSBabel identifies correctly the unit :
>>
>>     -------------
>>
>>     Unit:    GPSmap 276C SYS Software Version 5.70
>>     ID:    285
>>     Version:    5.70Rx Data:10 f8 00 08 10 03   (UNKNOWN )
>>     Waypoint type: -1
>>     Chosen waypoint length 10
>>     -------------
>>
>>     All the best
>>
>>     Pierre
>>
>>
>>     On 16/06/2014 10:36, Robert Lipe wrote:
>>
>>         Unlike the V, the 276C isn't actually a serial device.  It's a
>> USB
>>         device.  I'm on the road and far away from the one I bought for
>>         GPSBabel, but I'm 99% sure it's a USB model and not a serial one.
>>            Granted, it's a ten year old product or so and it's not
>> like I've
>>         tested it on EVERY build, but at one time the 276C absolutely
>>         worked.
>>
>>         Far more likely, you're using the kernel module in your unnamed
>>         version
>>         of Linux that makes Garmin USB devices pretend to be Garmin
>> serial
>>         devices that's been broken for years. If you can read that
>> with our
>>         native usb support (-f usb) and it fails with the emulated serial
>>         support (-f /dev/ttyANYTHING) please please please contact your
>>         Linux
>>         vendor and get them to quit shipping broken code by default.
>>
>>
>>         On Sun, Jun 15, 2014 at 12:34 PM, Pierre Brial <[hidden email]
>>         <mailto:[hidden email]>
>>         <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>>
>>              Hi all,
>>
>>              I know this is quite old stuff, but I use GPS Babel in a
>>         program of
>>              mine, to send waypoints to a Garmin GPS V, in a linux
>>         machine via an
>>              USB/serial converter (port /dev/ttyUSB0).
>>
>>              Everything works fine.
>>
>>              Recently, I try the same program with a GPSMAP 276C
>>         connected to the
>>              same port, but it doesn't work.
>>
>>              So I tried this simple command in a terminal :
>>
>>              $ gpsbabel -D9 -i garmin -f /dev/ttyUSB0
>>
>>              And the answer is :
>>
>>              ------------------------
>>              GPSBabel Version: 1.4.3
>>              Tx Data:10 fe 00 02 10 03 : ...(PRDREQ  )
>>              Rx Data:10 06 02 fe 00 fa 10 03  .. (ACK     )
>>              Rx Data:10 ff b2 1d 01 3a 02 47 50 53 6d 61 70 20 32 37 36
>>         43 20 53 59
>>              53 20 53 6f 66 74 77 61 72 65 20 56 65 72 73 69 6f 6e 20 35
>>         2e 37 30 00
>>              56 45 52 42 4d 41 50 20 41 6d 65 72 69 63 61 73 20 41 75 74
>>         6f 72 6f 75
>>              74 65 20 42 61 73 65 6d 61 70 20 34 2e 30 30 00 56 45 52 53
>>         4d 41 50 20
>>              52 45 55 4e 49 4f 4e 2c 20 4d 61 72 69 6e 65 20 30 2e 30 30
>>         00 56 45 52
>>              41 55 44 20 47 50 53 6d 61 70 20 32 37 36 43 2f 32 39 36 20
>>         41 75 64 20
>>              32 2e 32 30 00 56 45 52 53 50 4c 53 43 52 4e 20 47 50 53 6d
>>         61 70 20 32
>>              37 36 43 20 53 70 6c 61 73 68 20 32 2e 30 30 00 b4 10 03
>>
>>
>> ....GPSmap.276C.SYS.Software.__Version.5.70.VERBMAP.Americas.__Autoroute.Basemap.4.00.__VERSMAP.REUNION..Marine.0.00.__VERAUD.GPSmap.276C.296.Aud.2.__20.VERSPLSCRN.GPSmap.276C.__Splash.2.00.
>>
>>              (PRDDAT  )
>>              Tx Data:10 06 02 ff 00 f9 10 03 : .....(ACK     )
>>              Unit:   GPSmap 276C SYS Software Version 5.70
>>              ID:     285
>>              Version:        5.70Rx Data:10 f8 00 08 10 03   (UNKNOWN )
>>              Waypoint type: -1
>>              Chosen waypoint length 10
>>              [ERROR] Get_Waypoint: Unknown waypoint protocol
>>              GARMIN:Can't get waypoint from /dev/ttyUSB0
>>              ------------------------
>>
>>              So the GPS is recognised but there is trouble with
>> waypoints.
>>              This command works perfectly with the GPS V.
>>              I tried also with GPSBabel 1.5.0, with the same result.
>>
>>              I got protocol info by connecting the GPS to Oziexplorer.
>>         According to
>>              this software GPS V uses waypoint protocol A100, ang GPSMAP
>>         276C uses
>>              A101, so may be there is a slight difference somewhere.
>>
>>              Do some of you successfully use a GPSMAP 276C with GPSBabel
>>         with a
>>              serial port ? Is there some options to be added to the
>>         command line ?
>>
>>              All the best
>>
>>              Pierre
>>
>>
>>
>> ------------------------------__------------------------------__------------------
>>
>>              HPCC Systems Open Source Big Data Platform from
>> LexisNexis Risk
>>              Solutions
>>              Find What Matters Most in Your Big Data with HPCC Systems
>>              Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
>>              Leverages Graph Analysis for Fast Processing & Easy Data
>>         Exploration
>>         http://p.sf.net/sfu/__hpccsystems
>> <http://p.sf.net/sfu/hpccsystems>
>>              _________________________________________________
>>              Gpsbabel-misc mailing list http://www.gpsbabel.org
>>         [hidden email]
>>         <mailto:[hidden email]>
>>              <mailto:[hidden email]
>>         <mailto:[hidden email]>>
>>
>>              To unsubscribe, change list options, or see archives, visit:
>>         https://lists.sourceforge.net/__lists/listinfo/gpsbabel-misc
>>         <https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc>
>>
>>
>>

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Garmin GPSMAP 276C with serial port [SOLVED]

Robert Lipe-4
Thanx.  Committed.

Garmin protocol is so wildly inconsistent from device to device (as you presumably noted in that code) there's little wonder they banished it from their product line.


On Sun, Jun 29, 2014 at 12:38 PM, Pierre Brial <[hidden email]> wrote:
Hi Robert,

I've succeeded to use Gpsbabel with a Garmin 276C through the serial
port, but I didn't fully unterstand why the original program doesn't work.

The classical transaction between a computer host and a Garmin GPS
follows this exchange of packets :

1- Host : 10 FE 00 02 10 03 : ask for product data (Pid_Product_Rqst)
2- GPS  : 10 06 02 FE 00 FA 10 03 : Acknowledge (ACK)
3- GPS  : 10 FF ... : Pid_Product_Data (id, name, version, etc...)
4- Host : 10 06 02 ff 00 f9 10 03 : ACK
5- GPS  : 10 FD ... : Pid_Protocol_Array (list of supported protocols)

The GPSMAP 276C behaves differently, as it adds another packet before
Pid_Protocol_Array :

1- Host : 10 FE 00 02 10 03 : ask for product data (Pid_Product_Rqst)
2- GPS  : 10 06 02 FE 00 FA 10 03 : Acknowledge (ACK)
3- GPS  : 10 FF ... : Pid_Product_Data (id, name, version, etc...)
4- Host : 10 06 02 ff 00 f9 10 03 : ACK
5- GPS  : 10 F8 00 08 10 03 : Pid_Ext_Product_Data
6- Host : 10 06 02 F8 00 00 10 03 : ACK
7- GPS  : 10 FD ... : Pid_Protocol_Array (list of supported protocols)

Gpsbabel anticipates this behaviour by entering a loop between steps 3
and 7, where it collects packets until it retrieves the Pid_Protocol_Array.

The loop is located in jeeps/gpsapp.cc, between lines 318 and 354.
Packet are retrieved line 328-330 by :

if (GPS_Packet_Read(fd, &rec) <= 0) {goto carry_on;}

For an unknown reason, GPS_Packet_Read return a 0 between steps 4 and 6,
which breaks the loop, so the Pid_Protocol_Array is not retrieved, and
Gpsbabel can't communicate with the 276C.

So I simply replaced the '<=0' by '<0' in the 'if' line 328, and now
Gpsbabel works perfectly with the 276C through the serial port.

Unfortunately I didn't understand the workings of GPS_Packet_Read,
neither why it returns a 0, so I don't know if it is a safe fix.

I will be very glad if you could check this.

All the best

Pierre Brial

On 18/06/2014 10:00, Robert Lipe wrote:
 > The code you'll need to debug is in jeeps/gpsapp.cc  Something's jumping
 > the rails in the decode of the 'A' or the 'D' packets and gps_waypt_type
 > isn't getting set.
 >
 > It's pretty wretched, because Garmin's doc and their reality was so far
 > apart in that era that pretty much every model was a reverse engineering
 > exercise.  Firmware updates of shipping units would frequently change
 > the protocol in incompatible ways.
 >
 >
 > On Mon, Jun 16, 2014 at 2:10 AM, Pierre Brial <[hidden email]
 > <mailto:[hidden email]>> wrote:
 >
 >     Hi Robert,
 >
 >     Thanks for your answer.
 >     Actually, there is two ways to connect the 276C to a computer : With
 >     a serial cable or with a USB cable.
 >
 >     The command given below works with the USB cable, but for some
 >     reasons I would like to use the serial cable.
 >
 >     The 276C works fine with the serial cable with Mapsource,
 >     Oziexplorer and GPSTrackMaker.
 >
 >     The faulty garmin-usb kernel module is not used with /dev/ttyUSB0. I
 >     have absolutely no trouble using this port with a garmin GPS V.
 >
 >     Anyway, the serial connection itself between GPSBabel and the 276C
 >     works, as GPSBabel identifies correctly the unit :
 >
 >     -------------
 >
 >     Unit:    GPSmap 276C SYS Software Version 5.70
 >     ID:    285
 >     Version:    5.70Rx Data:10 f8 00 08 10 03   (UNKNOWN )
 >     Waypoint type: -1
 >     Chosen waypoint length 10
 >     -------------
 >
 >     All the best
 >
 >     Pierre
 >
 >
 >     On 16/06/2014 10:36, Robert Lipe wrote:
 >
 >         Unlike the V, the 276C isn't actually a serial device.  It's
a USB
 >         device.  I'm on the road and far away from the one I bought for
 >         GPSBabel, but I'm 99% sure it's a USB model and not a serial one.
 >            Granted, it's a ten year old product or so and it's not
like I've
 >         tested it on EVERY build, but at one time the 276C absolutely
 >         worked.
 >
 >         Far more likely, you're using the kernel module in your unnamed
 >         version
 >         of Linux that makes Garmin USB devices pretend to be Garmin
serial
 >         devices that's been broken for years. If you can read that
with our
 >         native usb support (-f usb) and it fails with the emulated serial
 >         support (-f /dev/ttyANYTHING) please please please contact your
 >         Linux
 >         vendor and get them to quit shipping broken code by default.
 >
 >
 >         On Sun, Jun 15, 2014 at 12:34 PM, Pierre Brial <[hidden email]
 >         <mailto:[hidden email]>
 >         <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
 >
 >              Hi all,
 >
 >              I know this is quite old stuff, but I use GPS Babel in a
 >         program of
 >              mine, to send waypoints to a Garmin GPS V, in a linux
 >         machine via an
 >              USB/serial converter (port /dev/ttyUSB0).
 >
 >              Everything works fine.
 >
 >              Recently, I try the same program with a GPSMAP 276C
 >         connected to the
 >              same port, but it doesn't work.
 >
 >              So I tried this simple command in a terminal :
 >
 >              $ gpsbabel -D9 -i garmin -f /dev/ttyUSB0
 >
 >              And the answer is :
 >
 >              ------------------------
 >              GPSBabel Version: 1.4.3
 >              Tx Data:10 fe 00 02 10 03 : ...(PRDREQ  )
 >              Rx Data:10 06 02 fe 00 fa 10 03  .. (ACK     )
 >              Rx Data:10 ff b2 1d 01 3a 02 47 50 53 6d 61 70 20 32 37 36
 >         43 20 53 59
 >              53 20 53 6f 66 74 77 61 72 65 20 56 65 72 73 69 6f 6e 20 35
 >         2e 37 30 00
 >              56 45 52 42 4d 41 50 20 41 6d 65 72 69 63 61 73 20 41 75 74
 >         6f 72 6f 75
 >              74 65 20 42 61 73 65 6d 61 70 20 34 2e 30 30 00 56 45 52 53
 >         4d 41 50 20
 >              52 45 55 4e 49 4f 4e 2c 20 4d 61 72 69 6e 65 20 30 2e 30 30
 >         00 56 45 52
 >              41 55 44 20 47 50 53 6d 61 70 20 32 37 36 43 2f 32 39 36 20
 >         41 75 64 20
 >              32 2e 32 30 00 56 45 52 53 50 4c 53 43 52 4e 20 47 50 53 6d
 >         61 70 20 32
 >              37 36 43 20 53 70 6c 61 73 68 20 32 2e 30 30 00 b4 10 03
 >
 >
....GPSmap.276C.SYS.Software.__Version.5.70.VERBMAP.Americas.__Autoroute.Basemap.4.00.__VERSMAP.REUNION..Marine.0.00.__VERAUD.GPSmap.276C.296.Aud.2.__20.VERSPLSCRN.GPSmap.276C.__Splash.2.00.
 >              (PRDDAT  )
 >              Tx Data:10 06 02 ff 00 f9 10 03 : .....(ACK     )
 >              Unit:   GPSmap 276C SYS Software Version 5.70
 >              ID:     285
 >              Version:        5.70Rx Data:10 f8 00 08 10 03   (UNKNOWN )
 >              Waypoint type: -1
 >              Chosen waypoint length 10
 >              [ERROR] Get_Waypoint: Unknown waypoint protocol
 >              GARMIN:Can't get waypoint from /dev/ttyUSB0
 >              ------------------------
 >
 >              So the GPS is recognised but there is trouble with
waypoints.
 >              This command works perfectly with the GPS V.
 >              I tried also with GPSBabel 1.5.0, with the same result.
 >
 >              I got protocol info by connecting the GPS to Oziexplorer.
 >         According to
 >              this software GPS V uses waypoint protocol A100, ang GPSMAP
 >         276C uses
 >              A101, so may be there is a slight difference somewhere.
 >
 >              Do some of you successfully use a GPSMAP 276C with GPSBabel
 >         with a
 >              serial port ? Is there some options to be added to the
 >         command line ?
 >
 >              All the best
 >
 >              Pierre
 >
 >
 >
------------------------------__------------------------------__------------------
 >              HPCC Systems Open Source Big Data Platform from
LexisNexis Risk
 >              Solutions
 >              Find What Matters Most in Your Big Data with HPCC Systems
 >              Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
 >              Leverages Graph Analysis for Fast Processing & Easy Data
 >         Exploration
 >         http://p.sf.net/sfu/__hpccsystems
<http://p.sf.net/sfu/hpccsystems>
 >              _________________________________________________
 >              Gpsbabel-misc mailing list http://www.gpsbabel.org
 >         Gpsbabel-misc@lists.__sourceforge.net
 >         <mailto:[hidden email]>
 >              <mailto:[hidden email]__sourceforge.net
 >         <mailto:[hidden email]>>
 >
 >              To unsubscribe, change list options, or see archives, visit:
 >         https://lists.sourceforge.net/__lists/listinfo/gpsbabel-misc
 >         <https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc>
 >


On 18/06/2014 11:04, Pierre Brial wrote:
> Hi Robert,
>
> I've succedeed to retrieve waypoints by manually sending commands to the
> GPS using a serial port terminal (gtkterm). So this confirm that there
> isn't hardware or driver trouble with /dev/ttyUSB0.
>
> Thanks for pointing me the source file. I will try to check it.
>
> All the best
>
> Pierre Brial
>
>
> On 18/06/2014 10:00, Robert Lipe wrote:
>> The code you'll need to debug is in jeeps/gpsapp.cc  Something's jumping
>> the rails in the decode of the 'A' or the 'D' packets and gps_waypt_type
>> isn't getting set.
>>
>> It's pretty wretched, because Garmin's doc and their reality was so far
>> apart in that era that pretty much every model was a reverse engineering
>> exercise.  Firmware updates of shipping units would frequently change
>> the protocol in incompatible ways.
>>
>>
>> On Mon, Jun 16, 2014 at 2:10 AM, Pierre Brial <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>     Hi Robert,
>>
>>     Thanks for your answer.
>>     Actually, there is two ways to connect the 276C to a computer : With
>>     a serial cable or with a USB cable.
>>
>>     The command given below works with the USB cable, but for some
>>     reasons I would like to use the serial cable.
>>
>>     The 276C works fine with the serial cable with Mapsource,
>>     Oziexplorer and GPSTrackMaker.
>>
>>     The faulty garmin-usb kernel module is not used with /dev/ttyUSB0. I
>>     have absolutely no trouble using this port with a garmin GPS V.
>>
>>     Anyway, the serial connection itself between GPSBabel and the 276C
>>     works, as GPSBabel identifies correctly the unit :
>>
>>     -------------
>>
>>     Unit:    GPSmap 276C SYS Software Version 5.70
>>     ID:    285
>>     Version:    5.70Rx Data:10 f8 00 08 10 03   (UNKNOWN )
>>     Waypoint type: -1
>>     Chosen waypoint length 10
>>     -------------
>>
>>     All the best
>>
>>     Pierre
>>
>>
>>     On 16/06/2014 10:36, Robert Lipe wrote:
>>
>>         Unlike the V, the 276C isn't actually a serial device.  It's a
>> USB
>>         device.  I'm on the road and far away from the one I bought for
>>         GPSBabel, but I'm 99% sure it's a USB model and not a serial one.
>>            Granted, it's a ten year old product or so and it's not
>> like I've
>>         tested it on EVERY build, but at one time the 276C absolutely
>>         worked.
>>
>>         Far more likely, you're using the kernel module in your unnamed
>>         version
>>         of Linux that makes Garmin USB devices pretend to be Garmin
>> serial
>>         devices that's been broken for years. If you can read that
>> with our
>>         native usb support (-f usb) and it fails with the emulated serial
>>         support (-f /dev/ttyANYTHING) please please please contact your
>>         Linux
>>         vendor and get them to quit shipping broken code by default.
>>
>>
>>         On Sun, Jun 15, 2014 at 12:34 PM, Pierre Brial <[hidden email]
>>         <mailto:[hidden email]>
>>         <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>>
>>              Hi all,
>>
>>              I know this is quite old stuff, but I use GPS Babel in a
>>         program of
>>              mine, to send waypoints to a Garmin GPS V, in a linux
>>         machine via an
>>              USB/serial converter (port /dev/ttyUSB0).
>>
>>              Everything works fine.
>>
>>              Recently, I try the same program with a GPSMAP 276C
>>         connected to the
>>              same port, but it doesn't work.
>>
>>              So I tried this simple command in a terminal :
>>
>>              $ gpsbabel -D9 -i garmin -f /dev/ttyUSB0
>>
>>              And the answer is :
>>
>>              ------------------------
>>              GPSBabel Version: 1.4.3
>>              Tx Data:10 fe 00 02 10 03 : ...(PRDREQ  )
>>              Rx Data:10 06 02 fe 00 fa 10 03  .. (ACK     )
>>              Rx Data:10 ff b2 1d 01 3a 02 47 50 53 6d 61 70 20 32 37 36
>>         43 20 53 59
>>              53 20 53 6f 66 74 77 61 72 65 20 56 65 72 73 69 6f 6e 20 35
>>         2e 37 30 00
>>              56 45 52 42 4d 41 50 20 41 6d 65 72 69 63 61 73 20 41 75 74
>>         6f 72 6f 75
>>              74 65 20 42 61 73 65 6d 61 70 20 34 2e 30 30 00 56 45 52 53
>>         4d 41 50 20
>>              52 45 55 4e 49 4f 4e 2c 20 4d 61 72 69 6e 65 20 30 2e 30 30
>>         00 56 45 52
>>              41 55 44 20 47 50 53 6d 61 70 20 32 37 36 43 2f 32 39 36 20
>>         41 75 64 20
>>              32 2e 32 30 00 56 45 52 53 50 4c 53 43 52 4e 20 47 50 53 6d
>>         61 70 20 32
>>              37 36 43 20 53 70 6c 61 73 68 20 32 2e 30 30 00 b4 10 03
>>
>>
>> ....GPSmap.276C.SYS.Software.__Version.5.70.VERBMAP.Americas.__Autoroute.Basemap.4.00.__VERSMAP.REUNION..Marine.0.00.__VERAUD.GPSmap.276C.296.Aud.2.__20.VERSPLSCRN.GPSmap.276C.__Splash.2.00.
>>
>>              (PRDDAT  )
>>              Tx Data:10 06 02 ff 00 f9 10 03 : .....(ACK     )
>>              Unit:   GPSmap 276C SYS Software Version 5.70
>>              ID:     285
>>              Version:        5.70Rx Data:10 f8 00 08 10 03   (UNKNOWN )
>>              Waypoint type: -1
>>              Chosen waypoint length 10
>>              [ERROR] Get_Waypoint: Unknown waypoint protocol
>>              GARMIN:Can't get waypoint from /dev/ttyUSB0
>>              ------------------------
>>
>>              So the GPS is recognised but there is trouble with
>> waypoints.
>>              This command works perfectly with the GPS V.
>>              I tried also with GPSBabel 1.5.0, with the same result.
>>
>>              I got protocol info by connecting the GPS to Oziexplorer.
>>         According to
>>              this software GPS V uses waypoint protocol A100, ang GPSMAP
>>         276C uses
>>              A101, so may be there is a slight difference somewhere.
>>
>>              Do some of you successfully use a GPSMAP 276C with GPSBabel
>>         with a
>>              serial port ? Is there some options to be added to the
>>         command line ?
>>
>>              All the best
>>
>>              Pierre
>>
>>
>>
>> ------------------------------__------------------------------__------------------
>>
>>              HPCC Systems Open Source Big Data Platform from
>> LexisNexis Risk
>>              Solutions
>>              Find What Matters Most in Your Big Data with HPCC Systems
>>              Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
>>              Leverages Graph Analysis for Fast Processing & Easy Data
>>         Exploration
>>         http://p.sf.net/sfu/__hpccsystems
>> <http://p.sf.net/sfu/hpccsystems>
>>              _________________________________________________
>>              Gpsbabel-misc mailing list http://www.gpsbabel.org
>>         Gpsbabel-misc@lists.__sourceforge.net
>>         <mailto:[hidden email]>
>>              <mailto:[hidden email]__sourceforge.net
>>         <mailto:[hidden email]>>
>>
>>              To unsubscribe, change list options, or see archives, visit:
>>         https://lists.sourceforge.net/__lists/listinfo/gpsbabel-misc
>>         <https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc>
>>
>>
>>

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc