No Crazyflies found, cannot run example

Firmware/software/electronics/mechanics
Post Reply
hdmathias
Member
Posts: 47
Joined: Sat Nov 01, 2014 3:24 pm
Location: Florida, USA

No Crazyflies found, cannot run example

Post by hdmathias »

Hello everyone -- I'm having a problem that is driving me a little mad. I have the Crazyflie Python code installed both in Linux on a VM and within Windows on my computer. In the VM, I can run the Python example programs (ramp.py, for example) and everything works perfectly. In Windows, I can run the client program and control the Crazyflie with an XBox controller. BUT, when I run the ramp.py program within Windows, I get the following:

Scanning interfaces for Crazyflies...
exception raised
Crazyflies found:
No Crazyflies found, cannot run example

Note that the "exception raised" output is due to a print statement I put in the crazyradio.py. It seemed that the "Cannot find a Crazyradio dongle" exception was occurring despite the fact that I wasn't getting that message. That appears to be the case. Here is the relevant part of __init__

def __init__(self, device=None, devid=0):
""" Create object and scan for USB dongle if no device is supplied """
if device is None:
try:
time.sleep(0.25)
device = _find_devices()[devid]
except Exception:
print "exception raised"
raise Exception("Cannot find a Crazyradio Dongle")

print "device = %s" % device
self.dev = device

As you can see, I also added the sleep line -- I found that in another thread on the forum.

I'm confused by the fact that everything works perfectly from the client program within Windows but not from the command line. I believe I've installed the correct drivers. I believe that I installed a binary version of the client (it's been a while and I can't recall for certain). Either way, the client works. Did I miss a step somewhere? I'm sure I've caused the problem but am not sure how or where.

I'd very much appreciate any help. I'm hoping to do a demo in a couple of weeks and need to get this working -- preferable in Windows. Thank you.

David
hdmathias
Member
Posts: 47
Joined: Sat Nov 01, 2014 3:24 pm
Location: Florida, USA

Re: No Crazyflies found, cannot run example

Post by hdmathias »

I'm sorry to reply to my own topic but I'm still looking for an answer. Can anyone suggest a reason that within Windows I can fly the Crazyflie with the client program but not using the Python examples? When trying with the Python examples, I get the "No Crazyflies found" error. Thank you.

David
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: No Crazyflies found, cannot run example

Post by whoenig »

It might be a security related issue or a radio-in-use-issue. Try the following:
1.) Make sure that you deal with both scenarios in the same way, i.e. don't double click on cfclient while you use a command prompt to run ramp.py. Specifically, try to use a command prompt for both cases.
2.) Try to use an administrative command prompt to make sure that it is not security related.
3.) If the radio dongle is in use, you would get the same error. Unplug and replug the radio dongle before running ramp.py. Also make sure that you don't wire the usb dongle to the VM, when trying on Windows.
hdmathias
Member
Posts: 47
Joined: Sat Nov 01, 2014 3:24 pm
Location: Florida, USA

Re: No Crazyflies found, cannot run example

Post by hdmathias »

Thank you for your reply. I don't think 1 or 3 are the problem (in other words, I don't think I'm doing those things) but I hadn't considered #2. I'll try that and post back. Thank you again.

David
hdmathias
Member
Posts: 47
Joined: Sat Nov 01, 2014 3:24 pm
Location: Florida, USA

Update: Re: No Crazyflies found, cannot run example

Post by hdmathias »

I tried running cmd in Administrator mode. The results are the same. Here is what I did:
1. Launch cmd as Administrator
2. Run ramp.py -- error message "No crazyflies found"
3. Run the Windows Crazyflie client, connect to Crazyflie and fly. Works perfectly (except for my bad piloting).
4. Disconnect from client and terminate the program.
5. Try again to run ramp.py -- same result, no connection
6. Relaunch client, connect and fly again.
7. Disconnect from client and terminate program.
8. Try to run ramp.py and scan.py -- neither can connect to the Crazyflie.

The Windows device manager tells me that the "Crazyradio Dongle is working properly."

Clearly something is wrong. Could it be my installation? At the moment, I'm at a loss. Thanks for any help.

David
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: No Crazyflies found, cannot run example

Post by whoenig »

How did you install exactly and where is ramp.py coming from? I guess you used the official bitcraze Windows installer? However, do you use the ramp.py from that installed package or did you download that from somewhere else?
hdmathias
Member
Posts: 47
Joined: Sat Nov 01, 2014 3:24 pm
Location: Florida, USA

Re: No Crazyflies found, cannot run example

Post by hdmathias »

whoenig - thanks for your latest reply. All of the Crazyflie-specific files are from the official package. Of course, I had to install several other applications during the installation process.
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: No Crazyflies found, cannot run example

Post by whoenig »

Do you have several python versions installed? I.e. would it be possible that the cfclient uses one version and ramp.py another one? It sounds like there is some issue with pyusb, but I am not sure why that would be different between the sample script and the GUI...
hdmathias
Member
Posts: 47
Joined: Sat Nov 01, 2014 3:24 pm
Location: Florida, USA

Re: No Crazyflies found, cannot run example

Post by hdmathias »

Good thought about the Python versions. I checked to be sure. I only have Python 2.7 installed (and even if there was another version installed, only Python27 appears in my Path env variable). Still a mystery. Thank you for your continued help.

David
hdmathias
Member
Posts: 47
Joined: Sat Nov 01, 2014 3:24 pm
Location: Florida, USA

More info -- Re: No Crazyflies found, cannot run example

Post by hdmathias »

I continue to look for a solution to this problem. I thought I should check the installations of the dependencies required to run Crazyflie programs from the command line. So I opened IDLE and tried to import PyQt4, pygame and usb. All imported without error. See below. If I understand correctly, this result means that the dependencies are properly installed.

Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import PyQt4
>>> import pygame
>>> import usb
>>>

If anyone from Bitcraze is reading this, I'd appreciate any help you can provide. As a last resort we can switch to Linux but because of other research projects we have going on, I'd like to get this working in Windows.

Thanks.

David
Post Reply