Page 1 of 1

Scanning within an address range

Posted: Thu Oct 28, 2021 4:39 pm
by comathi
Hello,

I am attempting to control multiple CrazyFlie drones from a single radio. For practical purposes, I am only using two, but in theory I want an arbitrary number of drones to be controlled without having to hardcode addresses for each one of them.

All drones have a similar address, for example 0xE7E7E7E7XX, where XX is unique to each drone.

Is it possible for me to scan the radio interface and obtain the URIs for all drones in the 0xE7E7E7E7XX address range? Or do you know of a different method that would allow me to scan for multiple drones without knowing the precise address beforehand?

Thank you for your help!

Re: Scanning within an address range

Posted: Fri Oct 29, 2021 4:46 am
by jonasdn
Hi comathi!

You could some kind of variant of the code below:

Code: Select all

import cflib.crtp

# Initiate the low level drivers
cflib.crtp.init_drivers()

print('Scanning interfaces for Crazyflies...')

for a in range(7):
    available = cflib.crtp.scan_interfaces(0xe7e7e7e700 + a)
    print('Crazyflies found:')
    for i in available:
        print(i[0])
Jonas

Re: Scanning within an address range

Posted: Tue Apr 05, 2022 4:09 pm
by cleoburks
OK, thanks for the info.