Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: UDP Packet Encoding

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


in reply to UDP Packet Encoding

Please:
  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 (http://www.calamp.com/products/cellular-a-gps/fleet-tracking-units/236-lmu-1200-gprs). 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
      0000035

        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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://939338]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-19 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found