How to add a protocol to the CrazyRadio

Firmware/software/electronics
Post Reply
adjavaherian
Beginner
Posts: 26
Joined: Fri May 22, 2015 4:18 am

How to add a protocol to the CrazyRadio

Post by adjavaherian » Thu Jun 04, 2015 3:11 pm

There's some Deviation code here https://bitbucket.org/goebish/deviation ... ult#cl-249 that I would like to use to add as a protocol for communication with another nRF based quad (cx-10). Where / how exactly do I do this? Is this something I do from the client side, or do I need to add the protocol to the firmware?

Thanks!

whoenig
Expert
Posts: 275
Joined: Mon Oct 27, 2014 2:55 am

Re: How to add a protocol to the CrazyRadio

Post by whoenig » Thu Jun 04, 2015 4:37 pm

Cool idea! It should be mainly on the client side (on top of the Crazyradio.py driver). However, not all the features of the nRF are exposed in the current firmware of the Crazyradio. Specifically, in the sample code you posted, dynamic payload is disabled. I believe the Crazyradio enables that feature always. It would be fairly easy to add another flag to the Crazyradio firmware though.
Keep in mind that updating the Crazyradio firmware has a certain risk, i.e. if it fails you might need an SPI programmer to reflash it.

tobias
Bitcraze
Posts: 1722
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How to add a protocol to the CrazyRadio

Post by tobias » Fri Jun 05, 2015 7:24 am

This is very interesting. I've been following the progress for a while and it is really cool that they managed to hack the xn297 transceiver (clone of nRF24). Implementing this in the Crazyradio (nRF24LU1), CF1 (nRF24L01+) or the CF2 (nRF51) should all be possible and would open up some interesting things such as that the cfclient could control the toy drones or the Crazyflie can be controlled by their transmitters.

adjavaherian
Beginner
Posts: 26
Joined: Fri May 22, 2015 4:18 am

Re: How to add a protocol to the CrazyRadio

Post by adjavaherian » Fri Jun 05, 2015 3:38 pm

Ya, it would be super cool to be able to test out new control features or practice flight without risking harm to your CF2, since it's about 10X more valuable than the CX-10. So where do I start? I guess the python client actually handles the TX protocols down to the CRPA? I think the first step would simply be syncing the CX-10 to the TX. When the CX-10 is powered on, it listens for a control signal from any nRF based TX with the right protocol. You send a thrust max and the quad acks then you send a thrust min and the quad acks and syncs to the TX until it is powered down. I suppose this can be done outside of the cfclient, by simply importing the CR libs? I wanna hack on it this weekend. Thanks!

arnaud
Bitcraze
Posts: 1752
Joined: Tue Feb 06, 2007 12:36 pm

Re: How to add a protocol to the CrazyRadio

Post by arnaud » Mon Jun 08, 2015 7:08 am

Making a new protocol for the Crazyradio will certainly requires to change the Crazyradio firmware. Right now the firmware configures the radio for the Crazyflie. As far as I understand the CX-10 does not configure the nRF24 the same was as we do.

If you want to start hacking the Crazyradio I suggest you start from the last stable version, the trunk is not stable at all.

adjavaherian
Beginner
Posts: 26
Joined: Fri May 22, 2015 4:18 am

Re: How to add a protocol to the CrazyRadio

Post by adjavaherian » Mon Jun 29, 2015 11:53 pm

@arnaud, which is the latest stable on github? I'm only seeing the master branch. Thanks!

https://github.com/bitcraze/crazyradio-firmware

DoC
Beginner
Posts: 2
Joined: Mon Mar 14, 2016 8:03 am

Re: How to add a protocol to the CrazyRadio

Post by DoC » Wed Mar 16, 2016 1:49 pm

Has somebody tried to create a protocol/firmware for xn297 based quadrocopters?

tobias
Bitcraze
Posts: 1722
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How to add a protocol to the CrazyRadio

Post by tobias » Wed Mar 23, 2016 11:59 am

We haven't tried it but I see no reason for it not to work as it has been done by deviationTx. The work lies in updating the firmware. Preferably making a new interface so it can still be configured through the python driver which would make implementing new protocols a lot smother.

Post Reply