Uncategorized

DS18B20 stopped recently

DS18B20 stopped recently

Ask QuestionAsked yesterdayActive yesterdayViewed 17 times1

I have read a few posts here on my issue, notably DS18B20 not detected by Raspberry Pi, but unfortunately none of the suggestions worked for my issue. I am seeking advice on additional troubleshooting measures that I can undertake.

I have used DS18B20 sensors for several years with Arduino & RPi boards. In one particular arrangement, I didn’t pay attention to the data since I had a DHT11 and a BME680 to corroborate the readings. Unfortunately, I have a monthly SQL TRUNCATE table operation and I cannot provide a specific date when the DS18B20 (or RPi OS) stopped creating the corresponding folder in /sys/bus/w1/devices owing regularly scheduled unattended update/upgrade operations in my farm. These sensors (I have a dozen+ of these) work presently in Arduino boards without issues. The failures occur with RPi0W and RPi3B boards.

The corresponding /boot/config.txt file has the following entry:

dtoverlay=w1-gpio-pullup,gpiopin=4

I’ve used modprobe as follows:

$ sudo modprobe w1_gpio
$ sudo modprobe w1_therm

I’ve confirmed that the corresponding processes are active by using the following command:

$ lsmod | grep w1
w1_therm               24576  0
w1_gpio                16384  0
wire                   40960  2 w1_gpio,w1_therm
$

When I explore /sys/bus/w1/devices, I do not find the folders with the 28- prefix for each DS18B20 sensor in the setup. I sometimes use multiple DS18B20 sensors in parallel and naturally when the solution was working each sensor had its unique 28- folder. The sensors are not in parasitic operation and there is a 4.7K resistor between data and 3.3VDC pins for the sensors. (Just to reiterate with due apologies for restating, the sensors were working previously on the same boards and are currently working with several different Arduino boards).

The RPi3 board is as follows:

$ uname -a
Linux raspbari9 5.4.70-v7+ #1348 SMP Wed Oct 7 16:14:38 BST 2020 armv7l GNU/Linux
$ 

I noticed that others had provided some boot messages. Here is one sample from my RPi3 board:

$ sudo vcdbg log msg
001530.977: brfs: File read: /mfs/sd/config.txt
001532.132: brfs: File read: 1823 bytes
001581.356: HDMI:EDID error reading EDID block 0 attempt 0
001582.618: HDMI:EDID error reading EDID block 0 attempt 1
001583.878: HDMI:EDID error reading EDID block 0 attempt 2
001585.139: HDMI:EDID error reading EDID block 0 attempt 3
001586.399: HDMI:EDID error reading EDID block 0 attempt 4
001587.660: HDMI:EDID error reading EDID block 0 attempt 5
001588.919: HDMI:EDID error reading EDID block 0 attempt 6
001590.180: HDMI:EDID error reading EDID block 0 attempt 7
001591.440: HDMI:EDID error reading EDID block 0 attempt 8
001592.700: HDMI:EDID error reading EDID block 0 attempt 9
001593.718: HDMI:EDID giving up on reading EDID block 0
001596.151: brfs: File read: /mfs/sd/config.txt
001597.199: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
001615.644: brfs: File read: 1823 bytes
001620.795: gpioman: gpioman_get_pin_num: pin WL_LPO_CLK not defined
001620.819: gpioman: gpioman_get_pin_num: pin BT_ON not defined
001620.838: gpioman: gpioman_get_pin_num: pin WL_ON not defined
001795.608: gpioman: gpioman_get_pin_num: pin DISPLAY_DSI_PORT not defined
001796.854: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
001796.918: *** Restart logging
... <N.B. removed several lines related to HDMI messages; I used headless mode of operation>
001833.789: dtb_file 'bcm2709-rpi-2-b.dtb'
001838.362: brfs: File read: /mfs/sd/bcm2709-rpi-2-b.dtb
001838.386: Loading 'bcm2709-rpi-2-b.dtb' to 0x100 size 0x66dd
001851.027: brfs: File read: 26333 bytes
001869.401: brfs: File read: /mfs/sd/overlays/overlay_map.dtb
001938.351: brfs: File read: 1463 bytes
001942.056: brfs: File read: /mfs/sd/config.txt
001942.603: dtparam: i2c_arm=on
001950.328: dtparam: spi=on
001957.160: dtparam: audio=on
001967.404: brfs: File read: 1823 bytes
001990.603: brfs: File read: /mfs/sd/overlays/w1-gpio-pullup.dtbo
001996.328: Loaded overlay 'w1-gpio-pullup'
001996.345: dtparam: gpiopin=4
001997.649: dtparam: pullup=1
002024.368: brfs: File read: 1171 bytes
002027.223: brfs: File read: /mfs/sd/cmdline.txt
002027.283: Read command line from file 'cmdline.txt':
002027.307: 'console=serial0,115200 console=tty1 root=PARTUUID=5e3da3da-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles'
003961.076: gpioman: gpioman_get_pin_num: pin EMMC_ENABLE not defined
004007.597: gpioman: gpioman_get_pin_num: pin WL_ON not defined
004011.483: brfs: File read: 166 bytes
004414.835: brfs: File read: /mfs/sd/kernel7.img
004414.859: Loading 'kernel7.img' to 0x8000 size 0x581110
004414.891: Device tree loaded to 0x2eff9400 (size 0x6be9)
004420.495: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
007492.364: vchiq_core: vchiq_init_state: slot_zero = 0xf7580000, is_master = 1
007496.776: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
007502.305: TV service:host side not connected, dropping notification 0x00000002, 0x00000002, 0x00000023
$ 

Obviously, this is some self-inflicted operator/user error. All suggestions are welcome since I would like to get more usage out of the many DS18B20 sensors that I have. Many thanks.

Kind regards.pi-3b+pi-zerosensords18b201-wireshareedit  follow  closeflag asked yesterdayMatha Goram9944 bronze badges

  • (1) I once found that 1-wire has conflict with I2C. So one troubleshooting trick is to disable I2C. (2) And if you have recently updated buster, w1_therm driver might no longer work. (3) if you have a spare micoSD card, you might like to start with a fresh buster with clean config files, try my little python code, which is copy & run, auto detect and print results. This is to verify that clean config files can still run your 1-Wire hard ware: raspberrypi.stackexchange.com/questions/100203/…. Cheers. – tlfong01 yesterday    
  • 1Thx @tlfong01! (1) Understand your suggestion rather well owing to the challenges in reading DHTxx with I2C. 🙂 Disabling I2C on the RPi3 didn’t resolve the issue (2) Is there another driver that I could use instead of w1_therm? (3) For the RPi3, started with the March Buster image (owing to personal OCD challenges, installed all other supporting pacakges too) but still no 28- folder under /…/devices. Will retry will new August Buster image and nothing except support for DS18B20 and report back here. Code is not an issue since I have boatloads of variations in Python & C/C++. Kind regards. – Matha Goram yesterday
  • 1Thx again @tlfong01! Your suggestion (3) worked!! I used Aug Buster image & enabled only 1-wire & SSH (for my headless work). Voila, w/o touching any of the existing DS18B20 sensors, I found the three 28- folders under /…/devices. Guess all the updates/upgrades & my other code messed up the 1-wire access to the DS18B20 sensors. Appreciate your nudge & advice. Kind regards. – Matha Goram yesterday
  • How nice to hear the good news! Cheers. – tlfong01 23 hours ago   

add a comment

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.