I’m trying to set up a DS18B20 with klipper, on a Raspberry pi 2. I enabled the necessary under raspi-config, set the pin parameters in /boot/config.txt, fidgeted around a bit because the internal pullup resistor of the RPi isn’t suitable and I had to solder in a pullup resistor to the dataline. In the end, I could read the DS18B20 in linux (moonraker + fluidd) with a simple Python script.
When I try to read the sensor with klipper, it reports the probe as 0C. The manual (RPi_microcontroller.html) says that gpioinfo should have the DS18B20 pin as unclaimed, but it is not unclaimed actually:
" line 4: “GPIO_GCLK” “onewire@4” output active-high [used open-drain]"
I’m not too sure where to look now. I don’t think any other process would access the sensor.
When I try something like “rmmod w1_therm”, then klipper actually reports the correct temperature for a brief moment.
The DS18B20 module in Klipper only reads the Linux sysfs entry of the device as provided by the Kernel. The gpioinfo command does not play a role here, also not if the pin is already claimed or not. In fact it needs to show up.
What does:
ls /sys/bus/w1/devices
cat /sys/bus/w1/devices/YOUR_DS_HERE/w1_slave
Well, this looks good, so temperature should pop up in Klipper.
As stated before, Klipper does no black magic here but just grabs t=21875, divides it by 1000 and shows it.
Just make sure that your Python script or anything else is not holding a lock on /sys/bus/w1/devices/28-c6a69d1e64ff/w1_slave (maybe reboot your RPi)