You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
first excuse my bad english.
So I have made a small script to recieve data from a Elite Justo and it's kinda working. But I have some problems. I'm using a cheap USB Stick from Amazon
Here is the code:
fromopenant.easy.nodeimportNodefromopenant.easy.channelimportChannelfromopenant.base.messageimportMessageNETWORK_KEY=[0xb9,0xa5,0x21,0xfb,0xbd,0x72,0xc3,0x45]# Standard network key for communication with ANT+ devicesdefcallback_data_power(data): # This function returns the data as soon as it has been receivedprint('Leistung ',data)# Example data: array('B', [16, 181, 47, 0, 26, 253, 11, 0]). The value you are looking for (power) should be the penultimate value in the array. Check again# def callback_data_cadence(data): # This function returns the data as soon as it is received# print('Cadence ', data)defmain(node):
node.set_network_key(0x00,NETWORK_KEY)# Set the node's network key to the default network for ANT+ devices ### This channel (channel_pmeter) is for transmitting the powerchannel_power=node.new_channel(Channel.Type.BIDIRECTIONAL_RECEIVE)# Create a channel for the node to receive datachannel_power.on_broadcast_data=callback_data_power# Execute callback_data when data is received#channel_power.on_burst_data = callback_data_power # Execute callback_data when data is receivedchannel_power.set_rf_freq(57)# Set the correct radio frequency of 2.4 Ghzchannel_power.set_id(0,11,0)# Establishes the channel between ANT+ dongle and the device with ID 11. To find the desired ID, run "openant scan" in the terminal and search for the device_type of the desired device. ### This channel (channel_cadence) is for the transmission of the cadence# channel_cadence = node.new_channel(Channel.Type.BIDIRECTIONAL_RECEIVE) # Create a channel for the node to receive data# channel_cadence.on_broadcast_data = callback_data_cadence # Execute callback_data when data is received# channel_cadence.set_rf_freq(57) # Set the correct radio frequency of 2.4 Ghz# channel_cadence.set_id(0, 121, 0)try:
channel_power.open()# Try to open the channel# channel_cadence.open() node.start()# Start the nodefinally:
node.stop()#close the channel if connection attempt is unsuccessfulprint("Node shut down")node=Node()# Create a node for the connection of ANT+ dongle and Elite Justo for performancemain(node)
To analyze the problems better, i commented out the second part of the script (see code), but it does the same thing like the first part.
My problem is that I get the message "Could not check if kernel driver was active, not implemented in usb backend" every time I run the Script. And the output of data is regularly interrupted with an error. Are both problems caused by an old driver, did I buy a bad USB Stick or is my code just garbage?
This picture shows the result of some seconds of data recieved, interrupted with the timeout error.
The text was updated successfully, but these errors were encountered:
Hi,
first excuse my bad english.
So I have made a small script to recieve data from a Elite Justo and it's kinda working. But I have some problems. I'm using a cheap USB Stick from Amazon
Here is the code:
To analyze the problems better, i commented out the second part of the script (see code), but it does the same thing like the first part.
My problem is that I get the message "Could not check if kernel driver was active, not implemented in usb backend" every time I run the Script. And the output of data is regularly interrupted with an error. Are both problems caused by an old driver, did I buy a bad USB Stick or is my code just garbage?
This picture shows the result of some seconds of data recieved, interrupted with the timeout error.
The text was updated successfully, but these errors were encountered: