Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Could not check if kernel driver was active, not implemented in usb backend" and other stuff #103

Open
EkoFreshFTech opened this issue Apr 19, 2024 · 0 comments

Comments

@EkoFreshFTech
Copy link

EkoFreshFTech commented Apr 19, 2024

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:

from openant.easy.node import Node
from openant.easy.channel import Channel
from openant.base.message import Message

NETWORK_KEY = [0xb9, 0xa5, 0x21, 0xfb, 0xbd, 0x72, 0xc3, 0x45] # Standard network key for communication with ANT+ devices


def callback_data_power(data): # This function returns the data as soon as it has been received
    print('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)

def main(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 power
    channel_power = node.new_channel(Channel.Type.BIDIRECTIONAL_RECEIVE) # Create a channel for the node to receive data
    channel_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 received

    channel_power.set_rf_freq(57) # Set the correct radio frequency of 2.4 Ghz
    channel_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 node
    finally:
        node.stop() #close the channel if connection attempt is unsuccessful
        print("Node shut down")

node = Node() # Create a node for the connection of ANT+ dongle and Elite Justo for performance
main(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.
Skript Output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant