Developing for the CrazyRadio using Python.

Post Reply
Posts: 1
Joined: Tue Apr 12, 2016 10:13 am

Developing for the CrazyRadio using Python.

Post by StrToLower »


I am currently developing a python program for the CrazyRadio to learn about radios, python and wireless communication. My first program is simply trying to listen on all channels with all rates to see if I get any signal at all. From reading the documentation I noticed I need to use the radio in PRX mode. When trying to enable PRX mode through the python program I get an error I have been unable to find a fix for online.

This is the code I am trying to run.

Code: Select all

import sys

# import crazyradio python API
from crazyradio import Crazyradio

def main():

    cr = Crazyradio()

    rates = [Crazyradio.DR_250KPS, Crazyradio.DR_1MPS, Crazyradio.DR_2MPS]
    channels = cr.scan_channels
    #for channel in channels:
     #   cr.set_channel(channel)
    for rate in rates:
        for i in range(0,10):
            print cr.receive()
    print "this is the end of the listener"
    return 0

if __name__ == '__main__':

The error I get is the following.

Code: Select all

Traceback (most recent call last):
  File "", line 38, in <module>
  File "", line 29, in main
  File "/home/bitcraze/projects/crazyradio-firmware/lib/", line 221, in set_mode
    _send_vendor_setup(self.handle, SET_MODE, mode, 0, ())
  File "/home/bitcraze/projects/crazyradio-firmware/lib/", line 310, in _send_vendor_setup
    index=index, timeout=1000)
usb.USBError: error sending control message: Broken pipe

What my question boils down to is, do I have to flash the firmware to something different or do any similar action to the CrazyRadio to enable PRX mode?
Post Reply