why doesn't flashing crazyflie(2.0) work in cfclient?

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

why doesn't flashing crazyflie(2.0) work in cfclient?

Post by Newk »

hi! i'm trying to flash firmware with cfclient onto a cf2.0 with a lighthouse deck as i am not certain that it has the (latest) firmware.

starting cfclient in venv:

Code: Select all

newk@gigalight:~$ . ./bitcraze-venv/bin/activate
(bitcraze-venv) newk@gigalight:~$ cd bitcraze
(bitcraze-venv) newk@gigalight:~/bitcraze$ ls
crazyflie-clients-python
(bitcraze-venv) newk@gigalight:~/bitcraze$ cd crazyflie-clients-python/
(bitcraze-venv) newk@gigalight:~/bitcraze/crazyflie-clients-python$ 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/bitcraze/crazyflie-clients-python/src/cfclient/configs/config.json
INFO:cfclient.utils.config:Config file read from [/home/newk/.config/cfclient/config.json]
INFO:cfclient.utils.input.inputinterfaces:Could not initialize [zmqpull]: ZMQ input disabled in config file
INFO:cfclient.utils.zmq_led_driver:ZMQ led disabled in config file
INFO:cfclient.utils.zmq_param:ZMQ param disabled in config file

(python3:6732): dbind-WARNING **: 23:28:53.202: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
QApplication: invalid style override 'gtk' passed, ignoring it.
	Available styles: Windows, Fusion
INFO:cfclient.utils.input:Using device blacklist [(VirtualBox|VMware)]
INFO:cflib.crtp.radiodriver:v99.55 dongle with serial N/A found
INFO:cfclient.ui.tabs.QualisysTab:Switching Flight Mode to: FlightModeStates.DISCONNECTED
INFO:cflib.drivers.cfusb:Looking for devices....
INFO:cflib.crtp.prrtdriver:Initialized PRRT driver.
cfclient opens and i scan for the cf, open the bootloader window to connect to the cf over CrazyRadioPA
(the default, NOT via the cold bootloader tab)
then i see this in terminal

Code: Select all

INFO:cflib.crtp.radiodriver:v99.55 dongle with serial N/A found
INFO:cflib.drivers.cfusb:Looking for devices....
INFO:cflib.crtp.prrtdriver:Initialized PRRT driver.
INFO:cflib.crazyflie:Callback->Connection initialized[radio://0/125/2M/E7E7E7E701]
INFO:cflib.crazyflie:We are connected[radio://0/125/2M/E7E7E7E701], request connection setup
INFO:cflib.crazyflie:Callback->Connected to [radio://0/125/2M/E7E7E7E701]
INFO:cflib.crazyflie.platformservice:Protocol  version: 4
INFO:cflib.crazyflie.toc:TOC for port [5] found in cache
INFO:cflib.crazyflie:Log TOC finished updating
INFO:cflib.crazyflie.mem:6 memories found
INFO:cflib.crazyflie:Memories finished updating
INFO:cflib.crazyflie.toc:TOC for port [2] found in cache
INFO:cflib.crazyflie:Param TOC finished updating
INFO:cflib.crazyflie:Callback->Connection setup finished [radio://0/125/2M/E7E7E7E701]
INFO:cfclient.utils.logconfigreader:Parsing [stabilizer.json]
WARNING: QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING: QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING: QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING: QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING: QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING: QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
INFO:cfclient.ui.tabs.FlightTab:[imu_sensors.HMC5883L]: 1
INFO:cfclient.ui.tabs.locopositioning_tab:Crazyflie connected to radio://0/125/2M/E7E7E7E701
INFO:cfclient.ui.tabs.locopositioning_tab:Requesting loco deck parameter
INFO:cfclient.ui.tabs.lighthouse_tab:Crazyflie connected to radio://0/125/2M/E7E7E7E701
INFO:cfclient.ui.tabs.lighthouse_tab:Requesting lighthouse deck parameter
INFO:cflib.crazyflie.log:Have successfully started logging for id=1
INFO:cflib.crazyflie.log:Have successfully started logging for id=3
WARNING: QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING: QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING: QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING: QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
INFO:cfclient.ui.tabs.FlightTab:[imu_sensors.MS5611]: 1
INFO:cflib.crazyflie.log:Have successfully started logging for id=4
INFO:cfclient.ui.tabs.FlightTab:[imu_sensors.BMP388]: 0
INFO:cfclient.ui.tabs.locopositioning_tab:No Loco deck installed
INFO:cfclient.ui.tabs.lighthouse_tab:Lighthouse deck installed, enabling the tab
INFO:cflib.crazyflie.log:Have successfully started logging for id=5
then after hitting "program" button

Code: Select all

INFO:cfclient.ui.dialogs.bootloader:Created temporary firmware-release file at/tmp/tmpzg65p8_r/tmp.zip
it looks like it disconnects the cf and the bootloader window stays at status idle (program-button stays greyed-out),
but in cfclient window i can see it is still connected and the HUD reacts to moving the cf



in cfclient console output tab:

Code: Select all

console:

SYS: Crazyflie 2.0 is up and running!
SYS: Production release 2021.03
SYS: I am 0x3231333832355111003F005C and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
DECK_CORE: 1 deck(s) found
DECK_CORE: Calling INIT on driver bcLighthouse4 for deck 0
MPU9250 I2C connection [OK].
AK8963 I2C connection [OK].
LPS25H I2C connection [OK].
ESTIMATOR: Using Kalman (2) estimator
CONTROLLER: Using PID (1) controller
MTR-DRV: Using brushed motor driver
EEPROM: I2C connection [OK].
STORAGE: Storage check [OK].
AK8963: Self test [OK].
STAB: Wait for sensor calibration...
SYS: Free heap: 19248 bytes
LHFL: Lighthouse bootloader version: 2
STAB: Ready to fly.
LHFL: Bitstream CRC32: F69E7437 [FAIL]
LHFL: The deck bitstream does not match the required bitstream.
LHFL: We require lighthouse bitstream of size 104093 and CRC32 112BC794.
LHFL: Leaving the deck in bootloader mode ...
LH: FPGA not booted. Lighthouse disabled!
ESTKALMAN: State out of bounds, resetting
ESTKALMAN: State out of bounds, resetting
ESTKALMAN: State out of bounds, resetting
ESTKALMAN: State out of bounds, resetting
ESTKALMAN: State out of bounds, resetting
ESTKALMAN: State out of bounds, resetting
STAB: WARNING: stabilizer loop rate is off (996)
ESTKALMAN: State out of bounds, resetting
ESTKALMAN: State out of bounds, resetting
etc

cfclient Debug in "About"

Cfclient
Cfclient version: 2021.4.post13+f25f72d
System: linux
Python: 3.6.9
Qt: 5.15.2
PyQt: 5.15.4

Interface status
radio: Crazyradio version 99.55
UsbCdc: No information available
udp: None
prrt: No information available

Input readers
linuxjsdev (0 devices connected)

Input devices
None

Crazyflie
Connected: radio://0/125/2M/E7E7E7E701
Firmware: 00 (CLEAN)

Decks found
bcLighthouse4: rev=D, adr=0D54C07C00000052

Sensors found
HMC5883L: 1
MS5611: 1
BMP388: 0

Sensors tests
MPU6500: 1
HMC5883L: 1
MS5611: 1

another note: the linux system is (L)ubuntu 18.04.5

hopefully i just forgot something and you can point it out.. i am at loss at the moment :-/
jonasdn
Expert
Posts: 132
Joined: Mon Mar 01, 2021 3:13 pm

Re: why doesn't flashing crazyflie(2.0) work in cfclient?

Post by jonasdn »

Hi!

We have had some problems because of moving to the native (CPP) link by default (https://www.bitcraze.io/2021/05/switchi ... y-default/) to make sure that is not what is causing this, could you try invoking the client with:

Code: Select all

USE_CFLINK=python cfclient
And see if that helps in any way.

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

Re: why doesn't flashing crazyflie(2.0) work in cfclient?

Post by Newk »

thank you for the quick response :D

i tried both USE_CFLINK=python3 cfclient and USE_CFLINK=python cfclient
(as python2.7 is still default in the system for different applications)
maybe i can somehow set python3.6 as default for the venv?

i tried a few times and still have the same strange seemingly disconnect in bootloader window.
But i scrolled thru the terminal output and one time this output, which only happened once in the few times trying:

Code: Select all

INFO:cfclient.ui.dialogs.bootloader:Created temporary firmware-release file at/tmp/tmpaxs7uf8z/tmp.zip
WARNING: QXcbConnection: XCB error: 3 (BadWindow), sequence: 7732, resource id: 14681658, major code: 40 (TranslateCoords), minor code: 0
WARNING:vispy:QXcbConnection: XCB error: 3 (BadWindow), sequence: 7732, resource id: 14681658, major code: 40 (TranslateCoords), minor code: 0
INFO:cflib.crazyflie:Closing link
was unable yet to reproduce exactly when... but it might give more insight for now
jonasdn
Expert
Posts: 132
Joined: Mon Mar 01, 2021 3:13 pm

Re: why doesn't flashing crazyflie(2.0) work in cfclient?

Post by jonasdn »

Hi Newk!

This is curious! So lets try to get to the bottom of this! Maybe we could make sure we do not have mismatch between the python library (crazyflie-lib-python) and the client (crazyflie-client-python).

Could you get them both from github and install them from the master branch using pip3 perhaps?

Code: Select all

pip3 install -e .
So we can rule out any software shenanigans!

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

Re: why doesn't flashing crazyflie(2.0) work in cfclient?

Post by Newk »

(sorry for the late response)
I installed crazyflie-lib-python as described while venv is activated. (i think i did it before allready, but not with venv)
As i already installed the client recently as described i only did said above.. but one thing to note about the client.. i had trouble installing it before, then i went into the venv directory (i made inside home dir) and edited pyvenv.cfg to:

Code: Select all

home = /usr/bin
include-system-site-packages = true
version = 3.6.9
so i changed false into true
after that the client happily installed in venv.

Now with the lib also installed it finally works as expected and bootloader also installs the firmware for the Lighthouse Deck 8-)
dunno if i set it up how it's intended but at least i can move on (if not running into trouble because i do as i do :P )
Post Reply