Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added navigation to settings page. Fix card/column spacing on updater and pellets page. #91

Merged
merged 1 commit into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# *****************************************

from flask import Flask, request, abort, render_template, make_response, send_file, jsonify, redirect
from flask_mobility import Mobility
from flask_socketio import SocketIO
from flask_qrcode import QRcode
from werkzeug.utils import secure_filename
Expand All @@ -35,6 +36,7 @@
app = Flask(__name__)
socketio = SocketIO(app, cors_allowed_origins="*")
QRcode(app)
Mobility(app)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER

@app.route('/')
Expand Down
3 changes: 2 additions & 1 deletion auto-install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ echo "*************************************************************************"
$SUDO apt install python3-dev python3-pip python3-rpi.gpio python3-pil libfreetype6-dev libjpeg-dev build-essential libopenjp2-7 libtiff5 nginx git gunicorn3 supervisor ttf-mscorefonts-installer redis-server -y
$SUDO pip3 install flask
$SUDO pip3 install pushbullet.py
$SUDO pip3 install flask_qrcode
$SUDO pip3 install flask-mobility
$SUDO pip3 install flask-qrcode
$SUDO pip3 install flask-socketio
$SUDO pip3 install eventlet==0.30.2
$SUDO pip3 install gpiozero
Expand Down
5 changes: 3 additions & 2 deletions installer/debian/other/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ whiptail --msgbox --backtitle "Welcome" --title "PiFire Automated Installer" "Th
# Install dependencies
sudo -H pip3 install flask
sudo -H pip3 install pushbullet.py
sudo -H pip3 install flask_qrcode
sudo -H pip3 install flask-mobility
sudo -H pip3 install flask-qrcode
sudo -H pip3 install flask-socketio
sudo -H pip3 install eventlet==0.30.2
sudo -H pip3 install redis
Expand Down Expand Up @@ -76,6 +77,6 @@ python3 settings.py -v @VERSION@
echo " " | sudo tee -a upgradecheck >/dev/null

# Finish
whiptail --msgbox --backtitle "Install Complete / Reboot Required" --title "Installation Completed" "Congratulations, the installation is complete. At this time, you should reboot your system to complete the installation. You should be able to access your application by opening a browser on your PC or other device and using the IP address for this device Enjoy!" ${r} ${c}
whiptail --msgbox --backtitle "Install Complete / Reboot Required" --title "Installation Completed" "Congratulations, the installation is complete. At this time, you should reboot your system to complete the installation. On first boot, the wizard will guide you through the remaining setup steps. You should be able to access your application by opening a browser on your PC or other device and using the IP address for this device. Enjoy!" ${r} ${c}

exit 0
133 changes: 4 additions & 129 deletions installer/debian/rpi/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ whiptail --msgbox --backtitle "Welcome" --title "PiFire Automated Installer" "Th
# Install dependencies
sudo -H pip3 install flask
sudo -H pip3 install pushbullet.py
sudo -H pip3 install flask_qrcode
sudo -H pip3 install flask-mobility
sudo -H pip3 install flask-qrcode
sudo -H pip3 install flask-socketio
sudo -H pip3 install eventlet==0.30.2
sudo -H pip3 install gpiozero
Expand Down Expand Up @@ -70,138 +71,12 @@ fi
# If supervisor isn't already running, startup Supervisor
service supervisor restart

### Setup modules

cd /usr/local/bin/pifire || exit 1 # Change dir to where the settings.py application is (and common.py)

GRILLPLAT=$(whiptail --title "Select your Grill Platform module to use." --radiolist "Select the Grill Platform module for PiFire to use. This module initializes GPIOs to control input / output to Grill Platform components like the fan, auger, igniter, etc." 20 78 2 "PIFIRE" "Standard Rasperry Pi <- DEFAULT" ON "PROTOTYPE" "Prototype - Not Platform Dependant (for test only)" OFF 3>&1 1>&2 2>&3)

if [[ $GRILLPLAT = "PIFIRE" ]]; then
python3 settings.py -g pifire
TRIGGERLEVEL=$(whiptail --title "Set the Trigger Level" --radiolist "Select your relay's trigger level. (Trigger level High or trigger Low)" 20 78 2 "LOW" "Active Low/Trigger Low" ON "HIGH" "Active High/Trigger High" OFF 3>&1 1>&2 2>&3)
if [[ $TRIGGERLEVEL = "LOW" ]]; then
python3 settings.py -t LOW
fi
if [[ $TRIGGERLEVEL = "HIGH" ]]; then
python3 settings.py -t HIGH
fi
fi

if [[ $GRILLPLAT = "PROTOTYPE" ]]; then
python3 settings.py -g prototype
fi

ADC=$(whiptail --title "Select your ADC module to use." --radiolist "This module gets temperature data from the attached probes such as the RTD Grill Probe, the food probes, etc." 20 78 2 "ADS1115" "Standard ADC <- Default" ON "PROTOTYPE" "Prototype/Simulated (for test only)" OFF 3>&1 1>&2 2>&3)

if [[ $ADC = "ADS1115" ]]; then
python3 settings.py -a ads1115
sudo -H pip3 install ADS1115
fi

if [[ $ADC == "PROTOTYPE" ]]; then
python3 settings.py -a prototype
fi

UNITS=$(whiptail --title "Select Temperature Units." --radiolist "Select the temperature units to use globally. (this can be changed later)" 20 78 2 "F" "Fahrenheit <- Default" ON "C" "Celsius" OFF 3>&1 1>&2 2>&3)

if [[ $UNITS = "F" ]];then
python3 settings.py -u F
fi

if [[ $UNITS = "C" ]];then
python3 settings.py -u C
fi

DISPLAY=$(whiptail --title "Select your Display module to use." --radiolist "Select display type (and input) module for PiFire to use. Some displays may also have menu button functions indicated by a B appended to the name." 20 78 8 "SSD1306" "OLED Display (128x64) <- DEFAULT" ON "SSD1306B" "OLED Display (128x64) w/Button Input" OFF "ST7789P" "IPS/TFT SPI Display (240x240)P-Pimoroni Libs" OFF "ILI9341" "TFT Color Display (240x320)" OFF "ILI9341B" "TFT Color Display (240x320) w/Buttons" OFF "PROTOTYPE" "Prototype/Console Output (for test only)" OFF "PYGAME" "Prototype/PyGame Desktop Output (for test only)" OFF "PYGAME240320" "Prototype/PyGame (240x320) (for test only)" OFF "PYGAME240320B" "Prototype/PyGame B(240x320) (for test only)" OFF "PYGAME64128" "Prototype/PyGame (64x128) (for test only)" OFF 3>&1 1>&2 2>&3)

if [[ $DISPLAY = "SSD1306" ]]; then
python3 settings.py -d ssd1306
sudo -H pip3 install luma.oled
fi

if [[ $DISPLAY = "SSD1306B" ]]; then
python3 settings.py -d ssd1306b
sudo -H pip3 install luma.oled
BUTTONSLEVEL=$(whiptail --title "Set the Button Level" --radiolist "Select how your button hardware is configured. (HIGH - Pullups, LOW - Pulldowns)" 20 78 2 "LOW" "Pulldowns" OFF "HIGH" "Pullups" ON 3>&1 1>&2 2>&3)
if [[ $BUTTONSLEVEL = "LOW" ]]; then
python3 settings.py -b LOW
fi
if [[ $BUTTONSLEVEL = "HIGH" ]]; then
python3 settings.py -b HIGH
fi
fi

if [[ $DISPLAY = "ST7789P" ]]; then
python3 settings.py -d st7789p
echo "dtparam=spi=on" | sudo tee -a /boot/config.txt > /dev/null
sudo -H pip3 install st7789
fi

if [[ $DISPLAY = "ILI9341" ]]; then
python3 settings.py -d ili9341
echo "dtparam=spi=on" | sudo tee -a /boot/config.txt > /dev/null
sudo -H pip3 install luma.lcd
fi

if [[ $DISPLAY = "ILI9341B" ]]; then
python3 settings.py -d ili9341b
echo "dtparam=spi=on" | sudo tee -a /boot/config.txt > /dev/null
sudo -H pip3 install luma.lcd
BUTTONSLEVEL=$(whiptail --title "Set the Button Level" --radiolist "Select how your button hardware is configured. (HIGH - Pullups, LOW - Pulldowns)" 20 78 2 "LOW" "Pulldowns" ON "HIGH" "Pullups" OFF 3>&1 1>&2 2>&3)
if [[ $BUTTONSLEVEL = "LOW" ]]; then
python3 settings.py -b LOW
fi
if [[ $BUTTONSLEVEL = "HIGH" ]]; then
python3 settings.py -b HIGH
fi
fi

if [[ $DISPLAY = "PROTOTYPE" ]]; then
python3 settings.py -d prototype
fi

if [[ $DISPLAY = "PYGAME" ]]; then
python3 settings.py -d pygame
sudo -H pip3 install pygame
fi

if [[ $DISPLAY = "PYGAME240320" ]]; then
python3 settings.py -d pygame_240x320
sudo -H pip3 install pygame
fi

if [[ $DISPLAY = "PYGAME240320B" ]]; then
python3 settings.py -d pygame_240x320b
sudo -H pip3 install pygame
fi

if [[ $DISPLAY = "PYGAME64128" ]];then
python3 settings.py -d pygame_64x128
sudo -H pip3 install pygame
fi

DIST=$(whiptail --title "Select your Range module to use." --radiolist "Optional distance sensor for hopper/pellet level reporting. Default is prototype/none, which is equivalent to no attached sensor." 20 78 3 "PROTOTYPE" "Prototype/None <- DEFAULT" ON "VL53L0X" "Time of Flight Light Range Sensor" OFF "HCSR04" "Ultrasonic Range Sensor" OFF 3>&1 1>&2 2>&3)

if [[ $DIST = "VL53L0X" ]]; then
python3 settings.py -r vl53l0x
sudo -H pip3 install git+https://github.com/pimoroni/VL53L0X-python.git
fi

if [[ $DIST = "HCSR04" ]]; then
python3 settings.py -r hcsr04
sudo -H pip3 install hcsr04sensor
fi

if [[ $DIST = "PROTOTYPE" ]]; then
python3 settings.py -r prototype
fi

## Update settings server version
python3 settings.py -v @VERSION@

echo " " | sudo tee -a upgradecheck >/dev/null

# Finished
whiptail --msgbox --backtitle "Install Complete / Reboot Required" --title "Installation Completed" "Congratulations, the installation is complete. At this time, you should reboot your system to complete the installation. You should be able to access your application by opening a browser on your PC or other device and using the IP address for this Pi. Enjoy!" ${r} ${c}
# Finish
whiptail --msgbox --backtitle "Install Complete / Reboot Required" --title "Installation Completed" "Congratulations, the installation is complete. At this time, you should reboot your system to complete the installation. On first boot, the wizard will guide you through the remaining setup steps. You should be able to access your application by opening a browser on your PC or other device and using the IP address for this Pi. Enjoy!" ${r} ${c}

exit 0
Loading