0

I have Rock Pi 4 B 4GB. Kernel for now is:

Linux rock 4.4.154-95-rockchip-gd2ab1f26e1b3 #1 SMP Mon Oct 21 06:42:35 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux

I also have DS18B20 temperature sensor with resistor. I've connected the resistor with sensor to the board. Checked few times if the connection is ok - yes.

Sensor is not visible by kernel. What I did also:

  1. issued commands: apt install python-pip, pip install w1thermsensor to acccess sensor via Python
  2. there was nothing in folder /sys/bus/w1/devices/
  3. uncommented intfc:dtoverlay=w1-gpio4-30 in /boot/hw_intfc.conf to turn on the wire port in kernel
  4. issued commands: modprobe w1-gpio, modprobe w1-therm
  5. lsmod shows that wire, w1_therm and w1_gpio are loaded
  6. /sys/bus/w1/devices/ is showing one sensor, but it is appears and disappears from time to time (seconds)
  7. reading the sensor gives bad CRC and strange temperature

What should I check and do to make the sensor work and read the temperature in Python?

EDIT: The script in Python 3 I am using:

#!/usr/bin/env python3
from w1thermsensor import W1ThermSensor

for sensor in W1ThermSensor.get_available_sensors():
    print("Sensor %s has temperature %.2f" % (sensor.id, sensor.get_temperature()))
pbies
  • 298
  • 5
  • 14

0 Answers0