Page 1 of 1

Battery status and BLE link strength not populated on android client

Posted: Thu Aug 24, 2017 4:56 pm
by abhishekkumar1902
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?

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

Posted: Fri Aug 25, 2017 6:05 am
by arnaud
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.

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

Posted: Fri Aug 25, 2017 11:16 am
by abhishekkumar1902
Is battery voltage being sent to the android client via BLE as a log which I can use?

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

Posted: Fri Aug 25, 2017 12:15 pm
by arnaud
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.

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

Posted: Sat Aug 26, 2017 12:58 am
by abhishekkumar1902
Can you point out the code in the ios client that should be translated to the android client for implementing the downlink?

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

Posted: Mon Aug 28, 2017 12:14 pm
by arnaud
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

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

Posted: Sat Sep 02, 2017 6:52 pm
by abhishekkumar1902
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?

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

Posted: Mon Sep 04, 2017 9:56 am
by arnaud
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.