diff --git a/docs/source/build_guide.rst b/docs/source/build_guide.rst index b87a4a45..b436d7b6 100644 --- a/docs/source/build_guide.rst +++ b/docs/source/build_guide.rst @@ -268,7 +268,7 @@ Printing These pieces will print without supports in the orientation shown in the photos. I use 3 perimeter layers and 15% infill, but the pieces are not large and don't need to handle heavy forces so almost any print settings should work. -You will want to consider using a material other than PLA, as your PiFinder is likely to experience some sunlight in it's lifetime and PLA degrades under moderate heat and UV. PETG or some co-polymer like NGen would be a good choice. Prusamint Galaxy PETG is the official PiFinder filament and is pictured in most of the build guide, except where grey provided needed contrast. +You will want to consider using a material other than PLA, as your PiFinder is likely to experience some sunlight in it's lifetime and PLA degrades under moderate heat and UV. PETG or some co-polymer like NGen would be a good choice. Prusament Galaxy PETG is the official PiFinder filament and is pictured in most of the build guide, except where grey provided needed contrast. Inserts ------- diff --git a/python/PiFinder/server.py b/python/PiFinder/server.py index c1e36a60..fc51111a 100644 --- a/python/PiFinder/server.py +++ b/python/PiFinder/server.py @@ -20,7 +20,12 @@ from PIL import Image from PiFinder.keyboard_interface import KeyboardInterface -from PiFinder import sys_utils, utils, calc_utils + +try: + from PiFinder import sys_utils +except ImportError: + from PiFinder import sys_utils_fake as sys_utils +from PiFinder import utils, calc_utils from PiFinder.db.observations_db import ( ObservationsDatabase, ) @@ -152,6 +157,13 @@ def remote(): "remote", ) + @app.route("/advanced") + @auth_required + def advanced(): + return template( + "advanced", + ) + @app.route("/network") @auth_required def network_page(): @@ -354,12 +366,14 @@ def gps_lock(): }, ) self.gps_queue.put(msg) + logging.debug("Putting location msg on gps_queue") @app.route("/time-lock") @auth_required def time_lock(): msg = ("time", datetime.datetime.now()) self.gps_queue.put(msg) + logging.debug("Putting time msg on gps_queue") # If the PiFinder software is running as a service # it can grab port 80. If not, it needs to use 8080 diff --git a/python/PiFinder/sys_utils_fake.py b/python/PiFinder/sys_utils_fake.py new file mode 100644 index 00000000..501884ca --- /dev/null +++ b/python/PiFinder/sys_utils_fake.py @@ -0,0 +1,153 @@ +import glob +import sh +import socket +from PiFinder import utils + +BACKUP_PATH = "/home/pifinder/PiFinder_data/PiFinder_backup.zip" + + +class Network: + """ + Provides wifi network info + """ + + def __init__(self): + pass + + def populate_wifi_networks(self): + """ + Parses wpa_supplicant.conf to get current config + """ + pass + + def get_wifi_networks(self): + return "" + + def delete_wifi_network(self, network_id): + """ + Immediately deletes a wifi network + """ + pass + + def add_wifi_network(self, ssid, key_mgmt, psk=None): + """ + Add a wifi network + """ + pass + + def get_ap_name(self): + return "UNKN" + + def set_ap_name(self, ap_name): + pass + + def get_host_name(self): + return socket.gethostname() + + def get_connected_ssid(self): + """ + Returns the SSID of the connected wifi network or + None if not connected or in AP mode + """ + return "UNKN" + + def set_host_name(self, hostname): + if hostname == self.get_host_name(): + return + result = "UNKN" + + def wifi_mode(self): + return "UNKN" + + def set_wifi_mode(self, mode): + pass + + def local_ip(self): + return "NONE" + + +def remove_backup(): + """ + Removes backup file + """ + pass + + +def backup_userdata(): + """ + Back up userdata to a single zip file for later + restore. Returns the path to the zip file. + + Backs up: + config.json + observations.db + obslist/* + """ + return BACKUP_PATH + + +def restore_userdata(zip_path): + """ + Compliment to backup_userdata + restores userdata + OVERWRITES existing data! + """ + pass + + +def shutdown(): + """ + shuts down the Pi + """ + print("SYS: Initiating Shutdown") + return True + + +def update_software(): + """ + Uses systemctl to git pull and then restart + service + """ + print("SYS: Running update") + return True + + +def restart_pifinder(): + """ + Uses systemctl to restart the PiFinder + service + """ + print("SYS: Restarting PiFinder") + return True + + +def restart_system(): + """ + Restarts the system + """ + print("SYS: Initiating System Restart") + + +def go_wifi_ap(): + print("SYS: Switching to AP") + return True + + +def go_wifi_cli(): + print("SYS: Switching to Client") + return True + + +def verify_password(username, password): + """ + Checks the provided password against the provided user + password + """ + return True + + +def change_password(username, current_password, new_password): + """ + Changes the PiFinder User password + """ + return False diff --git a/python/PiFinder/ui/status.py b/python/PiFinder/ui/status.py index b2a17ae7..341323c3 100644 --- a/python/PiFinder/ui/status.py +++ b/python/PiFinder/ui/status.py @@ -9,7 +9,11 @@ import socket from PiFinder.ui.base import UIModule -from PiFinder import sys_utils + +try: + from PiFinder import sys_utils +except ImportError: + from PiFinder import sys_utils_fake as sys_utils from PiFinder import calc_utils from PiFinder import utils from PiFinder.ui.ui_utils import TextLayouter, SpaceCalculatorFixed diff --git a/python/views/advanced.tpl b/python/views/advanced.tpl new file mode 100644 index 00000000..b4b5595a --- /dev/null +++ b/python/views/advanced.tpl @@ -0,0 +1,31 @@ +% include("header.tpl", title="Advanced") + +
+
+
+ + +
+
+
+
+ + +% include("footer.tpl", title="PiFinder UI") +