Crazyflie Client does not start

Post here to get support
Newk
Member
Posts: 30
Joined: Sun Oct 23, 2016 1:53 pm
Location: Rotterdam
Contact:

Crazyflie Client does not start

Post by Newk »

Hi BitCraze team,
great product! i am dying of curiosity to try fly one but the (updated) client wont start in VM
from terminal i was able to get the error messages:

Code: Select all

bitcraze@bitcraze-vm:~$ python3 /home/bitcraze/projects/crazyflie-clients-python/bin/cfclient
INFO:cfclient.gui:Disabling STL printouts
Traceback (most recent call last):
  File "/home/bitcraze/projects/crazyflie-clients-python/bin/cfclient", line 5, in <module>
    main()
  File "/home/bitcraze/projects/crazyflie-clients-python/src/cfclient/gui.py", line 135, in main
    from .ui.main import MainUI
  File "/home/bitcraze/projects/crazyflie-clients-python/src/cfclient/ui/main.py", line 33, in <module>
    import cfclient.ui.tabs
  File "/home/bitcraze/projects/crazyflie-clients-python/src/cfclient/ui/tabs/__init__.py", line 35, in <module>
    from .FlightTab import FlightTab
  File "/home/bitcraze/projects/crazyflie-clients-python/src/cfclient/ui/tabs/FlightTab.py", line 42, in <module>
    from cflib.crazyflie.log import LogConfig
  File "/home/bitcraze/projects/crazyflie-lib-python/cflib/crazyflie/__init__.py", line 43, in <module>
    import cflib.crtp
  File "/home/bitcraze/projects/crazyflie-lib-python/cflib/crtp/__init__.py", line 30, in <module>
    from .debugdriver import DebugDriver
  File "/home/bitcraze/projects/crazyflie-lib-python/cflib/crtp/debugdriver.py", line 49, in <module>
    from .crtpstack import CRTPPacket
ImportError: cannot import name 'CRTPPacket'
Newk
Member
Posts: 30
Joined: Sun Oct 23, 2016 1:53 pm
Location: Rotterdam
Contact:

Re: Crazyflie Client does not start

Post by Newk »

did a full reinstall of the VM machine... now the client starts... don't know what that was about, guess something got corrupted :shock:
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyflie Client does not start

Post by arnaud »

Hi,

glad that you got it to work! Do you know what could have corrupted the first VM?

/Arnaud
Newk
Member
Posts: 30
Joined: Sun Oct 23, 2016 1:53 pm
Location: Rotterdam
Contact:

Re: Crazyflie Client does not start

Post by Newk »

I think it was me trying to run the VM on my 10 year old laptop in windowsXP (dualcore 1.6Mhz, 3GB ram).. wich did not worked out at all.
(i only managed to get one off the ground to the ceiling and after that could not anymore, had a hard time getting the driver part for CrazyRadio PA to function properly)

So now i have to run it natively in my lubuntu 16.04 partition...
have a bit of difficulty knowing what exactly to do to set it up right with the help of the VM-making tutorial (you often point to when this question comes up on the forum..)
I guess setting up a PPA isnt easy otherwise you would have provided that option.

I try to work this out over the weekend.. having it run not inside a VM would be more responsive anyway i figure.
Last edited by Newk on Sat Oct 29, 2016 1:49 pm, edited 1 time in total.
Newk
Member
Posts: 30
Joined: Sun Oct 23, 2016 1:53 pm
Location: Rotterdam
Contact:

Re: Crazyflie Client does not start

Post by Newk »

so, i got this far in native linux installation:

Code: Select all

newk@A7U:~/crazyflie2-install/crazyflie-clients-python$ pip3 install --user -e .
Obtaining file:///home/newk/crazyflie2-install/crazyflie-clients-python
Requirement already satisfied (use --upgrade to upgrade): cflib==0.1.0 in /home/newk/crazyflie2-install/crazyflie-lib-python (from cfclient===2016.4-22-g7dd5106)
Requirement already satisfied (use --upgrade to upgrade): appdirs==1.4.0 in /usr/lib/python3/dist-packages (from cfclient===2016.4-22-g7dd5106)
Requirement already satisfied (use --upgrade to upgrade): pyzmq in /usr/lib/python3/dist-packages (from cfclient===2016.4-22-g7dd5106)
Requirement already satisfied (use --upgrade to upgrade): pyusb>=1.0.0b2 in /home/newk/.local/lib/python3.5/site-packages (from cflib==0.1.0->cfclient===2016.4-22-g7dd5106)
Installing collected packages: cfclient
  Running setup.py develop for cfclient
Successfully installed cfclient

newk@A7U:~/crazyflie2-install/crazyflie-clients-python$ cfclient
No command 'cfclient' found, did you mean:
 Command 'cyclient' from package 'cyphesis-cpp-clients' (universe)
cfclient: command not found
newk@A7U:~/crazyflie2-install/crazyflie-clients-python$ dir
appveyor.yml  bin  bitcraze.ico  CMakeLists.txt  CONTRIBUTING.md  CREDITS.txt  examples  LICENSE.txt  MANIFEST.in  module.json	package.xml  README.md	RELEASE_CHECKLIST.md  setup.py	src  tools  win32install
newk@A7U:~/crazyflie2-install/crazyflie-clients-python$ python bin/cfclient
Traceback (most recent call last):
  File "bin/cfclient", line 2, in <module>
    from cfclient.gui import main
ImportError: No module named cfclient.gui
what makes me mis that cfclient.gui?
Newk
Member
Posts: 30
Joined: Sun Oct 23, 2016 1:53 pm
Location: Rotterdam
Contact:

Re: Crazyflie Client does not start

Post by Newk »

ok, just had to make it current directory:

Code: Select all

newk@A7U:~/crazyflie2-install/crazyflie-clients-python$ cd bin
newk@A7U:~/crazyflie2-install/crazyflie-clients-python/bin$ dir
cfclient  cfheadless  cfloader	cfzmq
newk@A7U:~/crazyflie2-install/crazyflie-clients-python/bin$ ./cfclient
but now it seems i missed something when i installed it..

Code: Select all

newk@A7U:~/crazyflie2-install/crazyflie-clients-python/bin$ ./cfclient
INFO:cfclient.gui:Disabling STL printouts
INFO:cfclient.utils.input.inputreaders:Input readers: ['linuxjsdev', 'pysdl2']
INFO:cfclient.utils.input.inputreaders:Successfully initialized [linuxjsdev]
INFO:cfclient.utils.input.inputreaders:Could not initialize [pysdl2]: No SDL2 support on Linux
INFO:cfclient.utils.input.inputinterfaces:Found interfaces: ['leapmotion', 'wiimote', 'zmqpull']
INFO:cfclient.utils.input.inputinterfaces:Could not initialize [leapmotion]: Leap Motion library probably not installed (No module named 'leapsdk')
INFO:cfclient.utils.input.inputinterfaces:Could not initialize [wiimote]: Missing cwiid (wiimote) driver No module named 'cwiid'
INFO:cfclient.utils.config:Dist config read from /home/newk/crazyflie2-install/crazyflie-clients-python/src/cfclient/configs/config.json
INFO:cfclient.utils.input.inputinterfaces:Could not initialize [zmqpull]: ZMQ input disabled in config file
INFO:cfclient.utils.zmq_param:Biding ZMQ for parameters at tcp://*:1213
INFO:cfclient.utils.zmq_led_driver:Biding ZMQ for LED driverat tcp://*:1214
INFO:cfclient.utils.input:Using device blacklist [(VirtualBox|VMware)]
INFO:cflib.crtp.radiodriver:v0.53 dongle with serial N/A found
INFO:cfclient.utils.input:Selected MUX: Normal
INFO:cfclient.ui.main:Role of Microsoft X-Box 360 pad is Device
INFO:cfclient.utils.input.mux:Adding device Microsoft X-Box 360 pad to MUX Normal
INFO:cfclient.ui.main:Select first device
INFO:cflib.drivers.cfusb:Looking for devices....
Segmentation fault (core dumped)
the segmentation fault happens when i click the window border

after i read it's missing pysdl2
i searched in repositories of ubuntu 16.04 and only found pysdl2-doc

but i then found python-sdl2 and python3-sdl2
i installed both of them just to make sure

but it didn't change cfclient not finding pysdl2
do i need to rebuild/reinstall it?
Newk
Member
Posts: 30
Joined: Sun Oct 23, 2016 1:53 pm
Location: Rotterdam
Contact:

Re: Crazyflie Client does not start

Post by Newk »

upon closer inspection the segmentation fault is caused by hovering over the top (title bar) of the window
(i still can resize and move the window through other ways)
i use LXDE wich is using Openbox as window manager.
If i am just carefull not to cross that top bar it seems to run OK :mrgreen:
(i could run a trace for debugging that but forgot how to do that and you might prefer a certain procedure)

edit: strange as it is, if i open a secondary window from cfclient (controller config, bootloader) it isn't bothered for seg-fault when crossing any of their top borders, including the main one.

that seems not my main concern for now.. it does not find the crazyradioPA fully as it is searching for devices without avail even tho the radio is plugged in, as you can see in my last post
is this due to missing pysdl2?
Newk
Member
Posts: 30
Joined: Sun Oct 23, 2016 1:53 pm
Location: Rotterdam
Contact:

Re: Crazyflie Client does not start

Post by Newk »

turns out CrazyradioPA works fine in the client.. problem was that particular CrazyFlie2 that did not connect due to how i flashed its firmware in VM when i desperately tried to get a good connection (not yet knowing it was due to cpu-load/driver issues).
I can connect to it with the bootloader wirelessly and flash it, yet it stays only steady lighting up the blue M2 led and am able to get into bootloading mode with powerbutton.. but it does not go to self test and ready-for-flying mode.
can i cure this with DFU usb flashing or do i need to utilize the Debug Adapter Kit?

The seg-fault with window bar still is in effect but might be just a bug in my linux config
Newk
Member
Posts: 30
Joined: Sun Oct 23, 2016 1:53 pm
Location: Rotterdam
Contact:

Re: Crazyflie Client does not start

Post by Newk »

allright i am clearly a n00b to this :oops:
turns out i NEED to flash the zip instead of STM and NRF seperately with bootloader.

crazyflie2 back from the dead! :lol: 8-)

edit: this beep melody with the motors (?) during self test when switched on in the new firmware is pretty cool!!
how does it work? diffrent high speed but short burtst on the motors untill you had something that sounded chromatic? or set to actual frequencies?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Crazyflie Client does not start

Post by tobias »

Glad you worked it out!

The sound is actually the correct frequency, it is made by changing the PWM frequency. See function here. Feel free to play with it. Might be hard to do during flight though as the PWM changes the output power characteristics for very low and high frequency. Would be fun to test though ;) .
Post Reply