Page 1 of 1

Communication with Crazyflie

Posted: Tue Oct 08, 2019 5:33 pm
by abrahamvee
Hi,
I'm using python, and I am able to run some examples. But I need to be able to control to drones with one radio, what can I read to have an idea of the communication protocols of the crazyflie, and also know what to change in the code to be able to achieve this. How can I set one radio to different channels if I am working with cflib and python. I've found the multiramp example.

Re: Communication with Crazyflie

Posted: Wed Oct 09, 2019 8:17 am
by arnaud
The multiramp example is using one radio to control multiple Crazyflie using low level APIs (ie. sending attitude set-points). If you look in the swarm folder you can find more examples connecting multiple Crazyflie with the same radio: https://github.com/bitcraze/crazyflie-l ... ples/swarm.

The key is in the connection URI. The URI to connect a Crazyflie looks something like this: 'radio://0/10/2M/E7E7E7E701'. The first '0' is the ID of the radio, if you connect multiple Crazyflie with radio ID 0, the same radio will be used for them. Then '10/2M' means channel 10 with 2Mbit/s datarate and finally there is the address. When connecting multiple Crazyflie from the same radio, it is more efficient to have all your Crazyflies on the same channel and to use different address for them, this ensure there will be no cross talk (sometime Crazyflies can hear packets on neighbor channel so setting different address is very important), and it limits the number of channel change which takes some time with the current USB protocol.

Re: Communication with Crazyflie

Posted: Thu Oct 10, 2019 10:57 am
by abrahamvee
Thanks a lot for your answer. I'm trying to set the individual addresses on the crazyflies. I tried in the address tab in the cfclient, (how can i do it in in python files directly) and then used the scan example but I can't it doesn't print the addresses just the available Crazyflie.

Re: Communication with Crazyflie

Posted: Thu Oct 10, 2019 11:01 am
by arnaud
You need to set the address from the client: https://www.bitcraze.io/docs/crazyflie- ... figuration.

Technically it would be possible to set it from a script as well but there is no easy to use API for that, you can look at the client implementation if you are really interested in setting addresses with your own script. Though the normal case is to set the address once and never change it again so such a functionality would not be that useful.

Re: Communication with Crazyflie

Posted: Thu Oct 10, 2019 11:45 am
by abrahamvee
Thanks a lot. I've managed to do it, I'm now trying to run the examples. Thanks.