Sending control message failed, Windows 10

Post here to get support
MBurdett
Beginner
Posts: 15
Joined: Mon Dec 18, 2017 8:52 pm

Sending control message failed, Windows 10

Post by MBurdett » Thu Feb 08, 2018 11:19 pm

Hi, I have been trying to use my new Crazyradio with my Windows machine. I had the same issue as before when I attempted to use this with my Raspberry Pi in that the device could not be found. When I first tried running the example scripts in the master firmware folder I had something similar on windows 10.

However thanks to the other threads on here that has been resolved. I then had an issue where the USB lib was not found, again thanks to this forum this was solved again after reading through other peoples support issues.

I have installed the radio drivers using Zadig, using libusb-win32, WINUSB and libusbk, each one being installed as the driver and as the WCID driver. I tried them one by one to see what difference this makes, replacing the driver to prevent any conflicts.

In my device manager the radio is recognised, and the computer states that the device is functioning properly. I have now come to a new error when I try to run the example scripts included (prx.py and ptx.py). I receive an error stating that the sending of a control message failed. I have included a screenshot of my output for you to see what is happening.

Image
Attachments
CMD output windows.png

arnaud
Bitcraze
Posts: 1788
Joined: Tue Feb 06, 2007 12:36 pm

Re: Sending control message failed, Windows 10

Post by arnaud » Mon Feb 12, 2018 4:06 pm

These examples uses a functionality that is not available in the firmware flashed in factory in Crazyradios. If you are OK with recovering the boorloader in case of problems, you can compile and flash the latest commit of the Crazyradio firmware which will give your PRX functionalities. The chance you need to recover the boorloader are pretty slim if you are not modifying the firmware but you should be prepared to it since flashing a bad firmware will block you from accessing the bootloader.

If you do not need PTX functionalities, you can use the Crazyradio in PRX mode already.

MBurdett
Beginner
Posts: 15
Joined: Mon Dec 18, 2017 8:52 pm

Re: Sending control message failed, Windows 10

Post by MBurdett » Tue Feb 13, 2018 7:58 am

Hi,

I'm not really too comfortable doing that after trying that with my last radio and don't want to risk causing any issues. Is there a script I can run to test the basic functions of the radio?

arnaud
Bitcraze
Posts: 1788
Joined: Tue Feb 06, 2007 12:36 pm

Re: Sending control message failed, Windows 10

Post by arnaud » Tue Feb 13, 2018 1:17 pm

If you have a Crazyflie, you can use the Crazyflie client and lib.

Otherwise you can use the python crazyflie driver: https://github.com/bitcraze/crazyradio- ... zyradio.py. This could send a packet which will blink the RED led if no other nRF radios are settup with the same settings, for example you can run this code in a python console in the same folder as the crazyradio.py file:

Code: Select all

from crazyradio import Crazyradio

cr = Crazyradio()
cr.send_packet([0xff,])

MBurdett
Beginner
Posts: 15
Joined: Mon Dec 18, 2017 8:52 pm

Re: Sending control message failed, Windows 10

Post by MBurdett » Wed Feb 14, 2018 2:34 pm

Hi,

Thank you, this works and when it runs the red LED lights up and flashes once each time it is run as expected. If I was to now program the radio do I just use commands like this? I need to write a script to send a test signal at a specific output in DBW and add this to the radio so it runs this automatically when it receives power. May I ask what I need to do next for this?

Thank you so much for the help, this is looking promising :D

arnaud
Bitcraze
Posts: 1788
Joined: Tue Feb 06, 2007 12:36 pm

Re: Sending control message failed, Windows 10

Post by arnaud » Wed Feb 14, 2018 4:58 pm

The firmware and API of the radio are pretty much tailored what is needed for the Crazyflie. You can look at the driver source code and the USB protocol documentation to see what kind of functionality are available out of the box. There should be one python method for each USB commands.

If you mean transmitting a continuous carrier, the radio has a mode for that but it is a development mode intended for measurement only. You can activate it with the method cr.set_cont_carrier(true), you can set the power with the method set_power, the value to pass for the power is one of those (from -18dBm to 0dBm): https://github.com/bitcraze/crazyradio- ... #L108-L111. Note that there is a power amplifier on the way with +20dBm amplification.

MBurdett
Beginner
Posts: 15
Joined: Mon Dec 18, 2017 8:52 pm

Re: Sending control message failed, Windows 10

Post by MBurdett » Tue Feb 20, 2018 6:24 pm

Thank you so much! I have this working exactly as I need to! :D :D

I just need to be able to upload my code so the radio runs it when it receives power, may I ask how to do this?

arnaud
Bitcraze
Posts: 1788
Joined: Tue Feb 06, 2007 12:36 pm

Re: Sending control message failed, Windows 10

Post by arnaud » Wed Feb 21, 2018 9:17 am

The only way to add code in the radio is to adapt the Crazyradio firmware and flash it (see my warning earlier about SPI flashing).

If you do not want to write your own firmware, maybe you can use a raspberry-pi zero or something similar?

Btw, I am a bit curious, can you share what kind of project you are doing with the Crazyradio?

MBurdett
Beginner
Posts: 15
Joined: Mon Dec 18, 2017 8:52 pm

Re: Sending control message failed, Windows 10

Post by MBurdett » Wed Feb 21, 2018 6:13 pm

Hi,

I may be better using a Pi zero as this may prove the easiest method without risking damage to the radio.

Certainly, I am using the radio for the transmission section of a small wireless power system at 2.4Ghz, so far this has worked perfectly for this.

MBurdett
Beginner
Posts: 15
Joined: Mon Dec 18, 2017 8:52 pm

Re: Sending control message failed, Windows 10

Post by MBurdett » Wed Feb 21, 2018 9:18 pm

Hi,

I've tried using the radio with my test code on my Raspberry Pi and it really doesn't seem to like it. Everything runs fine on my Windows machine but my Raspberry Pi cannot seem to find the radio so not sure what I can do now. :?:

Post Reply