1-wire issues with DS18B20

Hi,

i try to use the 1-wire temperature sensor DS18B20 exactly as in the tutorial. Calling the example from GitHub causes this:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/seeed_ds18b20.py", line 21, in __init__
    self.device_folder = glob.glob(self.base_dir + '28*')[0]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "examples/BasicRead.py", line 14, in <module>
    main()     
  File "examples/BasicRead.py", line 5, in main
    DS18B20 = seeed_ds18b20.grove_ds18b20()
  File "/usr/local/lib/python3.7/dist-packages/seeed_ds18b20.py", line 31, in __init__
    raise OSError (None, meg)
OSError: [Errno None] 
#############################################################################

Please use 'sudo sh -c "echo dtoverlay=w1-gpio,gpiopin=5 >> /boot/config.txt"' then reboot to enable the w1

#############################################################################

I did enable 1-wire via raspi-config, so boot/config.txt contains:
[all]
dtoverlay=w1-gpio

If i do a ls on /sys/bus/w1/devices/, i get:

00-180000000000 00-980000000000 00-e80000000000 w1_bus_master1
So, there is no sensor, right?
dmesg shows:

[ 59.601604] w1_master_driver w1_bus_master1: Attaching one wire slave 00.800000000000 crc 8c
[ 59.609201] w1_master_driver w1_bus_master1: Family 0 for 00.800000000000.8c is not registered.

I am on Raspberry Pi 3 Model B Rev 1.2. Can you give me a hand?

I have the exact same issue, can anyone help?

Did someone found an answer to this? I have the same issue and don’t seem to be able to figure it out…

Had the same problem, the solution for me was in the error message:

“Please use ‘sudo sh -c “echo dtoverlay=w1-gpio,gpiopin=5 >> /boot/config.txt”’ then reboot to enable the w1”

Seeed uses GPIO Pin 5, standard is 4 I believe. I ran the command and was good to go.

1 Like

Guess you are right :slight_smile:
I don’t know why, I was struggling with the solution. Now it get it going using the specified command.
Thank you!

No problem, but i really didn’t thought you‘re still on it. Just wanted to solve it for people who google it, like i did. But knowing i helped you solve this problem a year later, makes creating an account especially for this even more worthy. I have to thank you for becoming a member of such a great movement.

Actually, I did forget about the project and your reply made me reactivate it again :slight_smile:

Dear,
I followed the procedure as described in One Wire Temperature Sensor DS18B20 | Seeed Studio Wiki (raspian part)

I get the same messsage as the initiator of this thread (fluffygtx), but the solution provided by
entering ‘sudo sh -c “echo dtoverlay=w1-gpio,gpiopin=5 >> /boot/config.txt”’ in a ssh session
enabling the W1 port via raspi-config
and then reboot to enable the w1

didn’t solve my issue, still the same issue when I run the code in python on my raspberry.

any tips/tricks?

You can try this code and setup instead: Interface DS18B20 with Raspberry Pi 4 - The Engineering Projects
This tutorial shows how to interface DS18B20 with a Raspberry Pi. The step-by-step demonstration may help you find the problem.