I use ardusub system. Before, I could use python to connect devices. But when I connected recently, it showed resource busy: '/dev/ttyUSB0'.
The following is the error message:
Traceback (most recent call last):
File “ping360old.py”, line 12, in
p = Ping360(args.device, args.baudrate)
File “/usr/local/lib/python2.7/dist-packages/brping/device.py”, line 34, in init
raise Exception(“Failed to open the given serial port: {0}”.format(exception))
Exception: Failed to open the given serial port: [Errno 16] could not open port /dev/ttyUSB0: [Errno 16] Device or resource busy: ‘/dev/ttyUSB0’
i use lsof to get the process that use /dev/ttyUSB0, it shows bridges, I can’t kill it. Because kill this process, and new bridges processes will occupy the /dev/ttyUSB0.
Hi @tony-white Thank you for your reply
The companion computer image I used downloaded from ardusub download page.
I use ps aux | grep bridges found a file ping360_bridge_manager ,which under the patch /home/pi/companion/tools, check for device forever and use a command:
command = "sudo -H -u pi screen -dm -S %s %s/bridges -u 0.0.0.0:%s -p %s:2000000" # Ignores EOF if it shows in the data in the serial sid
command = command % (screen_name, path, port, target_device)
when i use sudo strace -p $(pgrep bridges) to view process detailed activities. it seems stuck in p_wait(5
now i temporarily commented out the automatic version of python script. I can’t use pingviewer right now but ping360 device is is no longer occupied.
I use ping360 to develop an obstacle avoidance program in raspberry so I can’t use pingviewer for the time being. my problem has been solved temporarily.
Hi @chang-M
I’m glad you solved your issue! It’s worth noting that companion OS is no longer being developed or supported by Blue Robotics, having transitioned to BlueOS in 2022. It’s considerably friendlier for custom applications, among many other improvements. Updating your software to take the form of a docker extension would let other users easily try out such a cool feature!