Issue using multiple crazyradios on the same laptop

Post here to get support
Post Reply
munusamy
Beginner
Posts: 6
Joined: Wed Dec 23, 2020 5:36 am

Issue using multiple crazyradios on the same laptop

Post by munusamy »

Hi,

I've been running a modified version of this script https://gist.github.com/ataffanel/4d5cc ... 2b299ecda9 using 10 CFs, LPS with 8 anchors and three Crazyradios (since the sequence was very unstable in my location using just one Crazyradio)

It was all running fine. Then I decided to try the script with a trajectory https://github.com/bitcraze/crazyflie-l ... h_level.py. That's when I first got the error

Code: Select all

Couldn't load link driver: Cannot find a Crazyradio Dongle
So, I tried another script which had been running fine until now that connects to three CFs using two Crazyradios

Code: Select all

    'radio://0/70/2M/E7E7E7E701',  # cf_id 1
    'radio://0/70/2M/E7E7E7E704',  # cf_id 2
    'radio://2/90/2M/E7E7E7E708',  # cf_id 3
It now shows the following error

Code: Select all

(python3.6) colossus@colossus:~/Documents/Work/bitcraze/crazyflie-lib-python-0.1.12.1/examples/swarm$ python3 twoSeqtwoRadio.py 
Connecting to radio://0/70/2M/E7E7E7E701
Connecting to radio://0/70/2M/E7E7E7E704
Connecting to radio://2/90/2M/E7E7E7E708
Couldn't load link driver: Cannot find a Crazyradio Dongle

Traceback (most recent call last):
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/drivers/crazyradio.py", line 128, in __init__
    device = _find_devices()[devid]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crazyflie/__init__.py", line 224, in open_link
    link_uri, self._link_quality_cb, self._link_error_cb)
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crtp/__init__.py", line 99, in get_link_driver
    instance.connect(uri, link_quality_callback, link_error_callback)
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crtp/radiodriver.py", line 158, in connect
    address)
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crtp/radiodriver.py", line 97, in __init__
    _RadioManager._radios[self._devid] = _SharedRadio(self._devid)
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crtp/radiodriver.py", line 66, in __init__
    self.radio = Crazyradio(devid=devid)
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/drivers/crazyradio.py", line 133, in __init__
    raise Exception('Cannot find a Crazyradio Dongle')
Exception: Cannot find a Crazyradio Dongle

Connection to radio://2/90/2M/E7E7E7E708 failed: Couldn't load link driver: Cannot find a Crazyradio Dongle

Traceback (most recent call last):
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/drivers/crazyradio.py", line 128, in __init__
    device = _find_devices()[devid]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crazyflie/__init__.py", line 224, in open_link
    link_uri, self._link_quality_cb, self._link_error_cb)
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crtp/__init__.py", line 99, in get_link_driver
    instance.connect(uri, link_quality_callback, link_error_callback)
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crtp/radiodriver.py", line 158, in connect
    address)
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crtp/radiodriver.py", line 97, in __init__
    _RadioManager._radios[self._devid] = _SharedRadio(self._devid)
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crtp/radiodriver.py", line 66, in __init__
    self.radio = Crazyradio(devid=devid)
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/drivers/crazyradio.py", line 133, in __init__
    raise Exception('Cannot find a Crazyradio Dongle')
Exception: Cannot find a Crazyradio Dongle

Connected to radio://0/70/2M/E7E7E7E701
Connected to radio://0/70/2M/E7E7E7E704
Traceback (most recent call last):
  File "twoSeqtwoRadio.py", line 399, in <module>
    with Swarm(uris, factory=factory) as swarm:
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crazyflie/swarm.py", line 104, in __enter__
    self.open_links()
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crazyflie/swarm.py", line 92, in open_links
    raise e
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crazyflie/swarm.py", line 88, in open_links
    self.parallel_safe(lambda scf: scf.open_link())
  File "/home/colossus/anaconda2/envs/python3.6/lib/python3.6/site-packages/cflib/crazyflie/swarm.py", line 183, in parallel_safe
    raise Exception('One or more threads raised an exception when '
Exception: One or more threads raised an exception when executing parallel task
It seems like it connects to one radio but is not able to find the other one. Since, it was working fine earlier, I'm not sure what's causing this error now.
I've never had problems with Crazyradios until now! Please guide me on this, thanks!

OS: Ubuntu 16.04 LTS
Also, I'm able to connect to CF using cfclient without any issues
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Issue using multiple crazyradios on the same laptop

Post by kimberly »

Hi!

So if you are only using 2 crazyradios, this needs to be the last uri:

Code: Select all

  'radio://1/90/2M/E7E7E7E708',  # cf_id 3
The first number is 0 for crazyradio number 1 and 1 for crazyradio number 2
Post Reply