updating variable names
Updating SSID and PW variables for match settings dot toml example
This commit is contained in:
parent
f28beb6229
commit
55054a3838
5 changed files with 5 additions and 5 deletions
|
|
@ -14,7 +14,7 @@ import adafruit_requests
|
|||
hashtag = "CircuitPython"
|
||||
|
||||
# connect to SSID
|
||||
wifi.radio.connect(os.getenv('WIFI_SSID'), os.getenv('WIFI_PASSWORD'))
|
||||
wifi.radio.connect(os.getenv('CIRCUITPY_WIFI_SSID'), os.getenv('CIRCUITPY_WIFI_PASSWORD'))
|
||||
|
||||
# add your mastodon token as 'mastodon_token' to your settings.toml file
|
||||
headers = {'Authorization': 'Bearer ' + os.getenv('mastodon_token') + 'read:statuses'}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ headers = {'Authorization': 'Bearer ' + os.getenv('mastodon_token')}
|
|||
url = 'https://' + os.getenv('mastodon_host') + '/api/v1/statuses'
|
||||
|
||||
# connect to SSID
|
||||
wifi.radio.connect(os.getenv('WIFI_SSID'), os.getenv('WIFI_PASSWORD'))
|
||||
wifi.radio.connect(os.getenv('CIRCUITPY_WIFI_SSID'), os.getenv('CIRCUITPY_WIFI_PASSWORD'))
|
||||
|
||||
pool = socketpool.SocketPool(wifi.radio)
|
||||
requests = adafruit_requests.Session(pool, ssl.create_default_context())
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ weather_url += "latitude=%d&longitude=%d&timezone=auto" % (lat, long)
|
|||
weather_url += "¤t_weather=true&temperature_unit=%s&windspeed_unit=mph" % temperature_unit
|
||||
|
||||
# connect to SSID
|
||||
wifi.radio.connect(os.getenv('WIFI_SSID'), os.getenv('WIFI_PASSWORD'))
|
||||
wifi.radio.connect(os.getenv('CIRCUITPY_WIFI_SSID'), os.getenv('CIRCUITPY_WIFI_PASSWORD'))
|
||||
|
||||
pool = socketpool.SocketPool(wifi.radio)
|
||||
requests = adafruit_requests.Session(pool, ssl.create_default_context())
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ netmask = ipaddress.IPv4Address("255.255.255.0")
|
|||
gateway = ipaddress.IPv4Address("192.168.1.1")
|
||||
wifi.radio.set_ipv4_address(ipv4=ipv4,netmask=netmask,gateway=gateway)
|
||||
# connect to your SSID
|
||||
wifi.radio.connect(os.getenv('WIFI_SSID'), os.getenv('WIFI_PASSWORD'))
|
||||
wifi.radio.connect(os.getenv('CIRCUITPY_WIFI_SSID'), os.getenv('CIRCUITPY_WIFI_PASSWORD'))
|
||||
|
||||
print("Connected to WiFi")
|
||||
pool = socketpool.SocketPool(wifi.radio)
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ def reset_on_error(delay, error):
|
|||
|
||||
|
||||
try:
|
||||
wifi.radio.connect(os.getenv("WIFI_SSID"), os.getenv("WIFI_PASSWORD"))
|
||||
wifi.radio.connect(os.getenv("CIRCUITPY_WIFI_SSID"), os.getenv("CIRCUITPY_WIFI_PASSWORD"))
|
||||
# any errors, reset MCU
|
||||
except Exception as e: # pylint: disable=broad-except
|
||||
reset_on_error(10, e)
|
||||
|
|
|
|||
Loading…
Reference in a new issue