Can't connect to crazyflie

Discussions about all things Bitcraze
Post Reply
meyigo2018
Beginner
Posts: 10
Joined: Wed Jun 14, 2017 1:43 pm

Can't connect to crazyflie

Post by meyigo2018 »

Hi,

I'm trying to integrate current crazyflie_server with the one from USC lab to support broadcast in current ros architecture. However, I had some issues connecting to the drone. The new structure of creazyflie_server is similar to Crazyswarm project. As far as this issue concerns, I moved the send ping function outside the CrazyflieRos::run function and is executed every 10ms.

Just a few more observations. I can request LogToC from Crazyflie but I cannot read any log info when I send ping later on. I can see there are some acknowledge packets sending back to computer but none of them match the logData. On the hardware side, I can see crazyflie LED4 in green but not in red. The green light on radio is constantly on but red light is flickering at a lower than normal rate.

Could you please give me some intuitions on what might go wrong? Are there any procedure I must go through to connect to the drones? Also a general question, can I lower the send ping rate to save radio for my other broadcasting information?

Thanks in advance!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Can't connect to crazyflie

Post by arnaud »

Hi,

If you are working at that low level, there should be no notion of connection to the Crazyflie. The ping is only required to pull data from the Crazyflie so as long as you ping often enough to pull all the log packets with a bit of headroom you should be good.

Your problem sounds like the log was not really enabled, otherwise you should receive log packet when you are pinging.
meyigo2018
Beginner
Posts: 10
Joined: Wed Jun 14, 2017 1:43 pm

Re: Can't connect to crazyflie

Post by meyigo2018 »

Hi Arnaud,

Thanks for your reply!

I did have a weird problem. If I disable the ping in CrazyROS and call the sendping method of a CrazyflieROS instance, the log doesn't work. It seems that the send ping have to be sent immediately after sending the log request to CF.

FYI, I found this issue with both my code and the one on bitcraze's master branch. What could be the problem?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Can't connect to crazyflie

Post by arnaud »

I am not very familiar with these software but I assumes that by ping you mean sending null packet even when no packet has to be sent, and this is done to pull data back (I am precising because there is an "echo" service in Crazyflie that could be use to implement a real ping functionality ...).

Since the ping is implementing the downlink, it has to be sent at regular interval to ensure that the transmit buffers in the Crazyflie are never overflowing.

There is a sequence of commands and acknowledgement required to start a log block, can you see where it blocks (ie. what command does not return a result)?
meyigo2018
Beginner
Posts: 10
Joined: Wed Jun 14, 2017 1:43 pm

Re: Can't connect to crazyflie

Post by meyigo2018 »

Hi Arnaud,

Thanks for your reply. It turns out to be my faulty implementation that unregister the log block. The issue is solved. However, I still have questions regarding sending pings.

You are correct. I'm sending empty packets to bring back log data. However, what I found is that broadcast heavily relies on sending these empty packets. Packets loss seems to decrease as I send empty packets at higher rate. When I stopped sending ping, crazyflies does not receive anything(LED_L is off).

Is it related to the buffer overflowing you were talking about? Can I increase the buffer size so that I can send ping less frequently to save radio for broadcasting? Where exactly in firmware should I look into?

Thanks,
Tracy
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Can't connect to crazyflie

Post by arnaud »

The fact that the LED is not blinking is strange, I have used broadcast packets for the radio e-stop for the ICRA demo (https://www.bitcraze.io/2017/05/demo-for-icra-2017/) and this demo was working without any computer connected to the Crazyflie, so only sending broadcast do work and the lack of downlink should not prevent the broadcast packets to make it to the Crazyflie.

The link LED will blink in this function: https://github.com/bitcraze/crazyflie-f ... ink.c#L125. The function is called each time a radio-related packet is sent from the nRF radio CPU to the STM32 main CPU. I see nothing that can lock in this function (all timeouts are at 0) so if the LED is not blinking the packet is either never received by the radio or it is dropped in the radio CPU. Is your nRF51 running the latest firmware?
meyigo2018
Beginner
Posts: 10
Joined: Wed Jun 14, 2017 1:43 pm

Re: Can't connect to crazyflie

Post by meyigo2018 »

Hi Arnaud,

Problem is solved. It turns out that I'm not using the latest nrf firmware. Thanks for your clarification!

Thanks!
Post Reply