Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: UDP Packet Encoding

by Util (Priest)
on Nov 21, 2011 at 22:22 UTC ( #939338=note: print w/replies, xml ) Need Help??

in reply to UDP Packet Encoding

  1. post the Perl code of your UDP server.
  2. post the details of the GPS unit (make, model, link to online docs, etc.)
  3. most importantly, post a *useful* output example. Perhaps by writing the "results" to a file, and then running `hexdump` or `od -t x1` on the file, and then posting *that* output, inside <pre></pre> tags.
I doubt that your GPS is sending encrypted data; it is probably just using some dense format that is not easily human-readable. Perhaps mentioned in the unit's documentation?

Replies are listed 'Best First'.
Re^2: UDP Packet Encoding
by nEMESIS4 (Initiate) on Nov 21, 2011 at 23:05 UTC
    I cannot seem to post my reply, just posting this to test.
      \Thank you for the quick response.

      1) Here is the Perl code I am using:

      #!/usr/bin/perl use IO::Socket::INET; $| = 1; my ($socket,$received_data,$peeraddress,$peerport); $socket = new IO::Socket::INET (LocalPort => '26',Proto => 'udp') or d +ie "ERROR in Socket Creation : $!\n"; while(1) { $socket->recv($recieved_data,1024); $peer_address = $socket->peerhost(); $peer_port = $socket->peerport(); print "\n($peer_address, $peer_port) said : $recieved_data"; $data = "data from server\n"; print $socket "$data"; } $socket->close();

      2) The GPS unit is made by CalAmp ( There isn't much information online about it unfortunately.

      3) Here is the Hexdump results from one of the transmissions:

      0000000 0583 3112 7900 0197 0101 0002 4e01 e6c6
      0000010 00fc 0000 0000 0000 0000 0000 0000 0000
      0000020 0000 0000 0000 0000 022c ffd0 2fcd 0f00
      0000030 0208 0019 0000

        Basically, what ikegami said.

        Just one frame doesn't help much when reverse engineering this, especially when you don't know what data to expect. Surely there is some software to go with it that displays human-readable data? Check the lat/long/alt values that it reports and try to estimate how much it jitters. From that you can calculate a range of values to expect. Altitude should be easiest as it's most likely a 16-bit integer of meters and you just have to guess little- or big-endian. Lat/Lon could be fixed or floating point. A timestamp should also be fairly easy to spot as it changes by roughly the same amount between two packets.

        Have you asked the manufacturer at all? Their site is really not very informative but perhaps they're customer-friendly enough to give you the specs.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939338]
[erix]: stonecolddevin: oh? Don't know, it works for me
[Sinistral]: stonecolddevin / stevieb - would 'he' in this context (looked at last 50 lines and didn't see discussion) be a certain solar timepiece user?
[stonecolddevin]: Sinistral yes indeed
[Discipulus]: he does not learn, nor teach, nor learn
[planetscape]: hello all
[stonecolddevin]: o/ planetscape
[Sinistral]: I think that just the sight of his username now causes a downvote storm. I agree, and the gratuitous use of formatting does make reading hard. I've given him +1 on things where there seemed to be actual good advice, but I think the big
[Sinistral]: nail in coffin was the rant against a Schwarzian Transform
[stonecolddevin]: at best, from what i've seen, his knowledge is accurate up to maybe 2002. the sheer volume of words is mostly worthy of a downvote in most cases though i think
[erix]: ITYM Schwartzian Transform :P

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2017-06-22 20:52 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (530 votes). Check out past polls.