Skip to content Skip to sidebar Skip to footer

How To Unpack Stxetx Data In Python

I'm receiving a data packet sent from a RS485 level serial bus to a ESeye Hammerkop transmitter which then URL encodes the data and sends it to my server. The request looks like th

Solution 1:

Django has unhelpfully decoded the GET parameter as text instead of binary data. You will need to parse the contents of request.META['QUERY_STRING'] yourself.

>>> import urlparse
>>> urlparse.parse_qs('...&packet=ArcYX%01%00%00%00%00%00%00%03%00%F0%00%06%00%F0%008%0E%B0%27%00%00%E85&...')['packet'][0]
"ArcYX\x01\x00\x00\x00\x00\x00\x00\x03\x00\xf0\x00\x06\x00\xf0\x008\x0e\xb0'\x00\x00\xe85"

Post a Comment for "How To Unpack Stxetx Data In Python"