Ping Sonar Python Error

Any ideas why I’d be getting this message? (we have /dev/ttyPING1 aliased by udev rule to /dev/USB1 where the sonar is attached - get the same error if I open USB1 too)

>>> from brping import Ping1D
>>> myPing = Ping1D("/dev/ttyPING1", 115200) 
Opening /dev/ttyPING1 at 115200 bps 
>>> myPing.initialize()
('message id not recognized: 0', None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-armv7l/egg/brping/ping1d.py", line 101, in initialize
  File "build/bdist.linux-armv7l/egg/brping/ping1d.py", line 116, in request
  File "build/bdist.linux-armv7l/egg/brping/pingmessage.py", line 480, in __init__  
KeyError: 0
>>>

Nevermind. Uninstalled and reinstalled

sudo -H pip install bluerobotics-ping

And we’re back online!

Hi,

I’m glad that you figure it out, please let us know if you need any further assistance.

What rule did use and where did you place it
This is on a raspberry pi

sudo nano /etc/udev/rules.d/99-com.rules

SUBSYSTEM==“tty”, ATTRS{idVendor}==“0403”, ATTRS{idProduct}==“6015”, ATTRS{serial}==“DP05Y5V8”, SYMLINK+=“pingusb”, MODE=“0666”

sudo udevadm control --reload-rules

sudo udevadm trigger

#comes up on $ ls /dev/

Error reading Ping data: Failed to open the given serial port: [Errno 16] could not open port /dev/pingusb: [Errno 16] Device or resource busy: ‘/dev/pingusb’

I also tried placing it in sudo nano /etc/udev/rules.d/99-serial.rules