Ping360 example python code

We need simple python code applicable for ping 360. It will return the distance information according to the angle value. Can you help us?

Hi,

Please take a look in Ping360 documentation, the learn tab can be useful.
For more information about the protocol, check the ping-protocol documentation.

I am trying to use the p.intialize from the ping360.py in the brping. But it fails all the time. Is there anything I could do/try?

Hi @luuckiest, welcome to the forum :slight_smile:

How are you connecting to your ping360, and how are you trying to run the script? Connecting to a ping360 requires specifying either the serial/USB port it’s connected to, or the UDP port if it’s on an ethernet connection/interface, as specified in the command-line arguments ping360.py.

Note also that the second half of that script uses auto-transmit functionality, which isn’t yet available in the public version of the Ping360 firmware, so only the first half is expected to work at this stage (which just loops through individual transmitAngle messages).

We have correctly use the routing page to set up the udp port to listen to the signal from the ping360.

I am using “python ping360.py --udp 192.168.2.1:9092” to connect to the device. I am also trying to break it down in the code to try to call the Ping360 class in the code and use its function to try to connect to the device.

We are able to use ping-viewer to read the data and decode_binary.py to see what is in the binary file. But we are not able to directly log the data out from the ping360.

Please let me know if there is anything I can do to directly log the singal/data out from the ping360 sonar! Thanks in advacne

The ping UDP connection should be to the companion IP address, not the top computer’s, so you should be using 192.168.2.2:9092 (which is also specified as the UDP example in the command-line arguments lines I linked you to in ping360.py).

Should definitely be possible with the existing script - I was working with that for a bit last year :slight_smile: