One thing I’ve forgot:
file /boot/hw_intfc.conf
should have an uncommented line(s):
# Add w1 on GPIO4_D6 to support devices such as DS18B20.
intfc:dtoverlay=w1-gpio4-30
But it still does not work.
Left = ground to 39
Middle = data to 37
Right = vcc to 1 or 2
Changed resistor and sensor appeared in /sys/bus/w1/devices/
. Seems like resistor was faulty. But its serial number is strange and does not return correct data (CRC error).
EDIT: ok, it works from time to time:
[0][09:53][root@rock][/sys/bus/w1/devices/28-01186bce26ff] $ cat w1_slave
85 01 4b 46 7f ff 0c 10 31 : crc=31 YES
85 01 4b 46 7f ff 0c 10 31 t=24312
However Python script says:
w1thermsensor.errors.SensorNotReadyError: Sensor 01186bce26ff is not yet ready to read temperature
Sensor sometimes appear in the folder and when appear it gives correct or incorrect data. Don’t know why it disappears and why gives bad data…