[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [uracoli-devel] Timestamp in uracoli sniffer
From: |
Axel Wachtler |
Subject: |
Re: [uracoli-devel] Timestamp in uracoli sniffer |
Date: |
Mon, 9 May 2011 22:59:33 +0200 |
User-agent: |
KMail/1.9.9 |
Hallo Martin,
First question is, is your data stream aligned correctly, e.g. are you picking
the right bytes.
Both AVR and PC handles the data little endian,
>>> struct.pack("L", 0xaabbccdd) => '\xdd\xcc\xbb\xaa'
so the formula seems correct.
> int sec = ((int)b[4] << 24 | (int)b[3] << 16 | (int)b[2] << 8 | (int)b[1]);
One option to debug this issue is: use the python PacketCapture application
and run it with the -vvv option in the command line. In the terminal you will
get the dump of the serial line packets as hex string, and in wireshark you
can see, how the data are decoded.
e.g. if the terminal dumps:
0xf3:0x51:0xc8:0x4d:0x44:0xa6:0xa:0x0:0x5b:0x0:0x0:0x0:0x5b:0x0:0x0:0x0:0x41
:0x88:0x1:0xfe:0xca:0x34:0x12:0x5:0x0:0x61:0x64:0x64:0x72:0x3d:0x30:0x78:0x35:0x
2c:0x20:0x76:0x6d:0x63:0x75:0x3d:0x33:0x30:0x30:0x30:0x2c:0x20:0x73:0x68:0x74:0x
5f:0x74:0x3d:0x32:0x35:0x38:0x37:0x32:0x2c:0x20:0x73:0x68:0x74:0x5f:0x72:0x68:0x
3d:0x33:0x33:0x36:0x30:0x36:0x2c:0x20:0x61:0x63:0x63:0x3d:0x5b:0x31:0x34:0x2c:0x
32:0x2c:0x37:0x34:0x5d:0xa:0xd:0x0:0x0:0x0:0x0:0x0:0x0:0x0:0x0:0x0:0x0:0x0:0x0:0
x0:0x0:0x0:0x0:0x0:0xdd:0x1e
with:
chan : 17
clist : [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
crate : OQPSK250
platform : stb230 V0.1
port : /dev/ttyUSB0
rates : OQPSK250
ticknb : 65536
tscale : 1.25e-07
type : port
So 0xf3:0x51:0xc8:0x4d:0x44:0xa6:0xa:0x0: are the timestamp bytes and they
need to be represented as 1304973811 seconds since 1.1.1970
If needed, you can even write more debug prints in the python code.
Hope this helps, Axel