User Manual
Internet Connect!
Once you have CircuitPython setup and libraries installed we can get your board connected to the Internet. Note that
access to enterprise level secured WiFi networks is not currently supported, only WiFi networks that require SSID and
password.
To get connected, you will need to start by creating a
secrets file
.
What's a secrets file?
We expect people to share tons of projects as they build CircuitPython WiFi widgets. What we want to avoid is people
accidentally sharing their passwords or secret tokens and API keys. So, we designed all our examples to use a
secrets.py file, that is in your CIRCUITPY drive, to hold secret/private/custom data. That way you can share your main
project without worrying about accidentally sharing private stuff.
Your secrets.py file should look like this:
Inside is a python dictionary named secrets with a line for each entry. Each entry has an entry name (say 'ssid' ) and
then a colon to separate it from the entry key 'home ssid' and finally a comma ,
At a minimum you'll need the ssid and password for your local WiFi setup. As you make projects you may need more
tokens and keys, just add them one line at a time. See for example other tokens such as one for accessing github or
the hackaday API. Other non-secret data like your timezone can also go here, just cause its called secrets doesn't
mean you can't have general customization data in there!
For the correct time zone string, look at http://worldtimeapi.org/timezones (https://adafru.it/EcP) and remember that if
your city is not listed, look for a city in the same time zone, for example Boston, New York, Philadelphia, Washington
DC, and Miami are all on the same time as New York.
Of course, don't share your secrets.py - keep that out of GitHub, Discord or other project-sharing sites.
Connect to WiFi
OK now you have your secrets setup - you can connect to the Internet. Lets use the ESP32SPI and the Requests
libraries - you'll need to visit the CircuitPython bundle and install:
adafruit_bus_device
adafruit_esp32spi
adafruit_requests
neopixel
# This file is where you keep secret settings, passwords, and tokens!
# If you put them in the code you risk committing that info or sharing it
secrets = {
'ssid' : 'home ssid',
'password' : 'my password',
'timezone' : "America/New_York", # http://worldtimeapi.org/timezones
'github_token' : 'fawfj23rakjnfawiefa',
'hackaday_token' : 'h4xx0rs3kret',
}
© Adafruit Industries https://learn.adafruit.com/adafruit-metro-m4-express-airlift-wifi Page 90 of 187