![Adafruit AirLift Shield ESP32 Скачать руководство пользователя страница 24](http://html.mh-extra.com/html/adafruit/airlift-shield-esp32/airlift-shield-esp32_manual_2845848024.webp)
Internet Connect!
Once you have CircuitPython setup and libraries installed we can get your board connected to the
Internet.
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 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 using the ESP32SPI and the
Requests modules.
First make sure you are running the
latest version of Adafruit CircuitPython
(https://adafru.it/Amd)
for your
board.
Next you'll need to install the necessary libraries to use the hardware--carefully follow the steps to find and
Adafruit's CircuitPython library bundle
(https://adafru.it/zdx)
. Our introduction
guide has
a great page on how to install the library bundle
(https://adafru.it/ABU)
for both express and
non-express boards.
© Adafruit Industries
https://learn.adafruit.com/adafruit-airlift-shield-esp32-wifi-co-processor
Page 24 of 56
Содержание AirLift Shield ESP32
Страница 20: ...Adafruit Industries https learn adafruit com adafruit airlift shield esp32 wifi co processor Page 20 of 56...
Страница 40: ...Adafruit Industries https learn adafruit com adafruit airlift shield esp32 wifi co processor Page 40 of 56...
Страница 56: ...Adafruit Industries Last Updated 2021 03 29 01 04 51 PM EDT Page 56 of 56...