Too many packets lost

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
Ersijo
Beginner
Posts: 2
Joined: Tue May 12, 2020 7:23 pm

Too many packets lost

Post by Ersijo »

Hello!

I am new to the crazyflie and I am currently trying to connect it to the lighthouse. To do this I've been following this guide:
https://www.bitcraze.io/documentation/r ... _overview/

However, I haven't managed to get the base station position using get_bs_position.py. When I run the script it says "connecting to radio://0/80/2M" for about 20 min. Then the CF starts blinking, alternating between the lighthouse deck LED and the green LEDs. In cmd the following text is displayed:
Connecting to radio://0/80/2M
Connection to radio://0/80/2M failed: Too many packets lost
Traceback (most recent call last):
File "D:\Studa\Thesis\crazyflie-firmware-master\tools\lighthouse\get_bs_geomet
ry.py", line 333, in <module>
with SyncCrazyflie(uri, cf=cf) as scf:
File "C:\Users\Simon\AppData\Local\Programs\Python\Python38-32\lib\site-packag
es\cflib\crazyflie\syncCrazyflie.py", line 67, in __enter__
self.open_link()
File "C:\Users\Simon\AppData\Local\Programs\Python\Python38-32\lib\site-packag
es\cflib\crazyflie\syncCrazyflie.py", line 64, in open_link
raise Exception(self._error_message)
Exception: Too many packets lost

Many thanks in advance!
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Too many packets lost

Post by kristoffer »

Hi!

"Too many packets lost" means that the script could not connect to the Crazyflie. Most likely your crazyflie is on a different channel.
The script uses the uri radio://0/80/2M as a default, and if your Crazyfle is configured to use another channel you have to pass that to the script

For instance something like this for a CF on channel 30/2M:

Code: Select all

./tools/lighthouse/get_bs_geometry.py --uri radio://0/30/2M
You can read about how to configure the channel in the Crazyflie https://www.bitcraze.io/documentation/r ... figuration
Ersijo
Beginner
Posts: 2
Joined: Tue May 12, 2020 7:23 pm

Re: Too many packets lost

Post by Ersijo »

Thank you for the quick answer. I've made sure that the channel is the same as the one I can connect to in the CF client. I've realized the "too many packets lost" error came as a result of the CF turning itself off. If I run the script as the CF is connected to the client, the cmd gets locked in "connecting to radio...". If I run the script when the CF is turned on but not connecting, it says that "lighthouse.angle0x_1 is not in TOC". What does this mean?
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Too many packets lost

Post by kimberly »

Hi!
  • You are not supposed to be able to connect to the crazyflie while its connecting to the cfclient by USB
  • The fact that you do not have that log in the toc, means that the lighthouse driver is not initialized as it was explained in the documentation. Especially the part where it says that you have to put

    Code: Select all

     CFLAGS += -DDISABLE_LIGHTHOUSE_DRIVER=0
    in config.mk
The latter you can check, since the lighthouse deck should have a blue led on only after a few seconds (other LEDS are one after a while if the lighthousedriver is not correctly flashed).
Post Reply