Update pushbutton.py changed to hotspot_default

pull/442/head
Alan Johnston 2 months ago committed by GitHub
parent 1ecf2d5261
commit 115685e0ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -12,7 +12,7 @@ import configparser
def read_config_ini():
global hotspot_ssid
global hotspot_password
global hotspot_always_on
global hotspot_default
global web_term_hotspot
global web_term_wifi
# global dashboard_port
@ -26,7 +26,7 @@ def read_config_ini():
# Access the values like a dictionary
hotspot_ssid = config['Hotspot']['hotspot_ssid']
hotspot_password = config['Hotspot']['hotspot_password']
hotspot_always_on = config['Hotspot']['hotspot_hotspot_always_on']
hotspot_default = config['Hotspot']['hotspot_default']
web_term_hotspot = config['Hotspot']['web_term_hotspot']
web_term_wifi = config['Hotspot']['web_term_wifi']
# dashboard_port = config.getint('Hotspot', 'dashboard_port')
@ -38,7 +38,7 @@ def read_config_ini():
print(" failed, setting defaults")
hotspot_ssid = "CubeSat"
hotspot_password = "amsatcubesat"
hotspot_always_on = "no"
hotspot_default = "no"
web_term_hotspot = "yes"
web_term_wifi = "no"
# dashboard_port = 80
@ -162,7 +162,7 @@ GPIO.output(powerPin, 0)
GPIO.setup(push_button, GPIO.IN, pull_up_down=GPIO.PUD_UP)
read_config_ini()
if not GPIO.input(push_button) or hotspot_always_on == "yes": # if pushbutton is held down during boot or configured always on
if not GPIO.input(push_button) or hotspot_default == "yes": # if pushbutton is held down during boot or configured as default
print("Activating WiFi access point!", flush=True)
GPIO.output(powerPin, 1)
sleep(0.1)

Loading…
Cancel
Save

Powered by TurnKey Linux.