Page 1 of 1

Send message to custom System Task

Posted: Thu Nov 11, 2021 1:28 am
by traffens
Good evening!

I've successfully created my own system task, and i'm attempting to implement a "pairing" sequence for the CrazyFlie. I'm able to send messages to the client through the drone's firmware, but now im looking to send messages the other way.
For example, if I wanted to send a simple "hello!" message to the drone, what would be the best way to go about this? Is there an "easy way" to go about creating the message where the packet construction is done for me?

Something tells me i'm going to have to construct the message myself and split it into <40byte packets.

Re: Send message to custom System Task

Posted: Thu Nov 11, 2021 12:26 pm
by jonasdn
Hi,

You can construct packets using the CRTPPacket class in the cflib and send them with for instance the send_packet method on the Crazyflie class.

See the API reference for guidance: https://www.bitcraze.io/documentation/r ... api/cflib/

And to see how this packets get deconstructed you can look in the firmware for instance in param.c to see how packets to the CRTP_PORT_PARAM is treated.

For extra information see: https://www.bitcraze.io/documentation/r ... reas/crtp/

Re: Send message to custom System Task

Posted: Sat Nov 13, 2021 3:14 am
by traffens
im really not seeing a way to send messages FROM the client TO the crazyflie.

The only place i can really find some good info is radiodriver.py on the client side. So if i'm making my own python script, do you think i'll need to import radiodriver and use their radio/packet handling functions?

We already have a swarm capability as well as end-to-end encryption. Something tells me i'm going to have to completely integrate the radiodriver for us to truly be able to send custom stuff to the drone.

Re: Send message to custom System Task

Posted: Mon Nov 15, 2021 5:30 am
by jonasdn
You can check this PR where I want to add new API for parameters, it sends message from the client to the crazyflie: https://github.com/bitcraze/crazyflie-l ... n/pull/280

And a branch that accepts them: https://github.com/bitcraze/crazyflie-f ... f858d4R204

Re: Send message to custom System Task

Posted: Tue Nov 16, 2021 2:49 am
by traffens
you're the best, thank you