MagTag

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.MagTag

 

Prepare

 

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

MagTag setup

  1. Download the latest CircuitPython that will work with the MagTag (download .UF2 file).
  2. Connect the MagTag to your computer using a USB C cable.
  3. Double-click the Reset button on the MagTag.
  4. You’ll see a new disk drive on your computer with the name MAGTAGBOOT.
  5. Copy the .UF2 file you downloaded onto the MAGTAGBOOT drive.
  6. Your board should auto-reset into CircuitPython and CIRCUITPY drive will appear.
  7. Download the latest CircuitPython Libraries.
  8. Now you can test your internet connection according to the following tutorial.

 

MagTag program and files

  1. Download as .ZIP this code, files and folders.
  2. Unzip the downloaded .ZIP and move the files and folders to the CIRCUITPY drive.

 

The Things Stack – Integrations and API Keys

Integrations

  1. In TTS -> Applications -> YourAppName -> Integrations -> Storage Integration click on button Activate Storage Integration.
  2. 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.
  3. Next, enter the ‘ssid’ and ‘password’ from your Wi-Fi in the secrets.py file.
  4. Save your secrets.py file.

API Keys

  1. In TTS -> Applications -> YourAppName -> API keys click on button + Add API key
  2. Select Grant individual rights
  3. Select Read application traffic (uplink and downlink)
  4. Click on button Create API key.
  5. Copy API key and paste it to your secrets.py file in MagTag as value for key ‘TTN_api’.
  6. Click on button I have copied the key.
  7. Save your secrets.py file.
  8. Last received valid data (Temperature and Humidity in Cayenne LPP)  will show up on your MagTag.MagTag