Battery status and BLE link strength not populated on android client

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
abhishekkumar1902
Beginner
Posts: 8
Joined: Thu Aug 03, 2017 5:46 am

Battery status and BLE link strength not populated on android client

Post by abhishekkumar1902 » Thu Aug 24, 2017 4:56 pm

Hi,
I am flying the Crazyflie 2.0 (with the latest firmware) with the android client (on Bluetooth link) and observe that the battery capacity and link strength indications on the top left of the app do not work. They all the time show 0% and NA only. Is it a software issue, or something wrong with my setup? I am able to fly it through the app but those two indications do not work at all. If it is a SW bug, is there a workaround to fix that?

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

Re: Battery status and BLE link strength not populated on android client

Post by arnaud » Fri Aug 25, 2017 6:05 am

Hi,
The battery status is only working when connecting Crazyradio (PA) to the phone and using it to connect the Crazyflie.

The problem with BLE is that there is no downlink implemented, the android client cannot receive packets from the Crazyflie, and these functionality are implemented using downlink packets (using the log subsystem).

For the signal strength though, there might be a way to get it from the android phone from the bluetooth stack. This would not require downlink to be implemented.

To summarize: this is a bug. Either the indicator should be hidden when using BLE or they should be implemented.

abhishekkumar1902
Beginner
Posts: 8
Joined: Thu Aug 03, 2017 5:46 am

Re: Battery status and BLE link strength not populated on android client

Post by abhishekkumar1902 » Fri Aug 25, 2017 11:16 am

Is battery voltage being sent to the android client via BLE as a log which I can use?

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

Re: Battery status and BLE link strength not populated on android client

Post by arnaud » Fri Aug 25, 2017 12:15 pm

Not when connected with BLE, the log subsystem requires downlink to work. So the way to get the Crazyflie battery voltage is to implement BLE downlink.

abhishekkumar1902
Beginner
Posts: 8
Joined: Thu Aug 03, 2017 5:46 am

Re: Battery status and BLE link strength not populated on android client

Post by abhishekkumar1902 » Sat Aug 26, 2017 12:58 am

Can you point out the code in the ios client that should be translated to the android client for implementing the downlink?

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

Re: Battery status and BLE link strength not populated on android client

Post by arnaud » Mon Aug 28, 2017 12:14 pm

The downlink is implemented by the CRTPDOWN BLE characteristic: https://wiki.bitcraze.io/doc:crazyflie:ble:index

In ios this characteristic is set to notify the host when it is modified. It is received and decoded there: https://github.com/bitcraze/crazyflie2- ... swift#L244

In android the crazyradio driver has a function to receive packet: https://github.com/bitcraze/crazyflie-a ... .java#L121 but the ble link does not: https://github.com/bitcraze/crazyflie-a ... .java#L301.

I hope this helps getting an idea of where things should be

abhishekkumar1902
Beginner
Posts: 8
Joined: Thu Aug 03, 2017 5:46 am

Re: Battery status and BLE link strength not populated on android client

Post by abhishekkumar1902 » Sat Sep 02, 2017 6:52 pm

Can you please clarify the following doubts of mine:
1. Does android client uses different protocols/packet-types when communicating to the crazyflie via BLE and via CrazyRadio?
2. Can we simply add an extra variable to be sent to the crazyflie? If yes, do I need to update some predefined packet structure or something? Which package I may need to modify?

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

Re: Battery status and BLE link strength not populated on android client

Post by arnaud » Mon Sep 04, 2017 9:56 am

1. The protocol used is the same, CRTP. It is tunneled throws BLE characteristics in case of bluetooth and send in "Enhanced Shockburst" packets in case of Crazyradio.
2. Yes, you could for example add data to the commander packet, it is the one that is currently sent to the Crazyflie by the crazyflie client. On the crazyflie side you will receive it in commanderRPY.

Post Reply