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

onewire-list doesn't work as expected. #60

Closed
gsexton opened this issue Sep 9, 2024 · 3 comments
Closed

onewire-list doesn't work as expected. #60

gsexton opened this issue Sep 9, 2024 · 3 comments

Comments

@gsexton
Copy link
Contributor

gsexton commented Sep 9, 2024

I'm trying to play with a one-wire DS18B20. I'm building the onewire-list program.

On my Raspberry Pi 5, I've added:

dtoverlay=w1-gpio,gpiopin=21

to the /boot/firmware/config.txt file. Doing a directory of /sys/bus/w1 shows:

root@raspberrypi:/sys/bus/w1# ls -alh
total 0
drwxr-xr-x  4 root root   0 Sep  8 19:54 .
drwxr-xr-x 35 root root   0 Sep  8 19:54 ..
drwxr-xr-x  2 root root   0 Sep  8 19:54 devices
drwxr-xr-x  4 root root   0 Sep  8 19:54 drivers
-rw-r--r--  1 root root 16K Sep  8 19:56 drivers_autoprobe
--w-------  1 root root 16K Sep  8 19:56 drivers_probe
--w-------  1 root root 16K Sep  8 19:54 uevent
root@raspberrypi:/sys/bus/w1# cd devices/28-5c61d4455dfa
root@raspberrypi:/sys/bus/w1/devices/28-5c61d4455dfa# ls
alarms  conv_time  driver  eeprom_cmd  ext_power  features  hwmon  id  name  power  resolution  subsystem  temperature  uevent  w1_slave
root@raspberrypi:/sys/bus/w1/devices/28-5c61d4455dfa# cat temperature 
23000
root@raspberrypi:/sys/bus/w1/devices/28-5c61d4455dfa# cat name
28-5c61d4455dfa

When I run the onewire-list test binary on the device, it shows the length of the returned buses as 0.

I've instrumented onewirereg.Register() and can see it's not getting called.

It looks like whatever is supposed to register the one wire busses in host isn't working. Can you give me an idea of what's going wrong?

Thanks.

@maruel
Copy link
Member

maruel commented Sep 9, 2024

Yep, sounds like a regression.
The bug is here: https://github.com/periph/host/blob/main/host_linux.go
It should import periph.io/x/host/v3/netlink.

@maruel maruel transferred this issue from periph/cmd Sep 9, 2024
@gsexton
Copy link
Contributor Author

gsexton commented Sep 9, 2024

OK, playing with this I realized that I needed to add gpioioctl to host_linux.go, so I added netlink as well.

Closing.

@gsexton gsexton closed this as completed Sep 9, 2024
@gsexton gsexton reopened this Sep 12, 2024
@gsexton
Copy link
Contributor Author

gsexton commented Sep 12, 2024

Re-Opening. Will submit patch on a PR.

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

No branches or pull requests

2 participants