-
11The CIRCUITPY Drive
The CIRCUITPY Drive
https://learn.adafruit.com/adafruit-esp32-s2-feather/the-circuitpy-drive
The CIRCUITPY drive is where your code and the necessary libraries and files will live. You can edit your code directly on this drive and when you save it, it will run automatically. When you create and edit code, you'll save your code in a code.py file located on the CIRCUITPY drive.
With a fresh CircuitPython install, on your CIRCUITPY drive, you'll find a code.py file containing print("Hello World!") and an empty lib folder.
CircuitPython looks for code.py and executes the code within the file automatically when the board starts up or resets. Following a change to the contents of CIRCUITPY, such as making a change to the code.py file, the board will reset, and the code will be run.
-
12CircuitPython Libraries needed for the Pavilion Project
CircuitPython Libraries needed for the Pavilion Project
Libraries are stored on your CIRCUITPY drive in a folder called lib.
You can download the latest Adafruit CircuitPython Library Bundle here: https://circuitpython.org/libraries
Download Bundle for Version 7.x
The libraries that will be needed for the Pavillion project are listed below. Copy them from the bundle and include them in your lib folder.
-
13The Code
-
14Data visualisation - Display data in real-time, online
Data visualisation - Display data in real-time, online
https://github.com/Avmaker/Pavilion/blob/main/Code/pavilion_iot.py
(to run, change the name to code.py)
-
15Adafruit Platform
Adafruit Platform
You will need to create an account on adafruit.com
-
16Secrets.py File
Secrets.py File
It allows you to store your WiFi network's SSID and password, along with other sensitive information, separately from your main program, so that you don't accidentally share your info when sharing your code.
Head to io.adafruit.com and simply click the View AIO Key link on the left-hand side of the Adafruit IO page to get this information.
You will need your network information, as well as an Adafruit IO account. Your Adafruit AIO information and your location will also be placed in the file.
Using Mu or any text editor, you should add your Adafruit IO Username and Adafruit IO Key to the secrets.py file.
Once you have logged into your account, there is information you'll need to place in your secrets.py file: Adafruit IO username, Adafruit IO key, broker, MQTT port, MQTT username, and MQTT password in the secrets.py file.
Your secrets.py file should look similar to this:
secrets = {
‘SSID’ : ‘your SSID here’,
‘password’ : ‘Your password here’,
‘aio_username’ : ‘your aio username’,
‘aio_key’ : ‘your aio key’,
‘broker’: “io.adafruit.com” ,
‘mqtt_port’: 8883,
‘mqtt_username’: ‘your aio_username’,
‘mqtt_password’: ‘your aio_key’,
}Save your secrets.py file in your CIRCUITPY root file
-
17Adafruit IO set up
Adafruit IO set up
https://learn.adafruit.com/welcome-to-adafruit-io/getting-started-with-adafruit-io
Head over to io.adafruit.com and click Sign In to log into IO using your Adafruit account. It's free and fast to join.
-
18Create Feeds & Dashboard
Feeds
- Follow the Adafruit guide here: https://learn.adafruit.com/adafruit-io-basics-feeds
Dashboards
- Follow Adafruit guide here: https://learn.adafruit.com/adafruit-io-basics-dashboards
-
19The Code - IoT Visualisation
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.