File tree Expand file tree Collapse file tree
CircuitPython_Mastodon_API_Examples
NeoPixel_Sprite_Weather_Display
PicoW_CircuitPython_HTTP_Server
Scrolling_Alphanumeric_Countdown_Clock Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414hashtag = "CircuitPython"
1515
1616# connect to SSID
17- wifi .radio .connect (os .getenv ('WIFI_SSID ' ), os .getenv ('WIFI_PASSWORD ' ))
17+ wifi .radio .connect (os .getenv ('CIRCUITPY_WIFI_SSID ' ), os .getenv ('CIRCUITPY_WIFI_PASSWORD ' ))
1818
1919# add your mastodon token as 'mastodon_token' to your settings.toml file
2020headers = {'Authorization' : 'Bearer ' + os .getenv ('mastodon_token' ) + 'read:statuses' }
Original file line number Diff line number Diff line change 1414url = 'https://' + os .getenv ('mastodon_host' ) + '/api/v1/statuses'
1515
1616# connect to SSID
17- wifi .radio .connect (os .getenv ('WIFI_SSID ' ), os .getenv ('WIFI_PASSWORD ' ))
17+ wifi .radio .connect (os .getenv ('CIRCUITPY_WIFI_SSID ' ), os .getenv ('CIRCUITPY_WIFI_PASSWORD ' ))
1818
1919pool = socketpool .SocketPool (wifi .radio )
2020requests = adafruit_requests .Session (pool , ssl .create_default_context ())
Original file line number Diff line number Diff line change 4343weather_url += "¤t_weather=true&temperature_unit=%s&windspeed_unit=mph" % temperature_unit
4444
4545# connect to SSID
46- wifi .radio .connect (os .getenv ('WIFI_SSID ' ), os .getenv ('WIFI_PASSWORD ' ))
46+ wifi .radio .connect (os .getenv ('CIRCUITPY_WIFI_SSID ' ), os .getenv ('CIRCUITPY_WIFI_PASSWORD ' ))
4747
4848pool = socketpool .SocketPool (wifi .radio )
4949requests = adafruit_requests .Session (pool , ssl .create_default_context ())
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ def c_to_f(temp):
7575gateway = ipaddress .IPv4Address ("192.168.1.1" )
7676wifi .radio .set_ipv4_address (ipv4 = ipv4 ,netmask = netmask ,gateway = gateway )
7777# connect to your SSID
78- wifi .radio .connect (os .getenv ('WIFI_SSID ' ), os .getenv ('WIFI_PASSWORD ' ))
78+ wifi .radio .connect (os .getenv ('CIRCUITPY_WIFI_SSID ' ), os .getenv ('CIRCUITPY_WIFI_PASSWORD ' ))
7979
8080print ("Connected to WiFi" )
8181pool = socketpool .SocketPool (wifi .radio )
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def reset_on_error(delay, error):
5555
5656
5757try :
58- wifi .radio .connect (os .getenv ("WIFI_SSID " ), os .getenv ("WIFI_PASSWORD " ))
58+ wifi .radio .connect (os .getenv ("CIRCUITPY_WIFI_SSID " ), os .getenv ("CIRCUITPY_WIFI_PASSWORD " ))
5959# any errors, reset MCU
6060except Exception as e : # pylint: disable=broad-except
6161 reset_on_error (10 , e )
You can’t perform that action at this time.
0 commit comments