Page 1 of 1

Unable to use different radio address

Posted: Wed May 04, 2016 1:32 pm
by 3zuli
I'm having problems with using different radio addresses for the Crazyflie. Using the Crazyflie Client, I'm able to set the radio channel and bitrate and this works fine. However, although I'm able to change the radio address as well, I seem to have problems with connecting to it.
For these tests, I'm using the basiclog.py example. I start with a "stock" Crazyflie with address set to the default "E7E7E7E7E7". I can connect to "radio://0/110/1M/E7E7E7E7E7" without problems. Then I try changing the address to "radio://0/110/1M/E7E7E7E701" using the client, rebooting the Crazyflie and connecting to that, but I just get "Connection to radio://1/110/1M/E7E7E7E701 failed: Too many packets lost". But now if I try connecting to E7E7E7E7E7 again, it works without problems. The same goes if I try to connect from the client, it only works if E7E7E7E7E7 is in the address field in the Connect dialog. So it looks like the address isn't being properly updated on the Crazyflie side and it keeps using the default value. However, according to the log the address seems to updated correctly.
This problem looks to be the same with all 6 Crazyflies I have, two were bought in November and four at the end of March. I'm using my own, heavily modified version of crazyflie-firmware forked sometime in January, but I also tried it with the newest official firmware and the problem stays exactly the same.
Does anyone know, what could be the problem? Why doesn't the Crazyflie use the configured address?

Adam

Extract from log while connecting and setting the address:

Code: Select all

Setting address to 0xE7E7E7E701
INFO:cflib.crazyflie.mem:Writing new chunk of 21bytes at 0x0
INFO:cflib.crazyflie.mem:WRITE: Mem=0, addr=0x0, status=0x0
INFO:cflib.crazyflie.mem:This write request is done
INFO:cflib.crazyflie.mem:Updating content of memory 0
INFO:cflib.crazyflie.mem:Requesting new chunk of 16bytes at 0x0
INFO:cflib.crazyflie.mem:READ: Mem=0, addr=0x0, status=0x0, data=(48, 120, 66, 67, 1, 105, 1, 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: 0xBCi
INFO:cflib.crazyflie.mem:Requesting new chunk of 5bytes at 0x10
INFO:cflib.crazyflie.mem:READ: Mem=0, addr=0x10, status=0x0, data=(1, 231, 231, 231, 53)
INFO:cflib.crazyflie.mem:READING: We are still interested in request for mem 0
INFO:cflib.crazyflie.mem:{'roll_trim': 0.0, 'radio_speed': 1, 'radio_channel': 105, 'radio_address': 996028180225L, 'version': 1, 'pitch_trim': 0.0}


After rebooting the CF, connecting again
INFO:cflib.crazyflie.mem:Requesting number of memories
INFO:cflib.crazyflie.mem:2 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:Done getting all the memories, start reading the OWs
INFO:cflib.crazyflie:Memories finished updating
INFO:cflib.crazyflie.mem:Writing new chunk of 24bytes at 0x0
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:cflib.crazyflie.mem:READ: Mem=0, addr=0x0, status=0x0, data=(48, 120, 66, 67, 1, 105, 1, 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: 0xBCi
INFO:cflib.crazyflie.mem:Requesting new chunk of 5bytes at 0x10
INFO:cflib.crazyflie.mem:READ: Mem=0, addr=0x10, status=0x0, data=(1, 231, 231, 231, 53)
INFO:cflib.crazyflie.mem:READING: We are still interested in request for mem 0
INFO:cflib.crazyflie.mem:{'roll_trim': 0.0, 'radio_speed': 1, 'radio_channel': 105, 'radio_address': 996028180225L, 'version': 1, 'pitch_trim': 0.0}


Setting address back to 0xE7E7E7E7E7
INFO:cflib.crazyflie.mem:Writing new chunk of 21bytes at 0x0
INFO:cflib.crazyflie.mem:WRITE: Mem=0, addr=0x0, status=0x0
INFO:cflib.crazyflie.mem:This write request is done
INFO:cflib.crazyflie.mem:Updating content of memory 0
INFO:cflib.crazyflie.mem:Requesting new chunk of 16bytes at 0x0
INFO:cflib.crazyflie.mem:READ: Mem=0, addr=0x0, status=0x0, data=(48, 120, 66, 67, 1, 105, 1, 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: 0xBCi
INFO:cflib.crazyflie.mem:Requesting new chunk of 5bytes at 0x10
INFO:cflib.crazyflie.mem:READ: Mem=0, addr=0x10, status=0x0, data=(231, 231, 231, 231, 27)
INFO:cflib.crazyflie.mem:READING: We are still interested in request for mem 0
INFO:cflib.crazyflie.mem:{'roll_trim': 0.0, 'radio_speed': 1, 'radio_channel': 105, 'radio_address': 996028180455L, 'version': 1, 'pitch_trim': 0.0}


Rebooting and connecting again
INFO:cflib.crazyflie.mem:Requesting number of memories 
INFO:cflib.crazyflie.mem:2 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:Done getting all the memories, start reading the OWs 
INFO:cflib.crazyflie:Memories finished updating 
INFO:cflib.crazyflie.mem:Writing new chunk of 24bytes at 0x0 
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:READ: Mem=0, addr=0x0, status=0x0, data=(48, 120, 66, 67, 1, 105, 1, 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: 0xBC
INFO:cflib.crazyflie.mem:Requesting new chunk of 5bytes at 0x10
INFO:cflib.crazyflie.mem:READ: Mem=0, addr=0x10, status=0x0, data=(231, 231, 231, 231, 27)
INFO:cflib.crazyflie.mem:READING: We are still interested in request for mem 0
INFO:cflib.crazyflie.mem:{'roll_trim': 0.0, 'radio_speed': 1, 'radio_channel': 105, 'radio_address': 996028180455L, 'version': 1, 'pitch_trim': 0.0}

Re: Unable to use different radio address

Posted: Wed May 04, 2016 3:32 pm
by tobias
What version of the firmware are you running on the CF2? It might be that the nRF51 firmware isn't up to date.

Re: Unable to use different radio address

Posted: Wed May 04, 2016 8:13 pm
by 3zuli
I forked my code after the following commit:

Code: Select all

commit 9ceb597ebe1ed0740ed483950a73f8651fbcbb78
Merge: c29c75b 9665026
Author: Arnaud Taffanel <arnaud@taffanel.org>
Date:   Thu Dec 10 11:11:28 2015 +0100
I probably haven't pulled from the official repository it ever since. I made heavy modifications to Stabilizer, Commander and added some new CRTP ports, but the rest of the code is pretty much untouched. The nRF firmware is stock, I haven't made any changes to it. The issue is the same with all my Crazyflies, the ones bought back in November as well as the ones from March, no matter if I'm running my firmware or the latest official firmware. They were bought through exp-tech.de, if that helps.

Re: Unable to use different radio address

Posted: Wed May 04, 2016 8:30 pm
by tobias
I don't have time to check now but I'm pretty sure it's because the firmware isn't up to date. Both the nRF51 and the STM32F4 firmware needs to be updated. You could try to flash the latest official to get the latest nRF51 firmware and then your modified firmware.