Ping-python with Ping2 - "device or resource busy"

Hi all!

I am trying to use ping-python (available on github, at this adress). I installed everything under linux on a Raspberry Pi4.

To do so, I followed the installation guide available on the github I published above. However, there is a problem of device availablity each time I connect the Ping. I get the error message “Exception: Failed to open the given serial port: [Errno 16] could not open port /dev/ttyUSB0: [Errno 16] Device or resource busy: ‘/dev/ttyUSB0’”.

However, when I unplug and plug back the Ping2 (without exiting python), everything works fine. This is not ideal, and I was wondering if there was a python command that could be equivalent to plugging in and out ? I would like to be able to command the Raspberry Pi remotely, without human intervention !

The following image is a capture of what happens showing the code I run. The red line and arrow correspond to my intervention (plugging in and out the Raspberry).

Thanks for taking the time to read my post :slight_smile: