TDOA2_decoder.py

All discussions related to the Loco Positioning system
Post Reply
HSIAOJH
Beginner
Posts: 4
Joined: Tue Sep 15, 2020 10:03 pm

TDOA2_decoder.py

Post by HSIAOJH »

Hi,
I'm the beginner of Python but can run sniffer_binary.py to dump the log over shell, seen attachment.
Shell_Sniffer.PNG
The next is to decoder it for better understanding TDOA2 protocol ….
However, I don't know exactly and fail to use TDOA2_Decoder.py to decode these packages. The shell hangs and is likely waiting for input... see attachment.
Shell_TDOA2 Decoder.PNG
Shell_TDOA2 Decoder.PNG (9.55 KiB) Viewed 1523 times
Do I need to change any code? Any guidelines, instructions or kind help can be from support team?
Thanks a lot!
JH
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: TDOA2_decoder.py

Post by kristoffer »

Hi!

The general idea is to pipe the output from the sniffer into the decoder
Assuming you are using a unix shell you should do something like this

Code: Select all

./tools/sniffer/sniffer_binary.py | ./tools/sniffer/tdoa2_decoder.py
HSIAOJH
Beginner
Posts: 4
Joined: Tue Sep 15, 2020 10:03 pm

Re: TDOA2_decoder.py

Post by HSIAOJH »

I'm not using unix shell. how do I get this script running with python?
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: TDOA2_decoder.py

Post by kristoffer »

I'm not a windows expert, but I think you can pipe in windows as well.
I don't have a windows machine to test on, but try something like this:

from your normal command prompt (not in python), cd to the root of the repository

Then run the scripts

Code: Select all

python tools\sniffer\sniffer_binary.py | python tools\sniffer\tdoa2_decoder.py 
HSIAOJH
Beginner
Posts: 4
Joined: Tue Sep 15, 2020 10:03 pm

Re: TDOA2_decoder.py [Resolved]

Post by HSIAOJH »

Thanks! It works now!
Post Reply