GPS Forums


Reply
Thread Tools Display Modes

Send waypoint to a garmin GPS

 
 
Beuche
Guest
Posts: n/a
 
      10-07-2004, 01:31 PM
Hello,
I want to send waypoints from my pc to my garmin gps with grmn/grmn
protocol.

I know that you must send something like this:
10 23 3A 48 4F 4D 45 20 20 00 22 92 1C 3F FA 44 B5 A6 19 9B 08 31 32
33 20 53 4E 4F 57 4D 41 53 53 20 50 4C 00 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 E9 10 03

10 Start of message
23 Waypoint record ID
3A Number of message bytes to follow
484F... Waypoint ID, 6 letters
0022921C Latitude (40.17773)
3FFA44B5 Longitude (-105.8985)
A6199B08 Time waypoint stored (144,382,374 seconds since 12/31/89
00:00:00), UTC
313233.. Waypoint comment, 40 letters
E9 Checksum
1003 Message terminator

But how do you calculate the checksum??
Some one can help me please...
 
Reply With Quote
 
 
 
 
Steve in Nevada
Guest
Posts: n/a
 
      10-08-2004, 03:14 AM

From "GARMIN GPS Interface Specification April 13, 1999", paragraph 4.1.1:

"2's complement of the sum of all bytes from byte 1 to byte n-4" where byte 1
is the byte following the 10 DLE (Start of Message), and byte n-4 is the byte
immediately before the checksum.

FYI, 2's complement of a byte is easily formed by inverting byte and adding 1.

Regards,

Steve


In article <(E-Mail Removed)> ,
http://www.gps-forums.net/(E-Mail Removed) (Beuche) wrote:
>Hello,
>I want to send waypoints from my pc to my garmin gps with grmn/grmn
>protocol.
>
>I know that you must send something like this:
>10 23 3A 48 4F 4D 45 20 20 00 22 92 1C 3F FA 44 B5 A6 19 9B 08 31 32
>33 20 53 4E 4F 57 4D 41 53 53 20 50 4C 00 20 20 20 20 20 20 20 20 20
>20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 E9 10 03
>
>10 Start of message
>23 Waypoint record ID
>3A Number of message bytes to follow
>484F... Waypoint ID, 6 letters
>0022921C Latitude (40.17773)
>3FFA44B5 Longitude (-105.8985)
>A6199B08 Time waypoint stored (144,382,374 seconds since 12/31/89
>00:00:00), UTC
>313233.. Waypoint comment, 40 letters
>E9 Checksum
>1003 Message terminator
>
>But how do you calculate the checksum??
>Some one can help me please...

 
Reply With Quote
 
 
 
 
Beuche
Guest
Posts: n/a
 
      10-08-2004, 08:59 AM
(E-Mail Removed) (Beuche) wrote in message news:<(E-Mail Removed) om>...
> Hello,
> I want to send waypoints from my pc to my garmin gps with grmn/grmn
> protocol.
>
> I know that you must send something like this:
> 10 23 3A 48 4F 4D 45 20 20 00 22 92 1C 3F FA 44 B5 A6 19 9B 08 31 32
> 33 20 53 4E 4F 57 4D 41 53 53 20 50 4C 00 20 20 20 20 20 20 20 20 20
> 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 E9 10 03
>
> 10 Start of message
> 23 Waypoint record ID
> 3A Number of message bytes to follow
> 484F... Waypoint ID, 6 letters
> 0022921C Latitude (40.17773)
> 3FFA44B5 Longitude (-105.8985)
> A6199B08 Time waypoint stored (144,382,374 seconds since 12/31/89
> 00:00:00), UTC
> 313233.. Waypoint comment, 40 letters
> E9 Checksum
> 1003 Message terminator
>
> But how do you calculate the checksum??
> Some one can help me please...



If some one is interresting I know the response.
In fact the checksum is:
- the sum between the 2nd and the 61st element.
- FF - "result of the sum" + 1
- take the end byte of the result number

In this example:
FF - (23 3A 48 4F 4D 45 20 20 00 22 92 1C 3F FA 44 B5 A6 19 9B 08 31
32 33 20 53 4E 4F 57 4D 41 53 53 20 50 4C 00 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20) + 1 = E9
 
Reply With Quote
 
kashe@sonic.net
Guest
Posts: n/a
 
      10-08-2004, 09:24 AM
On 7 Oct 2004 06:31:04 -0700, (E-Mail Removed) (Beuche) wrote:

>Hello,
>I want to send waypoints from my pc to my garmin gps with grmn/grmn
>protocol.
>
>I know that you must send something like this:
>10 23 3A 48 4F 4D 45 20 20 00 22 92 1C 3F FA 44 B5 A6 19 9B 08 31 32
>33 20 53 4E 4F 57 4D 41 53 53 20 50 4C 00 20 20 20 20 20 20 20 20 20
>20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 E9 10 03
>
>10 Start of message
>23 Waypoint record ID
>3A Number of message bytes to follow
>484F... Waypoint ID, 6 letters
>0022921C Latitude (40.17773)
>3FFA44B5 Longitude (-105.8985)
>A6199B08 Time waypoint stored (144,382,374 seconds since 12/31/89
>00:00:00), UTC
>313233.. Waypoint comment, 40 letters
>E9 Checksum
>1003 Message terminator
>
>But how do you calculate the checksum??
>Some one can help me please...



<http://www.rahul.net/kashe/checksum/checksum.exe> -- is a
small (20K) program that will allow you to type in your sentence and
have the checksum calculated for you.

I don't remember where I got it, but, if I take sentences from
my GPSR, remove the checksum and paste the remaining text into this
program, it consistently generates the same checksum as the GPSR does.

The program expects data in the form of a normal sentence,
excluding the starting $ and the final * (which appears before the
calculated checksum). These will be provided in the final output.

From the included example, it seems to expect something
starting with PMGNCMD or a the equivalent Garmin-specific command,
with the following information as comma-delimited text fields, not hex
bytes, as you seem to be providing.

I'm not sure exactly how much of what you show should be provided, or
if the

If you're interested in code to generate the checksum to
include in a program, googling "how to calculate gps checksum" will
lead you to plenty of examples.

HTH

 
Reply With Quote
 
Bruce Stemplewski
Guest
Posts: n/a
 
      10-09-2004, 01:19 PM
Checksum calculation is not to straight forward for the Garmin. Below
is some code from my GarXface C++ Library and OCX. I already have a C++
library and OCX working for the Garmin. Please check it out at
www.stempspft.com


while (i < PacketLen)
{


//Read the data length
b = _GetByteFromPort(bSuccess);

if (!bSuccess)
{
if (m_bLoggingOn)
{
fprintf(f,"\nThrowing exception File = %s Line =
%d\n",__FILE__,__LINE__);
fflush(f);
}


throw CGarminGpsException(GX_ERR_COM_NO_RESPONSE,FALSE,0 );
}


if (m_bLoggingOn)
fprintf(f,"%d ",b);

Buffer[i++] = b;
cs-=b;


//If the byte was a DLE then get another byte
if (b==0x10)
{
b = _GetByteFromPort(bSuccess);

if (!bSuccess)
{
if (m_bLoggingOn)
{
fprintf(f,"\nThrowing exception File = %s Line =
%d\n",__FILE__,__LINE__);
fflush(f);
}

throw CGarminGpsException(GX_ERR_COM_NO_RESPONSE,FALSE,0 );
}


if (b != 0x10)
{

if (m_bLoggingOn)
{
fprintf(f,"\nThrowing exception File = %s Line =
%d\n",__FILE__,__LINE__);
fflush(f);
}

throw
CGarminGpsException(GX_ERR_GPS_INTERNAL_PROTOCOL,F ALSE,GX_EXERR_GPS_DLE_EXPECTED);


}
}


Bruce Stemplewski
www.stempsoft.com



Beuche wrote:
> Hello,
> I want to send waypoints from my pc to my garmin gps with grmn/grmn
> protocol.
>
> I know that you must send something like this:
> 10 23 3A 48 4F 4D 45 20 20 00 22 92 1C 3F FA 44 B5 A6 19 9B 08 31 32
> 33 20 53 4E 4F 57 4D 41 53 53 20 50 4C 00 20 20 20 20 20 20 20 20 20
> 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 E9 10 03
>
> 10 Start of message
> 23 Waypoint record ID
> 3A Number of message bytes to follow
> 484F... Waypoint ID, 6 letters
> 0022921C Latitude (40.17773)
> 3FFA44B5 Longitude (-105.8985)
> A6199B08 Time waypoint stored (144,382,374 seconds since 12/31/89
> 00:00:00), UTC
> 313233.. Waypoint comment, 40 letters
> E9 Checksum
> 1003 Message terminator
>
> But how do you calculate the checksum??
> Some one can help me please...

 
Reply With Quote
 
Heinrich Pfeifer
Guest
Posts: n/a
 
      10-09-2004, 01:36 PM

<(E-Mail Removed)> wrote in
news:(E-Mail Removed)...
> On 7 Oct 2004 06:31:04 -0700, (E-Mail Removed) (Beuche) wrote:
>
> <http://www.rahul.net/kashe/checksum/checksum.exe> -- is a
> small (20K) program that will allow you to type in your sentence and
> have the checksum calculated for you.
>
> I don't remember where I got it, but, if I take sentences from
> my GPSR, remove the checksum and paste the remaining text into this
> program, it consistently generates the same checksum as the GPSR does.
>
> The program expects data in the form of a normal sentence,
> excluding the starting $ and the final * (which appears before the
> calculated checksum). These will be provided in the final output.



sorry, but your answer is going to confuse the original poster completely.
He asked for the checksum of Garmin protocol records, but your answer is
related to NMEA strings, and here the checksum is calculated differently!


--

Heinrich
http://www.gartrip.de
mail: new<at>gartrip.de


 
Reply With Quote
 
Bruce Stemplewski
Guest
Posts: n/a
 
      10-09-2004, 03:12 PM
Ooops, your right. Saw a response on the Garmin protocol plus that is
all I have had on the brain lately.


Heinrich Pfeifer wrote:
> <(E-Mail Removed)> wrote in
> news:(E-Mail Removed)...
>
>>On 7 Oct 2004 06:31:04 -0700, (E-Mail Removed) (Beuche) wrote:
>>
>><http://www.rahul.net/kashe/checksum/checksum.exe> -- is a
>>small (20K) program that will allow you to type in your sentence and
>>have the checksum calculated for you.
>>
>>I don't remember where I got it, but, if I take sentences from
>>my GPSR, remove the checksum and paste the remaining text into this
>>program, it consistently generates the same checksum as the GPSR does.
>>
>>The program expects data in the form of a normal sentence,
>>excluding the starting $ and the final * (which appears before the
>>calculated checksum). These will be provided in the final output.

>
>
>
> sorry, but your answer is going to confuse the original poster completely.
> He asked for the checksum of Garmin protocol records, but your answer is
> related to NMEA strings, and here the checksum is calculated differently!
>
>

 
Reply With Quote
 
Christof Dallermassl
Guest
Posts: n/a
 
      10-12-2004, 02:53 PM
Hi!

if you want some code in java, please have a look at
http://gpsmap.sourceforge.net

there is a LGPS implementation of the garmin protocol (amongst others).

regards
Christof

 
Reply With Quote
 
Junior Member
Join Date: Oct 2011
Posts: 1
 
      10-26-2011, 09:45 PM
First of all,

why is this thread not under Garmin?
this was originally to answer any checksum issues people were facing while integrating the garmin FMI system.

Secondly, do not get confused by any of the checksum calculators available online! and the adds people have posted! they do not solve the purpose.

Now to solve the garmin Checksum calculation,

This is from the GFMI development application.


for( i = 0; i < packet->mPayloadSize; i++ )
{
packet->mChecksum = ( packet->mPayload[i] + packet->mChecksum ) & 0xFF;
}

//the checksum is the 2's complement of all the data
//in the packet
packet->mChecksum = ( ( packet->mChecksum ^ 0xFF ) + 1 ) & 0xFF;

In Layman terms,

1. get the payload size.
2. for i = 0 to payloadsize ,
get each hex value in the payload and get its decimal value.
add all the decimal values. if you are doing this in a for loop, then you will have to
keep adding the current decimal value with the previous total.
Keep in mind that the decimal value cant be more than 255, so if it is > 255,
substract 256 from the current inflated value. this way the value will always be
between 0 to 255
3 Once you have the total of the decimal value (0 - 255), to get two's complement, substract the value from 255. then add 1. convert this decimal value to Hex value and there you have your checksum.


Regards,
Rajan
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
send maps to garmin GPS without mapsource Andrea Palazzi Global Navigation Satellite Systems 22 07-05-2006 11:53 PM
Problem with waypoint-to-waypoint switching on Garmin GPSmap 60CS atcat General GPS Discussion 2 01-09-2006 08:04 PM
Garmin 2610 In the UK, WAAS or not. And why does it try to send me into towns? Peter General GPS Discussion 27 10-10-2005 01:07 PM
how to insert a waypoint in an existing waypoint file. A Devrager General GPS Discussion 9 05-17-2005 07:41 AM
Garmin 2620 vs 2620 - should I send back the 2620? Randy Rostie General GPS Discussion 7 11-02-2004 01:18 AM


All times are GMT. The time now is 11:25 PM.