Klipper3d / klipper

Klipper is a 3d-printer firmware
GNU General Public License v3.0
9.51k stars 5.32k forks source link

temperature_host abort on read error #4294

Closed TheJoshW closed 3 years ago

TheJoshW commented 3 years ago

Hi, I am using a [temperature_host enclosure_temp] section to read temperatures from a DHT22 sensor attached to the Pi. I have configured it in the following way:

  1. Add dtoverlay=dht11,gpiopin=23 to /boot/config.txt
  2. Add the following to printer.cfg:
    
    [temperature_sensor enclosure_temp]
    sensor_type: temperature_host
    sensor_path: /sys/bus/iio/devices/iio:device0/in_temp_input

[temperature_sensor enclosure_hum] sensor_type: temperature_host sensor_path: /sys/bus/iio/devices/iio:device0/in_humidityrelative_input



This all works fine, except the DHT22 is known to be flakey and sometimes needs to be read a couple of times to get a value.
`temperature_host.py` doesn't like this and stops polling the sensor if it gets a read error.

Is it possible to make it retry X times, or continue polling if it gets a read error?
Another minor issue is I am reading the humidity as a temperature, so if this can be fixed as well, great.
[klippy.log](https://github.com/KevinOConnor/klipper/files/6488731/klippy.log)
KevinOConnor commented 3 years ago

The temperature_host module isn't suitable to use with the DHT22 - it's only intended to monitor the temperature of builtin cpu sensors. Best to ask on Discord or Discourse for alternatives as we don't use github to diagnose problems with individual printers.

-Kevin

github-actions[bot] commented 3 years ago

It looks like this ticket is a request for help (or similar). Many helpful people will not see your message here and you are unlikely to get a useful response. Please close this ticket and follow the contact directions at: https://www.klipper3d.org/Contact.html

We use github to share the results of work done to improve Klipper. We don't use github for requests. (In particular, we don't use github for feature requests, to answer questions, nor to help diagnose problems with a printer.)

Please follow the directions at: https://www.klipper3d.org/Contact.html

This ticket will be automatically closed.

Best regards, ~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.