Can't get Crazyradio via

Firmware/software/electronics
Post Reply
16PooleN
Beginner
Posts: 5
Joined: Sat Jan 03, 2015 12:26 am

Can't get Crazyradio via

Post by 16PooleN »

I am trying to connect to the Crazyradio from a Windows application. I am using the CrazyflieDotNet.Crazyradio.Driver library. The code to access the Crazyradio driver appears to be failing:

IEnumerable<ICrazyradioDriver> crazyradioDrivers = null;
crazyradioDrivers = CrazyradioDriver.GetCrazyradios();
if (crazyradioDrivers == null)
{
Console.WriteLine("CrazyradioDrivers = null");
}
if (crazyradioDrivers != null && crazyradioDrivers.Any())
{
return crazyradioDrivers.First();
}
throw new Exception("No Crazyradio USB dongles found!");

When I run, an exception appears to be thrown by CrazyradioDriver.GetCrazyradios():
Value cannot be null.
Parameter name: crazyradioUsbDevice

The cfclient program connected to the Crazyradio driver just fine, and to the Crazyflie.

Thanks for any help.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Can't get Crazyradio via

Post by arnaud »

I just tried and saw the same behavior on Windows 10 using visual studio community edition. I do not know how to solve it though, maybe you can try posting a ticket on the github repos to get help from the original developer?
Sorry this is not much help but I can confirm that the problem does not come from the crazyradio hardware or driver.

/Arnaud
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Can't get Crazyradio via

Post by arnaud »

I could go a bit further in the program by adding this line:

Code: Select all

diff --git a/CrazyflieDotNet/Source/CrazyflieDotNet.Crazyradio/Driver/CrazyradioDriver.cs b/CrazyflieDotNet/Source/Crazyindex 149e863..4905b8a 100644
--- a/CrazyflieDotNet/Source/CrazyflieDotNet.Crazyradio/Driver/CrazyradioDriver.cs
+++ b/CrazyflieDotNet/Source/CrazyflieDotNet.Crazyradio/Driver/CrazyradioDriver.cs
@@ -546,7 +546,8 @@ public static IEnumerable<ICrazyradioDriver> GetCrazyradios()

                                foreach (UsbRegistry crazyRadioUsbDevice in crazyRadiosRegDeviceList)
                                {
-                                       crazyRadioDrivers.Add(new CrazyradioDriver(crazyRadioUsbDevice.Device));
+                    if (crazyRadioUsbDevice.Device != null)
+                                           crazyRadioDrivers.Add(new CrazyradioDriver(crazyRadioUsbDevice.Device));
                                }
                        }
                        else
Even though I have only one Crazyradio plugged, two where found and the first one had .Device set to null. This patch just ignore the wrong device. It seem to crash later though but at least it found and start communicating with a Crazyflie 2.0.
16PooleN
Beginner
Posts: 5
Joined: Sat Jan 03, 2015 12:26 am

Re: Can't get Crazyradio via Windows application

Post by 16PooleN »

I have (I think) a Crazyflie 1. I only see one CrazyRadio identified in the device manager, and also in the registry. As you pointed out, it doesn't look like it has a device name. Is this a problem and how can I address it? My code is currently not searching the registry, but using the CrazyradioDriver.GetCrazyradios() function.
shmedium
Beginner
Posts: 2
Joined: Thu Sep 05, 2013 6:36 pm

Re: Can't get Crazyradio via

Post by shmedium »

I sorry for the very late reply (i've been away past 6 months on a thru hike).

I am the developer. Sorry for the years of little work. I ran into a wall/bug and did not have the spirit to look into it until a fellow developer (possibly on this forum) contacted me and asked for some info and he found some bugs.

I have since fixed some bugs and have working commander packets. I can fly the copter via a wired ps3 controller.

It is still only a console view. To use PS3 controller, you must install motion joy driver software.

Here is a small demo video of it flying https://instagram.com/p/7q6sr4ump7/?taken-by=karczilla

You may be getting the error because you may not have a windows driver for the dongle. Please read my updated readme file on github for how to do that.

Cheers.
Post Reply