EasyManuals Logo

Adafruit AirLift Shield ESP32 User Manual

Adafruit AirLift Shield ESP32
57 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #24 background imageLoading...
Page #24 background image
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
install these libraries from 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

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Adafruit AirLift Shield ESP32 and is the answer not in the manual?

Adafruit AirLift Shield ESP32 Specifications

General IconGeneral
MicrocontrollerESP32
InterfaceSPI
WiFi802.11 b/g/n
Voltage Level3.3V
TypeShield
SD Card SocketNo
Wireless ConnectivityWiFi
Input Voltage5V
Flash Memory4 MB
SRAM520 KB
Clock Speed240 MHz
USBNo
Compatible BoardsArduino Uno, Mega
AntennaCeramic
Digital I/O PinsNot directly accessible (used for SPI communication)