[SOLVED] Crazyradio on Win7/virtual machine

Post here to get support
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Crazyradio on Win7/virtual machine

Post by tobias »

Then I think now we have narrowed it down to being something with the driver. Arnaud knows this stuff best and I'm afraid I can't help that much more. Arnaud has probably gone to bed so we will have to continue tomorrow.
alex
Expert
Posts: 137
Joined: Mon Feb 18, 2013 11:36 am
Location: Germany

Re: Problems installing PyUSB and running CF PC Client

Post by alex »

No problem, tobias. I'm grateful for your help, I waited two and a half months for this thing to ship. :) Good night.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Crazyradio on Win7/virtual machine

Post by tobias »

If you are able to it would be great if you could test it on another computer. Good night to you too.
alex
Expert
Posts: 137
Joined: Mon Feb 18, 2013 11:36 am
Location: Germany

Re: Crazyradio on Win7/virtual machine

Post by alex »

tobias wrote:If you are able to it would be great if you could test it on another computer. Good night to you too.
Hmm, I could reanimate my old notebook from 2005. I will let you know if it works.
In the meantime I hope that Arnaud can help.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyradio on Win7/virtual machine

Post by arnaud »

Hi Alex,

Did you try to run the client outside of the VM, in Windows?

For the VM I can't see what could be wrong: there are not real drivers on linux, as soon as linux recognize the Dongle user mode programs (like ours) should be able to use it.

Could you try to type that in a terminal to test if the radio is reachable at all:

Code: Select all

bitcraze@bitcraze-ubuntu:~$ cd projects/crazyflie-pc-client/lib/
bitcraze@bitcraze-ubuntu:~/projects/crazyflie-pc-client/lib$ python
Python 2.7.3 (default, Dec 22 2012, 21:14:12)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from cflib.drivers.crazyradio import Crazyradio
>>> cr = Crazyradio()
>>> cr.version
0.5
>>> exit()
If you get the same printout then Python can access the radio dongle and you certainly have a problem with the client. You could try to reset the client repos by typing in a terminal (this will reset the source tree):

Code: Select all

bitcraze@bitcraze-ubuntu:~$ cd projects/crazyflie-pc-client/
bitcraze@bitcraze-ubuntu:~/projects/crazyflie-pc-client$ rm -r *
bitcraze@bitcraze-ubuntu:~/projects/crazyflie-pc-client$ hg update -C
And then try again to connect the copter.
alex
Expert
Posts: 137
Joined: Mon Feb 18, 2013 11:36 am
Location: Germany

Re: Crazyradio on Win7/virtual machine

Post by alex »

Arnaud, I'll not be able to try that until Thursday. But I'll do my best to write an answer as soon as possible.

In addition I will run the Client on Windows again. Therefore I have to reinstall Python and its dependencies under Win7 x64 as I completely switched over to the VM before the Crazyflie/-radio was shipped. Might be better to have two parallel development environments for testing purposes - like in this case.

Thanks anyway.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyradio on Win7/virtual machine

Post by arnaud »

We made an installer on windows that is supposed to run out of the box without requiring any dependencies so you might try to test that first (it is not good for development but at least it will show if things are working).
alex
Expert
Posts: 137
Joined: Mon Feb 18, 2013 11:36 am
Location: Germany

Re: Crazyradio on Win7/virtual machine

Post by alex »

arnaud wrote:We made an installer on windows that is supposed to run out of the box without requiring any dependencies so you might try to test that first (it is not good for development but at least it will show if things are working).
Ah, perfect, didn't think about that before. I'll give it a try.
alex
Expert
Posts: 137
Joined: Mon Feb 18, 2013 11:36 am
Location: Germany

Re: Crazyradio on Win7/virtual machine

Post by alex »

arnaud wrote:Hi Alex,
Could you try to type that in a terminal to test if the radio is reachable at all:

Code: Select all

bitcraze@bitcraze-ubuntu:~$ cd projects/crazyflie-pc-client/lib/
bitcraze@bitcraze-ubuntu:~/projects/crazyflie-pc-client/lib$ python
Python 2.7.3 (default, Dec 22 2012, 21:14:12)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from cflib.drivers.crazyradio import Crazyradio
>>> cr = Crazyradio()
>>> cr.version
0.5
>>> exit()
This is the result:

Code: Select all

bitcraze@bitcraze-ubuntu:~$ cd projects/crazyflie-pc-client/lib
bitcraze@bitcraze-ubuntu:~/projects/crazyflie-pc-client/lib$ python
Python 2.7.3 (default, Sep 26 2012, 21:53:58) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from cflib.drivers.crazyradio import Crazyradio
>>> cr = Crazyradio()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cflib/drivers/crazyradio.py", line 141, in __init__
    self.set_power(self.P_0DBM)
  File "cflib/drivers/crazyradio.py", line 177, in set_power
    _send_vendor_setup(self.handle, SET_RADIO_POWER, power, 0, ())
  File "cflib/drivers/crazyradio.py", line 265, in _send_vendor_setup
    index=index, timeout=1000)
usb.USBError: error sending control message: Connection timed out
>>> 
Second try after unplugging and plugging in the Crazyradio again:

Code: Select all

bitcraze@bitcraze-ubuntu:~$ cd projects/crazyflie-pc-client/lib
bitcraze@bitcraze-ubuntu:~/projects/crazyflie-pc-client/lib$ pythonPython 2.7.3 (default, Sep 26 2012, 21:53:58) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from cflib.drivers.crazyradio import Crazyradio
>>> cr = Crazyradio()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cflib/drivers/crazyradio.py", line 113, in __init__
    raise Exception("Cannot find a Crazyradio Dongle")
Exception: Cannot find a Crazyradio Dongle
>>> 
@Arnaud: Does this help to track down the error source?
I'll try to test the Crazyradio under the Win7 x64 environment for the next step.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyradio on Win7/virtual machine

Post by arnaud »

@Arnaud: Does this help to track down the error source?
I'll try to test the Crazyradio under the Win7 x64 environment for the next step.
These errors are very strange and look like a USB problem with VirtualBox. Does any other USB devices work in virtualbox? (for example you can try to see if the gamepad is recognized by the client). I found that some people have problems with Windows 7, USB and Virtualbox. Maybe thats it: https://forums.virtualbox.org/viewtopic ... 04#p176270
Post Reply