bitcraze / crazyflie-lib-python

Python library to communicate with Crazyflie
Other
263 stars 896 forks source link

connection established but qgroundcontrol does not recognize #102

Closed kyuhyong closed 3 years ago

kyuhyong commented 6 years ago

I don't know whether this is issue with qgc or not but my other system works just fine with same qgc version so I post here.

I am running ubuntu 16.04 and git cloned the repository. moved to crazyflie-lib-python folder and did following make venv source venv-cflib/bin/activate cd examples python cfbridge.py 110 0xe7e7e7e7e7

I get following messages Scanning interfaces for Crazyflies...

DEBUG:cflib.crtp:Scanning: cflib.crtp.radiodriver.RadioDriver INFO:cflib.crtp.radiodriver:v0.53 dongle with serial N/A found DEBUG:cflib.crtp:Scanning: cflib.crtp.serialdriver.SerialDriver DEBUG:cflib.crtp:Scanning: cflib.crtp.udpdriver.UdpDriver DEBUG:cflib.crtp:Scanning: cflib.crtp.usbdriver.UsbDriver INFO:cflib.drivers.cfusb:Looking for devices.... Crazyflies found: radio://0/70/2M radio://0/110/2M DEBUG:cflib.crazyflie:Adding callback on port [6] to [<bound method Localization. ... Connecting to radio://0/110/2M INFO:cflib.crazyflie:Callback->Connection initialized[radio://0/110/2M]

Then I opened qgc in other terminal with same system but no connection. When I unplug power of the drone, I get connection lost message as here

WARNING:cflib.crazyflie:Got link error callback [Too many packets lost] in state [2] INFO:cflib.crazyflie:Callback->Disconnected from [radio://0/110/2M] Disconnected from radio://0/110/2M INFO:cflib.crazyflie:Callback->Connection lost to [radio://0/110/2M]: Too many packets lost Connection to radio://0/110/2M lost: Too many packets lost

So I assume connection between cfbridge and drone is established but it does not talk to qgc. How can I connect my qgc to cfbridge?

ataffanel commented 6 years ago

I have never used this bridge but it seems that the connection to the Crazyflie has been lost. The message you see in the console (too many packets lost) mean that cflib cannot communicate with the Crazyflie anymore.

kyuhyong commented 6 years ago

@ataffanel Hi, thanks for quick reply. No the connection lost message is returned when I unplug power from the drone to see if the connection is really made. I re-installed ubuntu 16.04 and still having this issue. QGC is waiting for vehicle connection when cfbridge is connected to the drone.

kyuhyong commented 6 years ago

It looks like there is a bug in recent updates. My colder crazyflie-lib-python can connect to qgc successfully and have additional messages after connecting to the drone as follows

waiting to receive message INFO:cflib.crazyflie:Resending for pattern (93, 5) DEBUG:cflib.crazyflie:We want to resend and the pattern is there INFO:cflib.crazyflie:Resending for pattern (93, 5) DEBUG:cflib.crazyflie:We want to resend and the pattern is there INFO:cflib.crazyflie:Resending for pattern (93, 5) DEBUG:cflib.crazyflie:We want to resend and the pattern is there INFO:cflib.crazyflie:Resending for pattern (93, 5) DEBUG:cflib.crazyflie:We want to resend and the pattern is there INFO:cflib.crazyflie:Callback->Connected to [radio://0/70/2M] DEBUG:cflib.crazyflie:Looking for pattern match on (93, 5) vs (255, 1, 39) DEBUG:cflib.crazyflie:Looking for pattern match on (93, 5) vs (255, 1, 39) DEBUG:cflib.crazyflie:Looking for pattern match on (93, 5) vs (255, 1, 39) DEBUG:cflib.crazyflie:Looking for pattern match on (93, 5) vs (255, 1, 39) DEBUG:cflib.crazyflie:Looking for pattern match on (93, 5) vs (255, 1, 39) DEBUG:cflib.crazyflie:Looking for pattern match on (93, 5) vs (255, 1, 39) DEBUG:cflib.crazyflie:Looking for pattern match on (93, 5) vs (255, 1, 39) DEBUG:cflib.crazyflie:Looking for pattern match on (93, 5) vs (140, 1, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 33, 255, 84, 0, 8, 0, 0, 0, 107, 1, 100, 254, 42, 11, 1, 1, 230, 56, 83) DEBUG:cflib.crazyflie:Looking for pattern match on (93, 5) vs (93, 5, 54, 0) DEBUG:cflib.crazyflie:Found new longest match (93, 5) DEBUG:cflib.crazyflie.log:Logging reset, continue with TOC download DEBUG:cflib.crazyflie.toc:[5]: Start fetching... DEBUG:cflib.crazyflie:Adding callback on port [5] to [<bound method TocFetcher._new_packet_cb of <cflib.crazyflie.toc.TocFetcher instance at 0x7f62b2581758>>] DEBUG:cflib.crazyflie.toc:[5]: Got TOC CRC, 0 items and crc=0x00000000 DEBUG:cflib.crazyflie.toc:Requesting index 0 on port 5 DEBUG:cflib.crazyflie.toc:Added element [0] WARNING:cflib.crazyflie.toccache:Could not save cache, no writable directory DEBUG:cflib.crazyflie:Removing callback on port [5] to [<bound method TocFetcher._new_packet_cb of <cflib.crazyflie.toc.TocFetcher instance at 0x7f62b2581758>>] DEBUG:cflib.crazyflie.toc:[5]: Done! INFO:cflib.crazyflie:Log TOC finished updating INFO:cflib.crazyflie.mem:Requesting number of memories INFO:cflib.crazyflie.mem:0 memories found INFO:cflib.crazyflie:Memories finished updating DEBUG:cflib.crazyflie.toc:[2]: Start fetching... DEBUG:cflib.crazyflie:Adding callback on port [2] to [<bound method TocFetcher._new_packet_cb of <cflib.crazyflie.toc.TocFetcher instance at 0x7f62b2581758>>] DEBUG:cflib.crazyflie.toc:[2]: Got TOC CRC, 0 items and crc=0x00000000 DEBUG:cflib.crazyflie.toc:Requesting index 0 on port 2 DEBUG:cflib.crazyflie.toc:Added element [0] WARNING:cflib.crazyflie.toccache:Could not save cache, no writable directory DEBUG:cflib.crazyflie:Removing callback on port [2] to [<bound method TocFetcher._new_packet_cb of <cflib.crazyflie.toc.TocFetcher instance at 0x7f62b2581758>>] DEBUG:cflib.crazyflie.toc:[2]: Done! INFO:cflib.crazyflie:Param TOC finished updating INFO:cflib.crazyflie:Callback->Connection setup finished [radio://0/70/2M] Connected to radio://0/70/2M DEBUG:cflib.crazyflie.param:Requesting request to update param [0] DEBUG:cflib.crazyflie.param:Updated parameter [.]

Without above additional messages, it won't connect to qgc.

CalumJB commented 5 years ago

I have this same issue, but I don't have any older version of crazyflie-lib-python. Can you tell me which I should be using?