- sudo modprobe w1-gpio
- sudo modprobe w1-therm
- cd /sys/bus/w1/devices
- cd 28-xxxx (change this to match what serial number pops up)
- cat w1_slave
The interface is a little unreliable, but fortunately it tells us if there is a valid temperature to read. It’s like a file, so all we have to do is read
The response will either have YES or NO at the end of the first line. If it is yes, then the temperature will be at the end of the second line, in 1/000 degrees C. So, in the example above, the temperature is actually read as 20.687 and then 26.125 degrees C.
If you have more than one Sensor connected, you’ll see multiple 28-xxx files. Each one will have the unique serial number so you may want to plug one in at a time, look at what file is created, and label the sensor!