Good to hear!
Best to put error messages in a text format so they can be viewed more easily on mobile devices and by screen readers, and be more easily copied and googled.
pi@navio:~ $ .local/bin/pingproxy.py --device /dev/ttyAMA0
Traceback (most recent call last):
File ".local/bin/pingproxy.py", line 112, in <module>
proxy.run()
File ".local/bin/pingproxy.py", line 88, in run
self.socket.sendto(device_data, client)
BlockingIOError: [Errno 11] Resource temporarily unavailable
As is, the error is letting you know that the messages aren’t getting through, so the device you’re trying to communicate with isn’t responding and likely isn’t receiving the data being sent. Given the error is occurring on the top computer the “data being sent” would be the command to take each reading. Your hypothesis of a dropped connection seems quite reasonable here.
Looking at this stackoverflow response, it seems like it’s because pingproxy uses a non-blocking socket, which means it errors out immediately if the connection doesn’t respond. You might want to try replacing line 59 of pingproxy.py
(self.socket.setblocking(False)
) by setting a small timeout and seeing if that helps (e.g. self.socket.settimeout(0.01)
to wait 10ms before timing out). If you’ve only got the one ping device that you’re communicating with then you might even want to use self.socket.setblocking(True)
to make it just wait until the communication works.
I believe sockets are 1:1, so to simultaneously view in Mission planner and PingViewer you’ll need to arrange for the data to send to both relevant ports (you may have to be careful to select separate ports on each application once it’s sending, or you could have issues with fighting if both applications try to connect to the same port)
The sensor log is saved in a binary format, which I believe is just the binary version of the ping messages. You can try accessing it by reading it as a binary file in Python and then using the brping.pingmessage.PingMessage
class (as defined here) to convert it into messages that you can extract the data from. I’ll need to start accessing the data for the Ping360 next week some time, so if you haven’t got it working by then then I’ll hopefully be able to help some more once I’ve figured it out, since the protocol is the same 