Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: UDP Packet Encoding

by nEMESIS4 (Initiate)
on Nov 21, 2011 at 23:07 UTC ( [id://939342]=note: print w/replies, xml ) Need Help??


in reply to Re^2: UDP Packet Encoding
in thread UDP Packet Encoding

\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

Replies are listed 'Best First'.
Re^4: UDP Packet Encoding
by mbethke (Hermit) on Nov 22, 2011 at 08:52 UTC

    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://939342]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-25 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found