Skip to content

OneWire has not been implemented #21

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

Closed
bartvstratum opened this issue Dec 29, 2020 · 10 comments
Closed

OneWire has not been implemented #21

bartvstratum opened this issue Dec 29, 2020 · 10 comments

Comments

@bartvstratum
Copy link

bartvstratum commented Dec 29, 2020

There was already a similar issue posted here, but unfortunately the "solution" was a bit vague (in my opinion...).

Following the documentation on PyPi I installed OneWire with:

pip3 install adafruit-circuitpython-onewire

On a Raspberry Pi Zero. Running the example code from that page:

import board
from adafruit_onewire.bus import OneWireBus
ow_bus = OneWireBus(board.D2)
devices = ow_bus.scan()
for d in devices:
    print("ROM={}\tFamily=0x{:02x}".format(d.rom, d.family_code))

results in:

pi@meteo-pi-bvs:~/meteo/pimeteo $ python3 test.py 
Traceback (most recent call last):
  File "test.py", line 15, in <module>
    ow_bus = OneWireBus(board.D2)
  File "/home/pi/.local/lib/python3.7/site-packages/adafruit_onewire/bus.py", line 79, in __init__
    self._ow = busio.OneWire(pin)
  File "/home/pi/.local/lib/python3.7/site-packages/busio.py", line 431, in __init__
    raise NotImplementedError("OneWire has not been implemented")
NotImplementedError: OneWire has not been implemented

I really don't understand the "yah! we dont support onewire thru blinka - you can use the sysfs 1-wire library system instead (we have no way to access 1-wire data outside the kernel)" posted in the previous issue. According to the documentation, this should work on a Raspberry Pi. Then why doesn't it work?

@ladyada
Copy link
Member

ladyada commented Dec 29, 2020

there is no low level interface for 1 wire on linux/raspberry pi like there is for uart/i2c/spi/i2s..., so you must use the kernel level 1-wire interfaces.

@dherrada wanna update that readme to remove the raspberry pi details?

@evaherrada
Copy link
Collaborator

@ladyada Sure

@evaherrada
Copy link
Collaborator

@ladyada Ok, just removed the 'Installing from PyPI' section

@ladyada
Copy link
Member

ladyada commented Jan 2, 2021

alight hopefully that will help. perhaps one day there will be a kernel module that lets us 1wire in userspace :)

@Arthur-66
Copy link

The current Circuitpython guide for DS18B20 still indiretly suggests the DS18B20 and Onewire can be used on the Raspberry Pi:

@ladyada
Copy link
Member

ladyada commented Feb 21, 2021

@dherrada please update! ^

@evaherrada
Copy link
Collaborator

@ladyada On it!

@evaherrada
Copy link
Collaborator

@Bluscream
Copy link

Oh no
WHy doesn't the library implement reading the files then :c

@ladyada
Copy link
Member

ladyada commented Jun 6, 2022

because its not a low enough interface. the kernel simply does not expose 'onewire' it only exposes 'complete ds18b20 driver'

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

5 participants