Can't connect to CF using bluetooth.

Post here to get support
Post Reply
se5a
Beginner
Posts: 8
Joined: Thu Sep 05, 2013 9:16 pm

Can't connect to CF using bluetooth.

Post by se5a »

I've had the crazyflie 2.0 for a while now, and it's been in its box for some time due to a broken motor mount, it was working fine when the mount broke.
I recently got some new mounts and replaced the broken one. however I'm now having problems connecting the phone (moto g2 running android 6.0)
the flie turns on, I get the green light blink a bunch of times, and the red heatbeat light.
I've updated the crazyflie client to 0.6.5 and I'm still having problems:
I turn the CF on, I get the boot sequence lights including the 5 green flashes, and the two solid blue lights and the red heatbeat light.
I launch the CF client on my phone, and click the connect button
I get the connecting message,
then it says "connected" however the green light does not light up on the CF to indicate that it's connected.
nothing happens when I manipulate the controls on the phone.
after a couple of seconds the phone will say "disconnected"


One other problem which may or may not be related is that I don't seem to be able to charge via usb any longer. I connect usb to the CF and I don't get the green charging light. however I do have one of the separate battery charger boards which I've used to charge the battery.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Can't connect to CF using bluetooth.

Post by arnaud »

Hi,
Your description of the Crazyflie state looks good, up until the link Green LED that does not blink. Can you connect with a computer?

What firmware version are you running? Can you try to flash the latest version in order to make sure the firmware is in good shape?

For the charging indication there is a bug that you may be hitting: If you connect the USB port and then start the Crazyflie, the charge indication will not work. If you first start the Crazyflie and then connect the USB port then the charge indication should work. Can you try to connect the usb port after the Crazyflie is started?
se5a
Beginner
Posts: 8
Joined: Thu Sep 05, 2013 9:16 pm

Re: Can't connect to CF using bluetooth.

Post by se5a »

ah yes, turning it on first before plugging it into USB causes the M3 light to blink, which initially confused me since when looking up the lights I found what must have been the CF1 lights guide, which indicates the green light should blink.


I do have the PA... somewhere. in a box somewhere, in storage, probably, maybe... I've had a look for it but so far I've not been able to locate it so that's out at the moment.

I'll try updating the firmware via USB and see what happens.
I'm not sure what FW is currently running, it'll be a year or older.

ok so I updated to cf2-2017.06 via USB. now it makes some sounds when it boots up ;-)
When I connect via android client, I *sometimes* get a connection and m4 blinks orange rapidly a couple of times, but after a couple of seconds still disconnects, it is unresponsive to any of the thrust controls while connected.

is there a way to test via my laptops bluetooth?
both phone and laptop see the Crazyflie under bluetooth devices.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Can't connect to CF using bluetooth.

Post by arnaud »

Hi,

Even though connecting to the laptop should be possible, there is no implemented way to connect to Crazyflie using bluetooth with a laptop. If you have a crazyradio you would be able to update both CPUs (you can only update stm32 with usb, not the radio CPU and it is the radio CPU that handles bluetooth). If you have, or know anyone with, and iphone or ipad you can use the iphone app to update firmware with bluetooth which will update both CPUs.

Anyway, it would be interesting to test the connection with an other device, either a Crazyradio or another mobile device to check where the problem can be.
se5a
Beginner
Posts: 8
Joined: Thu Sep 05, 2013 9:16 pm

Re: Can't connect to CF using bluetooth.

Post by se5a »

I managed to find my crazyradioPA, and updated the CF firmaware via that.
it doesn't seem to have made a difference when trying to connect via the phone however.
se5a
Beginner
Posts: 8
Joined: Thu Sep 05, 2013 9:16 pm

Re: Can't connect to CF using bluetooth.

Post by se5a »

So I borrowed my brother in laws xbox controller and tried flying from the laptop.
first couple of flights seemed ok, then all of a sudden I started getting disconnects after I applied thrust, here's copy pasta from the terminal log:

INFO:cflib.crazyflie:Callback->Connection initialized[radio://0/80/250K]
INFO:cflib.crazyflie:We are connected[radio://0/80/250K], request connection setup
INFO:cflib.crazyflie:Resending for pattern (93, 5)
INFO:cflib.crazyflie:Callback->Connected to [radio://0/80/250K]
INFO:cflib.crazyflie.toc:TOC for port [5] found in cache
INFO:cflib.crazyflie:Log TOC finished updating
INFO:cflib.crazyflie.mem:Requesting number of memories
INFO:cflib.crazyflie.mem:3 memories found
INFO:cflib.crazyflie.mem:Requesting first id
INFO:cflib.crazyflie.mem:Requesting information about memory 1
INFO:cflib.crazyflie.mem:Memory: id=1, type=LED driver, size=24
INFO:cflib.crazyflie.mem:Requesting information about memory 2
INFO:cflib.crazyflie.mem:Memory: id=2, type=Loco Positioning, size=5632
INFO:cflib.crazyflie.mem:Done getting all the memories, start reading the OWs
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/80/250K]
INFO:cflib.crazyflie.mem:Writing new chunk of 24bytes at 0x0
INFO:cfclient.utils.logconfigreader:Parsing [stabilizer.json]
INFO:cflib.crazyflie.mem:Updating content of memory 0
INFO:cflib.crazyflie.mem:Requesting new chunk of 16bytes at 0x0
INFO:cflib.crazyflie.mem:WRITE: Mem=1, addr=0x0, status=0x0
INFO:cflib.crazyflie.mem:This write request is done
INFO:cflib.crazyflie.mem:Write to LED driver done
INFO:cfclient.ui.main:LED write done callback
INFO:cflib.crazyflie.mem:READ: Mem=0, addr=0x0, status=0x0, data=(48, 120, 66, 67, 1, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231)
INFO:cflib.crazyflie.mem:READING: We are still interested in request for mem 0
INFO:cflib.crazyflie.mem:Got new data: bytearray(b'0xBC\x01P\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe7')
INFO:cflib.crazyflie.mem:Requesting new chunk of 5bytes at 0x10
INFO:cfclient.ui.tabs.LEDTab:Memory: id=1, type=LED driver, size=24
INFO:cflib.crazyflie.log:Have successfully started logging for id=16
INFO:cflib.crazyflie.mem:READ: Mem=0, addr=0x10, status=0x0, data=(231, 231, 231, 231, 1)
INFO:cflib.crazyflie.mem:READING: We are still interested in request for mem 0
INFO:cflib.crazyflie.mem:{'roll_trim': 0.0, 'version': 1, 'radio_speed': 0, 'radio_channel': 80, 'pitch_trim': 0.0, 'radio_address': 996028180455}
INFO:cflib.crazyflie.log:Have successfully started logging for id=18
INFO:cflib.crazyflie.log:Have successfully started logging for id=19
INFO:cfclient.ui.tabs.FlightTab:[imu_sensors.HMC5883L]: 1
INFO:cfclient.ui.tabs.FlightTab:[imu_sensors.MS5611]: 1
INFO:cflib.crazyflie.log:Have successfully started logging for id=20
WARNING:cflib.crazyflie:Got link error callback [Too many packets lost] in state [2]
INFO:cflib.crazyflie:Callback->Disconnected from [radio://0/80/250K]
INFO:cflib.crazyflie:Callback->Connection lost to [radio://0/80/250K]: Too many packets lost

the link quality bar decreases significantly as I apply thrust. wondering if it's a battery/power problem, the battery bar shows half, and the heartbeat light is not yet solid on the cf, but the battery bar is dropping with the link quality. I'll recharge and see what happens.
se5a
Beginner
Posts: 8
Joined: Thu Sep 05, 2013 9:16 pm

Re: Can't connect to CF using bluetooth.

Post by se5a »

Doesn't seem to be a battery problem since it still happened at full battery.
noise from one of the motors perhaps?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Can't connect to CF using bluetooth.

Post by arnaud »

For the Crazyradio performance you can increase it by setting the datarate to 2M instead of 250K. There can be a bit of loss due to the motor noise and it is usually more visible at 250K.

Have you been able to test with another phone? What you are observing with bluetooth is strange (actually it makes me think of a behavior I saw with iPhone during development: the iPhone did not appreciate how I setup the bluetooth link and was disconnecting me after 1 second ...). If you cannot test with another phone I could send you a patched firmware to test the assumption.
Post Reply