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:
- issued commands:
apt install python-pip
,pip install w1thermsensor
to acccess sensor via Python - there was nothing in folder
/sys/bus/w1/devices/
- uncommented
intfc:dtoverlay=w1-gpio4-30
in/boot/hw_intfc.conf
to turn on the wire port in kernel - issued commands:
modprobe w1-gpio
,modprobe w1-therm
lsmod
shows thatwire
,w1_therm
andw1_gpio
are loaded/sys/bus/w1/devices/
is showing one sensor, but it is appears and disappears from time to time (seconds)- 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()))