Giter Club home page Giter Club logo

Comments (7)

pbljung avatar pbljung commented on June 5, 2024 1

The ANT+ usb dongle doesn't fit the ports of a RPiZero, so I plug a micro-usb cable adapter into the OTG port, and a Dynastream 1009 ANT+ USB dongle into the adapter. Power is from my mac powerbook (or from my mac powerbook 140W charger) into the RPi power microusb port. No additional hw attached to the RPi. No usb hubs are used. RPi sdcard is older (buster) but "plain jane" (i2c enabled, spi enabled, serial console disabled), and not programmed to use any special OTG capabilities.

from pizero_bikecomputer.

pbljung avatar pbljung commented on June 5, 2024 1

I saw that bullseye is the earliest OS for Rpizero2W so I created a new sdcard with 2023-05-03-raspios-bullseye-armhf-lite.img Running on RpizeroW and Rpizero2W now dmesg and lsusb both return expected results (ie the ant dongle is recognized).

I am using this USB OTG adapter https://www.adafruit.com/product/1099

Now examples run fine on RpizeroW

pi@raspberrypi:~/Documents/ant/openant $ python3 examples/scan.py 
Driver available: [<class 'ant.base.driver.SerialDriver'>, <class 'ant.base.driver.USB2Driver'>, <class 'ant.base.driver.USB3Driver'>]
 - Using: <class 'ant.base.driver.USB3Driver'>
array('B', [4, 0, 228, 209, 95, 213, 4, 71, 128, 172, 30, 120, 1])
New Device Found: 7852 of type 120
array('B', [132, 0, 228, 209, 95, 213, 4, 71, 128, 172, 30, 120, 1])
New Device Found: 7852 of type 120
array('B', [132, 0, 95, 213, 214, 216, 5, 71, 128, 172, 30, 120, 1])
New Device Found: 7852 of type 120
array('B', [4, 0, 95, 213, 214, 216, 5, 71, 128, 172, 30, 120, 1])
New Device Found: 7852 of type 120
pi@raspberrypi:~/Documents/ant/openant $ python3 examples/heart_rate_monitor.py 
Driver available: [<class 'ant.base.driver.SerialDriver'>, <class 'ant.base.driver.USB2Driver'>, <class 'ant.base.driver.USB3Driver'>]
 - Using: <class 'ant.base.driver.USB3Driver'>
<class 'usb.core.USBTimeoutError'>, (110, 'Operation timed out')
Heartrate: 63 [BPM]

However on the Rpizero2W the openant examples still fail e.g. python3 examples/scan.py

Driver available: [<class 'ant.base.driver.SerialDriver'>, <class 'ant.base.driver.USB2Driver'>, <class 'ant.base.driver.USB3Driver'>]
 - Using: <class 'ant.base.driver.USB3Driver'>
Traceback (most recent call last):
  File "/home/pi/Documents/ant/openant/examples/scan.py", line 78, in <module>
    main()
  File "/home/pi/Documents/ant/openant/examples/scan.py", line 55, in main
    node = Node()
  File "/usr/local/lib/python3.9/dist-packages/ant/easy/node.py", line 55, in __init__
    self.ant = Ant()
  File "/usr/local/lib/python3.9/dist-packages/ant/base/ant.py", line 60, in __init__
    self._driver.open()
  File "/usr/local/lib/python3.9/dist-packages/ant/base/driver.py", line 202, in open
    dev.set_configuration()
  File "/usr/local/lib/python3.9/dist-packages/usb/core.py", line 915, in set_configuration
    self._ctx.managed_set_configuration(self, configuration)
  File "/usr/local/lib/python3.9/dist-packages/usb/core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/usb/core.py", line 159, in managed_set_configuration
    self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
  File "/usr/local/lib/python3.9/dist-packages/usb/backend/libusb1.py", line 812, in set_configuration
    _check(self.lib.libusb_set_configuration(dev_handle.handle, config_value))
  File "/usr/local/lib/python3.9/dist-packages/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno None] Other error

Have you tried openant on Rpizero2W? If so which OS version? Which version of pyusb or libusb?

from pizero_bikecomputer.

pbljung avatar pbljung commented on June 5, 2024 1

from pizero_bikecomputer.

hishizuka avatar hishizuka commented on June 5, 2024

Hi, @pbljung ,

I am sorry, but I cannot imagine your situation.
Can you list the hardware used in the Raspberry Pi Zero/Zero2?
You are not using a usb hub or USB OTG with ANT+ dongle, are you?

USB OTG
https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/ethernet-gadget

from pizero_bikecomputer.

hishizuka avatar hishizuka commented on June 5, 2024

a micro-usb cable adapter

Is the difference between RPi3 and RPi Zero the USB adapter?
Is it a proper USB OTG adapter?
Can you try to connect a USB keyboard with your micro-usb cable adapter and HDMI cable to the RPi zero and operate the console?

https://github.com/hishizuka/pizero_bikecomputer_v1/blob/master/doc/hardware_installation.md#ant-usb-dongle

from pizero_bikecomputer.

hishizuka avatar hishizuka commented on June 5, 2024

I mainly use Raspberry Pi OS bullseye.

I use libusb and python3-usb, as described in the document.

$ sudo apt-get install libusb-1.0-0 python3-usb
$ sudo pip3 install git+https://github.com/hishizuka/openant.git

Did you successfully execute pizero_bikecomputer.py with Raspberry Pi zero?

from pizero_bikecomputer.

hishizuka avatar hishizuka commented on June 5, 2024

BTW,
Why don't you try this one? I use this combination.

https://www.adafruit.com/product/2910
https://ja.aliexpress.com/item/1005001355302356.html?spm=a2g0o.detail.0.0.3a904ff3U9iMFH&gps-id=pcDetailTopMoreOtherSeller&scm=1007.40050.362094.0&scm_id=1007.40050.362094.0&scm-url=1007.40050.362094.0&pvid=1569c3aa-928f-4f63-b961-2ebcd9091824&_t=gps-id:pcDetailTopMoreOtherSeller,scm-url:1007.40050.362094.0,pvid:1569c3aa-928f-4f63-b961-2ebcd9091824,tpp_buckets:668%232846%238111%231996&isseo=y&pdp_npi=4%40dis%21JPY%211095%21612.0%21%21%217.15%21%21%402141113616989611252423464e1314%2112000026755529768%21rec%21JP%21%21AB

from pizero_bikecomputer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.