I am running this on a Raspberry pi using the Ping-python library from your Github. I set the IP address of the pi to 192.168.2.2 and the computer’s to 192.168.2.1 to eliminate the possibility of that being the problem.
So I run the provided sample command sudo python3 simplePingExample.py --device /dev/ttyUSB0 --udp 192.168.2.2:9090. And it reads information from the sonar. But it does the same as the command sudo python3 simplePingExample.py --device /dev/ttyUSB0.
In the code, it stops at the first if statement and skips the udp option I added. To fix this, I added and args.udp is None: to line 24 of the sample script so when there is not udp option, it works without udp. And when the udp option is specified, it goes to the elif and does that code. You have to also add myPing.connect_serial(args.device, args.baudrate) to the elif so it reads from the sonar.
And when I start it now, it gives an error, which I think means it is trying to set up the udp connection.
This is where I don’t know what to do. I can read the data directly from the terminal (without the udp option), but then there is no point in having the Ping Viewer application. Is there anything I can do?