Replies: 4 comments 1 reply
-
|
For my specific use-case: import asyncio
from bleak import BleakScanner, BleakClient
from bleak.backends.device import BLEDevice
from cflib.crazyflie.appchannel import CRTPPacket
async def main():
seen_devices: list[str] = []
scanner = BleakScanner()
device: BLEDevice
for _device in await scanner.discover():
if _device.name == "Crazyflie":
device = _device
# print(device)
async with BleakClient(device) as client:
# Use CRTPPacket to encode data, and send over the `client`
asyncio.run(main()) |
Beta Was this translation helpful? Give feedback.
-
|
No, there is no implementation in the Python lib to communicate over BLE with the Crazyflie. One of the main reason is that the BLE implementation in the Crazyflie used to be very slow and the BLE libs on PC very hard to use. Both these fact have now changed: we just pushed an update to the Crazyflie BLE stack that should make it much faster, and libs like Bleak seems to allow to use BLE quite easily nowadays. If you would like to have a go at implementing BLE communication from the PC, what you need to write is a link driver: https://github.com/bitcraze/crazyflie-lib-python/tree/master/cflib/crtp. There is already a brunch of driver implemented, you can look at the UDP driver for a simple example. Once you have made such link driver and added it to the list of links in the lib (see If you manage to get it working, we will gladly merge a pull request for the functionality :-). |
Beta Was this translation helpful? Give feedback.
-
|
Already working on it :) Will make a PR when it’s done.--Thanks,Conor
|
Beta Was this translation helpful? Give feedback.
-
|
Hi any updates on the BLE implementation to python ? I curious as im also getting a Crazy file drone and dont want to add another dongle radio to it. if it can run off the BLE or ESP it would be fine |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Using
cflib, is it possible to connect to the Crazyflie using BLE? I've looked everywhere in the source and cannot find a BLE driver. I know it's possible, since the mobile app uses BLE. I spent so much time creating an 'app', and I didn't even think of how I would communicate with it 🤦Edit: Found documentation on the BLE connectivity using nRF.
Beta Was this translation helpful? Give feedback.
All reactions