TTN version: | TTNv3 |
Last updated: | July 7, 2024 |
This article provides instructions for visualizing the latest measured temperature and humidity from the BME280 or DHT22 sensor using the Adafruit MagTag and TTS Storage Integration.
Prepare
- Temperature, Humidity and Pressure sensor sending data to TTS or Temperature and Humidity sensor DHT22 sending data to TTS
- Adafruit MagTag – 2.9″ Grayscale E-Ink WiFi Display
- Battery
- Minimalistic case for the Adafruit MagTag
- Mini Magnet Feet for RGB LED Matrices (Pack of 4)
- Wi-Fi internet connection
- PC + USB C cable
MagTag
The Adafruit MagTag combines the new ESP32-S2 wireless module and a 2.9″ grayscale E-Ink display to make a low-power IoT display that can show data on its screen even when power is removed. See complete specification here.
MagTag setup
- Download the latest CircuitPython that will work with the MagTag (download .UF2 file).
- Connect the MagTag to your computer using a USB C cable.
- Double-click the Reset button on the MagTag.
- You’ll see a new disk drive on your computer with the name MAGTAGBOOT.
- Copy the .UF2 file you downloaded onto the MAGTAGBOOT drive.
- Your board should auto-reset into CircuitPython and CIRCUITPY drive will appear.
- Download the latest CircuitPython Libraries.
- Now you can test your internet connection according to the following tutorial.
MagTag program and files
- Download as .ZIP this code, files and folders.
- Unzip the downloaded .ZIP and move the files and folders to the CIRCUITPY drive.
The Things Stack – Integrations and API Keys
Integrations
- In TTS -> Applications -> YourAppName -> Integrations -> Storage Integration click on button Activate Storage Integration.
- Copy first URL and paste it to your secrets.py file in MagTag as value for key ‘TTN_Storage_Address’ and replace {type} with uplink_message.
- Next, enter the ‘ssid’ and ‘password’ from your Wi-Fi in the secrets.py file.
- Save your secrets.py file.
API Keys
- In TTS -> Applications -> YourAppName -> API keys click on button + Add API key
- Select Grant individual rights
- Select Read application traffic (uplink and downlink)
- Click on button Create API key.
- Copy API key and paste it to your secrets.py file in MagTag as value for key ‘TTN_api’.
- Click on button I have copied the key.
- Save your secrets.py file.
- Last received valid data (Temperature and Humidity in Cayenne LPP) will show up on your MagTag.