Skip to content

Commit 58d2d92

Browse files
committed
Merge branch 'development'
2 parents 3b47d71 + 1388eb1 commit 58d2d92

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+7575
-1987
lines changed

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,15 @@ recipes/recipe/
4747

4848
backups/
4949

50-
bin/
50+
bin/
51+
settings-v1.8.0.json
52+
53+
include/
54+
55+
lib/
56+
57+
share/
58+
59+
lib64
60+
61+
pyvenv.cfg

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ I recommend at least taking a peek at the PiFire overview video below. It cover
8585

8686
[Link to our channel on YouTube](https://www.youtube.com/channel/UCYYs50U5QvHHhogx_rqs0Yg)
8787

88-
Here is a the latest version 2.0 of the hardware w/TFT screen and hardware buttons in a custom 3D printed enclosure. We've come a long way since v1.0.
88+
Pictured below is version 2.0 of the hardware w/TFT screen and hardware buttons in a custom 3D printed enclosure.
8989

9090
![Hardware v2](docs/photos/HW-V2-Display.jpg)
9191

92-
And if you're interested in seeing more builds from other users, we have a discussions thread [here](https://github.com/nebhead/PiFire/discussions/28) where others have posted pictures of their unique builds.
92+
And if you're interested in seeing more builds from other users, we have a discussions thread [here](https://github.com/nebhead/PiFire/discussions/28) or on [Discord](https://discord.gg/F9mbCrbrZS) (see below) where others have posted pictures of their unique builds.
9393

9494
## Full Documentation / Hardware and Software Installation
9595

@@ -109,12 +109,12 @@ I've added a discord server [here](https://discord.gg/F9mbCrbrZS) which can be a
109109
* 10/2022 - Release v1.3.5 - Bug fixes, feature refinements and brand new features galore in this latest release. Added a new ADS1115 module (using Adafruits Circuit Python), due to some reports of issues with the existing ADS1115 module. These can be optionally selected in the configuration wizard. PWM Fan Support and a boatload of code cleanup was introduced, thanks to contributor @weberbox. Support for saving cook files was introduced in this version, so that you can go back to older cooks, edit some of the information and add images and comments. Added a Prime Mode to allow you to prime the fire pot with pellets prior to a cook, and even prime & startup. Added estimated pellet usage to the pellet manager, which will attempt to track just how many pellets you have used since your last load of pellets. Added Apprise notification capability thanks to contributor @calonmerc. 320x200 displays have been update and added timers to specific modes. And even more!
110110
* 6/2023 - Release v1.5.0 - Arguably one of the biggest overhauls to PiFire since it's inception. The Probe system has been completely refactored to allow for multiple probe sensing devices (i.e. ADS1115, MAX31865, or even Virtual Probes to augment your inputs). This extension of the probe system, allows for any number of probe inputs to be tracked in PiFire, allowing from notifications and tracking of history for each probe. The sky is the limit! With this change the the probe architecture, a number of other things needed to be modified/updated, including the notification system, the history/charting, the dashboards, cookfiles and recipe modes. Note that if you are updating to this version, your settings will be upgraded in the process and you will not be able to roll back to a previous version (unless you restore from a backup of your settings).
111111
* 11/2023 - Release v1.6.0 - In this month comes another huge update with lots of new features and bug fixes. Many thanks to the users from discord that have been testing along the way (as well as submitting some bugs), what a great community we have! Many of these features have been deployed on our development branch for some time, so they should be relatively stable. Please do file issues on GitHub if you find any new bugs with the formal release. With that, enjoy and happy grilling/smoking!
112-
* **5/2024** - Release v1.7.0 - Lot's of new updates in this release with the UI, new features (i.e. exit startup temp, etc.) and new device support. Some improvements to the tuning tools (including an auto-tuning tool). Under the covers improvements for stability and cleanup. As usual, submit issues to GitHub if you run into anything. Enjoy!
113-
112+
* 5/2024 - Release v1.7.0 - Lot's of new updates in this release with the UI, new features (i.e. exit startup temp, etc.) and new device support. Some improvements to the tuning tools (including an auto-tuning tool). Under the covers improvements for stability and cleanup. As usual, submit issues to GitHub if you run into anything. Enjoy!
113+
* **9/2024 - Release v1.8.0** - Overhaul of the configuration wizard and underlying platform pin definitions to support board selection and configuration versus the platform selection that was previously provided. This allows much more flexibility when it comes to custom pinouts. This version now supports the PCB v4.x modular design allowing the ability to mix and match probe devices, relay/fan hardware, etc.
114114

115115
### Credits
116116

117-
Web Application created by Ben Parmeter, copyright 2020-2023. Check out my other projects on [github](https://github.com/nebhead). If you enjoy this software and feel the need to donate a cup of coffee, a frosty beer or a bottle of wine to the developer you can click [here](https://paypal.me/benparmeter).
117+
Web Application created by Ben Parmeter, copyright 2020-2024. Check out my other projects on [github](https://github.com/nebhead). If you enjoy this software and feel the need to donate a cup of coffee, a frosty beer or a bottle of wine to the developer you can click [here](https://paypal.me/benparmeter).
118118

119119
Of course, none of this project would be available without the wonderful and amazing folks below. If I forgot anyone please don't hesitate to let me know.
120120

app.py

Lines changed: 82 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def dash_config():
107107
dash_metadata = read_generic_json(f'./dashboard/{meta_data_filename}')
108108

109109
if request.method == 'GET':
110-
render_string = "{% from '_macro_dash_default.html' import render_config_card %}{{ render_config_card(dash_metadata, dash_data) }}"
110+
render_string = "{% from '_macro_generic_config.html' import render_dash_config_card %}{{ render_dash_config_card(dash_metadata, dash_data) }}"
111111
return render_template_string(render_string, dash_metadata=dash_metadata, dash_data=dash_data)
112112
elif request.method == 'POST':
113113
dash_config_request = request.form
@@ -958,11 +958,21 @@ def tuner_page(action=None):
958958

959959
data = read_autotune()
960960
if len(data) > 10:
961+
# If more than 10 datapoints, then calculate high / low / medium
961962
temp_list = []
962963
tr_list = []
963964
for datapoint in data:
964-
temp_list.append(datapoint['ref_T'])
965-
tr_list.append(datapoint['probe_Tr'])
965+
'''
966+
Check if the ref_T value is already in the list and overwrite if so.
967+
This assumes that the last temperature is the most recent and is likely
968+
the most accurate resistance value to take.
969+
'''
970+
if datapoint['ref_T'] in temp_list:
971+
index = temp_list.index(datapoint['ref_T'])
972+
tr_list[index] = datapoint['probe_Tr']
973+
else:
974+
temp_list.append(datapoint['ref_T'])
975+
tr_list.append(datapoint['probe_Tr'])
966976

967977
# Determine High Temp / Tr
968978
status_data['high_temp'] = max(temp_list)
@@ -1782,7 +1792,6 @@ def settings_page(action=None):
17821792
'name' : response['Name'],
17831793
'id' : UniqueID
17841794
}
1785-
print(f'Response: {response}')
17861795
if response.get('apply_profile', False):
17871796
probe_selected = response['apply_profile']
17881797
for index, probe in enumerate(settings['probe_settings']['probe_map']['probe_info']):
@@ -2366,7 +2375,6 @@ def admin_page(action=None):
23662375
if control['system']['cpu_throttled'] or control['system']['cpu_under_voltage']:
23672376
event = "CPU Throttled / Undervoltage event has occurred. Check your power supply for proper voltage."
23682377
errors.append(event)
2369-
print(event)
23702378

23712379
if 'check_cpu_temp' in supported_cmds:
23722380
process_command(action='sys', arglist=['check_cpu_temp'], origin='admin') # Request supported commands
@@ -2593,15 +2601,17 @@ def wizard(action=None):
25932601
section = r['section']
25942602
if section in ['grillplatform', 'display', 'distance']:
25952603
moduleData = wizardData['modules'][section][module]
2596-
moduleSettings = get_settings_dependencies_values(settings, moduleData)
2604+
moduleSettings = {}
2605+
moduleSettings['settings'] = get_settings_dependencies_values(settings, moduleData)
2606+
moduleSettings['config'] = {} if section != 'display' else settings['display']['config'][module]
25972607
render_string = "{% from '_macro_wizard_card.html' import render_wizard_card %}{{ render_wizard_card(moduleData, moduleSection, moduleSettings) }}"
25982608
return render_template_string(render_string, moduleData=moduleData, moduleSection=section, moduleSettings=moduleSettings)
25992609
else:
26002610
return '<strong color="red">No Data</strong>'
26012611

26022612
''' Create Temporary Probe Device/Port Structure for Setup, Use Existing unless First Time Setup '''
26032613
if settings['globals']['first_time_setup']:
2604-
wizardInstallInfo = wizardInstallInfoDefaults(wizardData)
2614+
wizardInstallInfo = wizardInstallInfoDefaults(wizardData, settings)
26052615
else:
26062616
wizardInstallInfo = wizardInstallInfoExisting(wizardData, settings)
26072617

@@ -2621,88 +2631,110 @@ def get_settings_dependencies_values(settings, moduleData):
26212631
for setting_name in setting_location:
26222632
setting_value = setting_value[setting_name]
26232633
moduleSettings[setting] = setting_value
2624-
print(moduleSettings)
26252634
return moduleSettings
26262635

2627-
def wizardInstallInfoDefaults(wizardData):
2636+
def wizardInstallInfoDefaults(wizardData, settings):
26282637

26292638
wizardInstallInfo = {
26302639
'modules' : {
26312640
'grillplatform' : {
2632-
'module_selected' : [],
2633-
'settings' : {}
2641+
'profile_selected' : [], # Reference the profile in wizardData > wizard_manifest.json
2642+
'settings' : {},
2643+
'config' : {}
26342644
},
26352645
'display' : {
2636-
'module_selected' : [],
2637-
'settings' : {}
2646+
'profile_selected' : [],
2647+
'settings' : {},
2648+
'config' : {}
26382649
},
26392650
'distance' : {
2640-
'module_selected' : [],
2641-
'settings' : {}
2651+
'profile_selected' : [],
2652+
'settings' : {},
2653+
'config' : {}
26422654
},
26432655
'probes' : {
2644-
'module_selected' : [],
2656+
'profile_selected' : [],
26452657
'settings' : {
26462658
'units' : 'F'
2647-
}
2659+
},
2660+
'config' : {}
26482661
}
26492662
},
2650-
'probe_map' : wizardData['boards']['PiFirev2x']['probe_map']
2663+
'probe_map' : {}
26512664
}
26522665
''' Populate Modules Info with Defaults from Wizard Data including Settings '''
26532666
for component in ['grillplatform', 'display', 'distance']:
26542667
for module in wizardData['modules'][component]:
26552668
if wizardData['modules'][component][module]['default']:
26562669
''' Populate Module Filename'''
2657-
wizardInstallInfo['modules'][component]['module_selected'].append(wizardData['modules'][component][module]['filename'])
2670+
wizardInstallInfo['modules'][component]['profile_selected'].append(module) #TODO: Change wizard.py to reference the module filename instead, or in grill_platform use platform>system_type
26582671
for setting in wizardData['modules'][component][module]['settings_dependencies']:
26592672
''' Populate all settings with default value '''
26602673
wizardInstallInfo['modules'][component]['settings'][setting] = list(wizardData['modules'][component][module]['settings_dependencies'][setting]['options'].keys())[0]
2674+
if module == 'display':
2675+
wizardInstallInfo['modules'][component]['config'] = settings['display']['config'][module]
2676+
2677+
''' Populate the default probe device / probe map from the default PCB Board '''
2678+
wizardInstallInfo['probe_map'] = wizardData['boards'][wizardInstallInfo['modules']['grillplatform']['profile_selected'][0]]['probe_map']
26612679

26622680
''' Populate Probes Module List with all configured probe devices '''
26632681
for device in wizardInstallInfo['probe_map']['probe_devices']:
2664-
wizardInstallInfo['modules']['probes']['module_selected'].append(device['module'])
2682+
wizardInstallInfo['modules']['probes']['profile_selected'].append(device['module'])
26652683

26662684
return wizardInstallInfo
26672685

26682686
def wizardInstallInfoExisting(wizardData, settings):
26692687
wizardInstallInfo = {
26702688
'modules' : {
26712689
'grillplatform' : {
2672-
'module_selected' : [settings['modules']['grillplat']],
2673-
'settings' : {}
2690+
'profile_selected' : [settings['platform']['current']],
2691+
'settings' : {},
2692+
'config' : {}
26742693
},
26752694
'display' : {
2676-
'module_selected' : [settings['modules']['display']],
2677-
'settings' : {}
2695+
'profile_selected' : [settings['modules']['display']],
2696+
'settings' : {},
2697+
'config' : {}
26782698
},
26792699
'distance' : {
2680-
'module_selected' : [settings['modules']['dist']],
2681-
'settings' : {}
2700+
'profile_selected' : [settings['modules']['dist']],
2701+
'settings' : {},
2702+
'config' : {}
26822703
},
26832704
'probes' : {
2684-
'module_selected' : [],
2705+
'profile_selected' : [],
26852706
'settings' : {
26862707
'units' : settings['globals']['units']
2687-
}
2708+
},
2709+
'config' : {}
26882710
}
26892711
},
26902712
'probe_map' : settings['probe_settings']['probe_map']
26912713
}
26922714
''' Populate Probes Module List with all configured probe devices '''
26932715
for device in wizardInstallInfo['probe_map']['probe_devices']:
2694-
wizardInstallInfo['modules']['probes']['module_selected'].append(device['module'])
2716+
wizardInstallInfo['modules']['probes']['profile_selected'].append(device['module'])
26952717

26962718
''' Populate Modules Info with current Settings '''
26972719
for module in ['grillplatform', 'display', 'distance']:
2698-
selected = wizardInstallInfo['modules'][module]['module_selected'][0]
2720+
selected = wizardInstallInfo['modules'][module]['profile_selected'][0]
2721+
''' Error condition if the item in settings doesn't match the wizard manifest '''
2722+
if selected not in wizardData['modules'][module].keys():
2723+
if module == 'grillplatform':
2724+
selected = 'custom'
2725+
settings['platform']['current'] = selected
2726+
else:
2727+
selected = 'none'
2728+
wizardInstallInfo['modules'][module]['profile_selected'] = selected
2729+
26992730
for setting in wizardData['modules'][module][selected]['settings_dependencies']:
27002731
settingsLocation = wizardData['modules'][module][selected]['settings_dependencies'][setting]['settings']
27012732
settingsValue = settings.copy()
27022733
for index in range(0, len(settingsLocation)):
27032734
settingsValue = settingsValue[settingsLocation[index]]
27042735
wizardInstallInfo['modules'][module]['settings'][setting] = str(settingsValue)
2705-
2736+
if module == 'display':
2737+
wizardInstallInfo['modules'][module]['config'] = settings['display']['config'][settings['modules']['display']]
27062738
return wizardInstallInfo
27072739

27082740
def prepare_wizard_data(form_data):
@@ -2712,27 +2744,31 @@ def prepare_wizard_data(form_data):
27122744

27132745
wizardInstallInfo['modules'] = {
27142746
'grillplatform' : {
2715-
'module_selected' : [form_data['grillplatformSelect']],
2716-
'settings' : {}
2747+
'profile_selected' : [form_data['grillplatformSelect']],
2748+
'settings' : {},
2749+
'config' : {}
27172750
},
27182751
'display' : {
2719-
'module_selected' : [form_data['displaySelect']],
2720-
'settings' : {}
2752+
'profile_selected' : [form_data['displaySelect']],
2753+
'settings' : {},
2754+
'config' : {}
27212755
},
27222756
'distance' : {
2723-
'module_selected' : [form_data['distanceSelect']],
2724-
'settings' : {}
2757+
'profile_selected' : [form_data['distanceSelect']],
2758+
'settings' : {},
2759+
'config' : {}
27252760
},
27262761
'probes' : {
2727-
'module_selected' : [],
2762+
'profile_selected' : [],
27282763
'settings' : {
27292764
'units' : form_data['probes_units']
2730-
}
2765+
},
2766+
'config' : {}
27312767
}
27322768
}
27332769

27342770
for device in wizardInstallInfo['probe_map']['probe_devices']:
2735-
wizardInstallInfo['modules']['probes']['module_selected'].append(device['module'])
2771+
wizardInstallInfo['modules']['probes']['profile_selected'].append(device['module'])
27362772

27372773
for module in ['grillplatform', 'display', 'distance']:
27382774
module_ = module + '_'
@@ -2742,6 +2778,9 @@ def prepare_wizard_data(form_data):
27422778
settingName = module_ + setting
27432779
if(settingName in form_data):
27442780
wizardInstallInfo['modules'][module]['settings'][setting] = form_data[settingName]
2781+
for config, value in form_data.items():
2782+
if config.startswith(module_ + 'config_'):
2783+
wizardInstallInfo['modules'][module]['config'][config.replace(module_ + 'config_', '')] = value
27452784

27462785
return(wizardInstallInfo)
27472786

@@ -3702,9 +3741,9 @@ def get_app_data(action=None, type=None):
37023741
'cpuinfo' : os.popen('cat /proc/cpuinfo').readlines(),
37033742
'ifconfig' : os.popen('ifconfig').readlines(),
37043743
'temp' : _check_cpu_temp(),
3705-
'outpins' : settings['outpins'],
3706-
'inpins' : settings['inpins'],
3707-
'dev_pins' : settings['dev_pins'],
3744+
'outpins' : settings['platform']['outputs'],
3745+
'inpins' : settings['platform']['inputs'],
3746+
'dev_pins' : settings['platform']['devices'],
37083747
'server_version' : settings['versions']['server'],
37093748
'server_build' : settings['versions']['build'] }
37103749

auto-install/install.sh

Lines changed: 12 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,17 @@ echo "** Cloning PiFire from GitHub... **"
8181
echo "** **"
8282
echo "*************************************************************************"
8383
cd /usr/local/bin
84-
# Use a shallow clone to reduce download size
85-
$SUDO git clone --depth 1 https://github.com/nebhead/pifire
86-
# Replace the below command to fetch development branch
87-
#$SUDO git clone --depth 1 --branch development https://github.com/nebhead/pifire
84+
85+
# Check if -dev option is used
86+
if [ "$1" = "-dev" ]; then
87+
echo "Cloning development branch..."
88+
# Replace the below command to fetch development branch
89+
$SUDO git clone --depth 1 --branch development https://github.com/nebhead/pifire
90+
else
91+
echo "Cloning main branch..."
92+
# Use a shallow clone to reduce download size
93+
$SUDO git clone --depth 1 https://github.com/nebhead/pifire
94+
fi
8895

8996
# Setup Python VENV & Install Python dependencies
9097
clear
@@ -113,59 +120,14 @@ source bin/activate
113120

114121
echo " - Installing module dependencies... "
115122
# Install module dependencies
116-
python -m pip install "flask==2.3.3"
117-
python -m pip install flask-mobility
118-
python -m pip install flask-qrcode
119-
python -m pip install flask-socketio
120123
if ! python -c "import sys; assert sys.version_info[:2] >= (3,11)" > /dev/null; then
121124
echo "System is running a python version lower than 3.11, installing eventlet==0.30.2";
122125
python -m pip install "eventlet==0.30.2"
123126
else
124127
echo "System is running a python version 3.11 or greater, installing latest eventlet"
125128
python -m pip install eventlet
126129
fi
127-
python -m pip install gunicorn
128-
python -m pip install gpiozero
129-
python -m pip install redis
130-
python -m pip install uuid
131-
python -m pip install influxdb-client[ciso]
132-
python -m pip install apprise
133-
python -m pip install scikit-fuzzy
134-
python -m pip install "scikit-learn==1.4.2"
135-
python -m pip install ratelimitingfilter
136-
python -m pip install "pillow>=9.2.0"
137-
python -m pip install paho-mqtt
138-
python -m pip install psutil
139-
140-
# Setup config.txt to enable busses
141-
clear
142-
echo "*************************************************************************"
143-
echo "** **"
144-
echo "** Configuring config.txt **"
145-
echo "** **"
146-
echo "*************************************************************************"
147-
148-
# Enable SPI - Needed for some displays
149-
$SUDO raspi-config nonint do_spi 0
150-
151-
# Enable I2C - Needed for some displays, ADCs, distance sensors
152-
$SUDO raspi-config nonint do_i2c 0
153-
154-
# Enable Hardware PWM - Needed for hardware PWM support
155-
if test -f /boot/firmware/config.txt; then
156-
echo "dtoverlay=pwm,gpiopin=13,func=4" | $SUDO tee -a /boot/firmware/config.txt > /dev/null
157-
else
158-
echo "dtoverlay=pwm,gpiopin=13,func=4" | $SUDO tee -a /boot/config.txt > /dev/null
159-
fi
160-
161-
# Setup backlight / power permissions if a DSI screen is installed
162-
clear
163-
echo "*************************************************************************"
164-
echo "** **"
165-
echo "** Configuring Backlight UDEV Rules **"
166-
echo "** **"
167-
echo "*************************************************************************"
168-
echo 'SUBSYSTEM=="backlight",RUN+="/bin/chmod 666 /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power"' | $SUDO tee -a /etc/udev/rules.d/backlight-permissions.rules > /dev/null
130+
python -m pip install -r /usr/local/bin/pifire/auto-install/requirements.txt
169131

170132
### Setup nginx to proxy to gunicorn
171133
clear

0 commit comments

Comments
 (0)