nebhead / PiFire

PiFire is a Smart WiFi enabled controller for your pellet smoker / grill.
https://nebhead.github.io/PiFire-Pages
MIT License
82 stars 32 forks source link

enabled support for probe mapping and max31865 #72

Closed lausdahl closed 2 years ago

lausdahl commented 2 years ago

This adds support for probe mapping and a new type max31865. While I didnt touch any of the control code this simply allows the user to configure the systems 3 types: Grill, Probe1, Probe2. The default mapping is:

System                   Source
------------------------
Grill        <-      ADC0
Probe1       <-      ADC1
Probe2       <-      ADC2
-------------------------

alternative it can be configured like switching the ADC index between Grill and Probe2

System                   Source
------------------------
Grill         <-      ADC2
Probe1        <-      ADC1
Probe2        <-      ADC0
-------------------------

however the reason for adding the mapping is to allow other sources

System                   Source
------------------------
Grill        <-      max31865
Probe1       <-      ADC1
Probe2       <-      ADC2
-------------------------

The max31865 driver is set to spi device 2.

If this is merged it may be worth simplifying the ADC driver to just use ADC0-3 when reporting the values.

settings looks like this if max31865 is used for grill

  "probe_settings": {
    ....
    "probes_enabled": [
      1,
      1,
      1
    ],
    "probe_sources": ["max31865","ADC1","ADC2"]
  },
...
nebhead commented 2 years ago

This is an awesome change, thank you for submitting the pull request! The max31865 has been a requested feature for a while, but I hadn't gotten around to purchasing one to play with. So thank you again for this! Also, this is great solution to re-map the inputs. I think this would be good for expanding to more input sources as well.