AirNav Systems Forum

AirNav Radar => AirNav Radar Discussion => Topic started by: ivo on November 02, 2023, 06:27:07 PM

Title: linux: test if radarbox is connected?
Post by: ivo on November 02, 2023, 06:27:07 PM

I am trying to ascertain whether the radarbox USB device is connected on linux.  I want to check this to detect in my perl program whether someone has pulled the device from its USB socket.

when I first insert it into the USB port, a `/dev/swradio0` is created.  however, that device disappears at some point, even though the radarbox usb stick is still connected and working well.

is there a simple file system check to accomplish this?
Title: Re: linux: test if radarbox is connected?
Post by: pedrĂ£o18 on November 13, 2023, 12:34:52 PM
Maybe you can use the lsusb command in a time interval to detect whether stick is connected.

To get just the device you want, you can use the command lsusb -d yyyy.zzzz

If this command returns empty, the USB is probably not connected.

Remember to replace yyyy.zzzz with the USB id found in the command lsusb