
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:
# 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',
}
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 it's 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.
©Adafruit Industries
Page 15 of 54
Содержание Airlift Bitsy Add-On
Страница 4: ...Adafruit Industries Page 4 of 54...
Страница 7: ...Pinouts Adafruit Industries Page 7 of 54...
Страница 42: ...Adafruit Industries Page 42 of 54...
Страница 54: ...Fab Print Adafruit Industries Page 54 of 54...