Page 1 of 1

Newest cfclient won't connect to CF 1.0

Posted: Thu Dec 25, 2014 5:10 am
by hdmathias
Since upgrading to the newest version of the Windows cfclient a few days ago, I can't connect to my CF 1.0. It connects fine to CF 2.0. This isn't a big deal for me since I don't often fly with the client but I am curious if anyone else has this issue.

Re: Newest cfclient won't connect to CF 1.0

Posted: Thu Dec 25, 2014 5:38 am
by chad
hdmathias wrote:Since upgrading to the newest version of the Windows cfclient a few days ago, I can't connect to my CF 1.0. It connects fine to CF 2.0. This isn't a big deal for me since I don't often fly with the client but I am curious if anyone else has this issue.
In the latest client on my Mac I can connect to the CF1.0 just fine. I can even fly it. But... I don't get any parameters from the TOC (so no plotter info either) and the artificial horizon doesn't update.

Re: Newest cfclient won't connect to CF 1.0

Posted: Thu Dec 25, 2014 7:25 pm
by marcus
hdmathias wrote:Since upgrading to the newest version of the Windows cfclient a few days ago, I can't connect to my CF 1.0. It connects fine to CF 2.0. This isn't a big deal for me since I don't often fly with the client but I am curious if anyone else has this issue.
What happens when you try to connect? It get's stuck with the Cancel button showing but never disconnect? What version of the firmware are you running on?

Currently there's two issues for the CF1 on the new client: The bootloader isn't working correctly (issue) and chad's issue with the parameter tab not being downloaded (issue).

Re: Newest cfclient won't connect to CF 1.0

Posted: Fri Dec 26, 2014 4:04 am
by hdmathias
Marcus and Chad -- thanks for the replies.

Yes, when I try to connect, it gets hung-up trying and I eventually hit Cancel. I'm not sure what version of the firmware is on it -- I'll have to check, but we're out of town until late next week. I updated it when I got it in September or October but not since.

Re: Newest cfclient won't connect to CF 1.0

Posted: Fri Dec 26, 2014 9:55 am
by marcus
Hmm, it turns out that the new client will not connect to the CF1. I've added an issue for it here and another one here. For the CF2 we have added a new memory port where it's possible to access (read/write) the non-volatile memories (I2C and 1-wire). This makes sense for the CF2 but maybe not the for the CF1. As a part of the connection procedure we added requesting the number of memories and information about them. But these replies are only implemented in the CF2, not in the CF1 firmware. This "hangs" the connection procedure since the client is waiting to get an answer to how many memories are available. At the time this is being asked the client doesn't know if the quadcopter we are connecting to is a CF1 or CF2, so it's not a good solution to work around it on the client side. If you want to hack in the code the fix is pretty quick, the patch below can be used to skip the memory updating:

Code: Select all

diff --git a/lib/cflib/crazyflie/__init__.py b/lib/cflib/crazyflie/__init__.py
index 41b63f8..d915ef9 100644
--- a/lib/cflib/crazyflie/__init__.py
+++ b/lib/cflib/crazyflie/__init__.py
@@ -169,7 +169,7 @@ class Crazyflie():
     def _log_toc_updated_cb(self):
         """Called when the log TOC has been fully updated"""
         logger.info("Log TOC finished updating")
-        self.mem.refresh(self._mems_updated_cb)
+        self.param.refresh_toc(self._param_toc_updated_cb, self._toc_cache)
 
     def _link_error_cb(self, errmsg):
         """Called from the link driver when there's an error"""


Re: Newest cfclient won't connect to CF 1.0

Posted: Fri Dec 26, 2014 5:37 pm
by chad
Awesome! That patch worked great. Thanks Marcus!!

Re: Newest cfclient won't connect to CF 1.0

Posted: Mon Jan 05, 2015 12:12 am
by hdmathias
Thanks Marcus. Finally back from holiday and able to make the change.

Happy New Year. Looking forward to many interesting projects with Crazyflies in 2015. :)

Re: Newest cfclient won't connect to CF 1.0

Posted: Mon Jan 05, 2015 11:53 pm
by hdmathias
I've made the change but still no joy. Here's the change I made in cflib\crazyflie\__init__.py:
def _log_toc_updated_cb(self):
"""Called when the log TOC has been fully updated"""
logger.info("Log TOC finished updating")
# Following line commented and replaced so
# that the newest client can connect to Crazyflie 1.0
#self.mem.refresh(self._mems_updated_cb)
self.param.refresh_toc(self._param_toc_updated_cb, self._toc_cache)

When I run the client, it still hangs when trying to connect to a Crazyflie 1.0. Here are the last few lines of the console output:
INFO:cflib.crtp.radiodriver:v0.52 dongle with serial N/A found
INFO:cflib.drivers.cfusb:Looking for devices....
INFO:cflib.crazyflie:Callback->Connection initialized[radio://0/10/250K]
INFO:cflib.crazyflie:We are connected[radio://0/10/250K], request connection setup
INFO:cflib.crazyflie:Callback->Connected to [radio://0/10/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

I'm not sure why it's requesting the number of memories given the change I made. I made the change in my safe version of the distribution and then ran setup.py. I then verified that the version in Python27\Lib\site-packages\cflib\crazyflie had changed. Am I missing something?

Re: Newest cfclient won't connect to CF 1.0

Posted: Tue Jan 06, 2015 2:36 pm
by hdmathias
Sorry -- I don't work much with the client and forgot that I installed the binary version. A little sleep was all it took to realize my mistake. Changed __init__.py in the location for that version of the client and everything works. Thanks!

Re: Newest cfclient won't connect to CF 1.0

Posted: Wed Jan 07, 2015 6:47 pm
by hdmathias
An FYI: Today I assembled another CF 2.0 (4 down, one to go). The first thing I did after assembly was update the firmware. Then I rebooted the CF and tried to configure the radio channel and communication rate. I could open the configuration window and change the values but the "Write" button remained grayed-out. I tried several times, rebooting the CF each time, with the same result. The only thing that had changed since the last time I'd done this was the edit to __init__.py several posts above in this thread. So I changed __init__.py back to it's original state. After that, I was able to update the configuration.

Maybe this was just a coincidence and something else is at work but I thought I should let you know. The work-around is easy enough so it's not a big deal for now.