Peer_to_Peer_ communication

Firmware/software/electronics/mechanics
Post Reply
Hada Hamdi
Beginner
Posts: 28
Joined: Wed Jul 22, 2020 4:19 am

Peer_to_Peer_ communication

Post by Hada Hamdi »

Hi,

I am asking about peer to peer API https://www.bitcraze.io/documentation/r ... 2/p2p_api/

I tested it, I can see the sending of the message, but I cannot see its reception. where can be the problem ?

Also, how can I put them on the same channel !

Thank you!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Peer_to_Peer_ communication

Post by arnaud »

It might be that your Crazyflies are not on the same channels.

To change the Crazyflie channel and address (you need to change both in that case) you can use the client: https://www.bitcraze.io/documentation/r ... figuration

You should set your crazyflie on 2 different addresses. for example 0xe7e7e7e701 and 0xe7e7e7e702.
Hada Hamdi
Beginner
Posts: 28
Joined: Wed Jul 22, 2020 4:19 am

Re: Peer_to_Peer_ communication

Post by Hada Hamdi »

Hello,

I would like to know the time of transmission of the messages between crazyflies and the packets lost. Anything can help me!

Thank you!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Peer_to_Peer_ communication

Post by arnaud »

Maybe you can tell us a bit more about what you want to do, most answer will depend of the context.

The only p2p packet implemented so far is the broadcast packet, this means that you will have to implement a protocol to detect and handle packet loss. For example you can have the receiver sending an ack packet when it receives a packet and the sender waiting for some time for this ack packet. If you want unicast packet, it has to be implemented in the nrf51 the same way broadcast packets are currently implemented.

As for the time of transmission, if you mean a timestamp, you can take a timestamp before sensing the packet using the "usecTimestamp()" function. If you need more precise timing, the nrf51 firmware will need to be modified to timestamp the packet.
Hada Hamdi
Beginner
Posts: 28
Joined: Wed Jul 22, 2020 4:19 am

Re: Peer_to_Peer_ communication

Post by Hada Hamdi »

Hi,

I tried the P2P api and I put crazyflies in the same channel, the led is just blinking red. It seems that crazyflies can send messages but cannot receive. What is the problem? . Please can you write to me steps to follow about P2P. I don't know if I did a mistake or something else. :|


If I use the terminal or st link/v2 to flash crazyflies, not the cfclient, how can change adresses of crazyflies and put them in the same channel, without using cfclient to configure and flash.

Thank you very much!
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Peer_to_Peer_ communication

Post by kimberly »

Btw, maybe connecting with one of the crazyflies with a USB cable instead to get the outputs of hte app on the cfclient. The p2p messages might interfere with the wireless connection of the crazyflie.

The link that Arnaud gave in the previous message contains the direct link to change the channel and address on the crazyflie.
1- Go to Connect>Configure 2.X which opens up a window.
2- You need to put in the channel in box for channel,and then
3- press the 'write' button and ...
4- restart the crazyflie in order for it to take into affect.
5- You can then scan the address of the crazyflie in the cfclient and then you will see that channel has been changed.

Changing the address/channel/bandwidth through the cfclient is the main way to do this. We at the development team use it ourselves too.
Hada Hamdi
Beginner
Posts: 28
Joined: Wed Jul 22, 2020 4:19 am

Re: Peer_to_Peer_ communication

Post by Hada Hamdi »

Hi Kimberly,

Thank you very much for your reply!

It works well! I am trying to know the transmission time of a packet, what is the unit of time returned by the function usecTimestamp() !

Thank you!
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Peer_to_Peer_ communication

Post by kimberly »

usecs stands for μsec, which is microseconds
Post Reply