# PyPortal IoT Plant Monitor with Microsoft Azure IoT and CircuitPython

## Overview

Danger: This project's code utilizes the Azure IoT Library which currently does not work with AirLift hardware, such as the Adafruit PyPortal. As a result, this project does not currently work (but may in the future).

For a more updated guide using CircuitPython and Microsoft Azure IoT, visit https://learn.adafruit.com/getting-started-with-microsoft-azure-and-circuitpython

![A rosemary plant connected to a PyPortal tracking temperature and soil moisture](https://cdn-learn.adafruit.com/assets/assets/000/091/580/medium800/sensors_IMG_3274.png?1591648748 A rosemary plant connected to a PyPortal tracking temperature and soil moisture)

_Keep forgetting to water your plants? Want to monitor the ambient temperature of the room your plant is located in from across the world?&nbsp;_

**In this guide, you will build an Internet-enabled plant monitoring display by combining [Azure IoT Central from Microsoft](https://azure.microsoft.com/services/iot-central/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn) and CircuitPython!&nbsp;**

**Using Azure with your CircuitPython IoT projects&nbsp;allows you to rapidly prototype** (and even mass-prototype) **advanced internet-of-things devices** and connect them to Microsoft Azure services.

Once your CircuitPython device's data is sent to [Azure IoT Central](https://azure.microsoft.com/services/iot-central/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn), you can visualize your data on a dashboard. From there you can connect other Azure services such as:

- [Azure Blob Storage](https://azure.microsoft.com/services/storage/blobs/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn): Blob storage for all your sensor data to analyze later
- [Event Hubs](https://azure.microsoft.com/services/event-hubs/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn): Real-time data pipelines capable of streaming millions of events per second between Azure services
- [Azure Stream Analytics](https://azure.microsoft.com/services/stream-analytics/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn): Real-time analytics pipeline allowing you to query data in real time
- [Azure Machine Learning](https://azure.microsoft.com/services/machine-learning/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn): Build machine learning models that can be used from Stream Analytics to provide real-time predictions over your data

You can get hands on with and learn more about the Azure IoT services on [Microsoft Learn](https://docs.microsoft.com/learn/browse/?term=iot&WT.mc_id=iotcentral-adafruitlearningsystem-jabenn).

![Azure IoT Central logo](https://cdn-learn.adafruit.com/assets/assets/000/091/584/medium640/sensors_IoTCentral.png?1591648101)

## CircuitPython Code

CircuitPython is **perfect** for building Internet-of-Things projects. This project uses the [ESP32SPI CircuitPython](https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI) library, which can use the ESP32 as a WiFi-coprocessor to send web requests.

**We've created a [CircuitPython Azure IoT helper module](https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/)** to provide an API to interact with Azure IoT Central.

**You can rapidly update your code without having to compile** and store WiFi and API secret keys on the device. This means that there's no editing code and re-uploading whenever you move the PyPortal to another network - just update a file and you're set.&nbsp;

![Mu editor showing circuit python code](https://cdn-learn.adafruit.com/assets/assets/000/091/585/medium640/sensors_wireless_mu_ss.png?1591648134)

## Stemma Soil Sensor

This soil sensor uses&nbsp; **capacitive** &nbsp;measurement. Capacitive measurements use only one probe, don't have any exposed metal, and don't introduce any DC currents into your plants. We use the built in capacitive touch measurement system built into the ATSAMD10 chip, which will give you a reading ranging from about 200 (very dry) to 2000 (very wet).

As a bonus, we also give you the ambient temperature from the internal temperature sensor on the microcontroller, it's not high precision, maybe good to + or - 2 degrees Celsius.

![stemma soil sensor](https://cdn-learn.adafruit.com/assets/assets/000/091/586/medium640/sensors_wireless_4026-00.jpg.png?1591648144)

## PyPortal

Say hello to PyPortal! The easiest way to build your IoT projects with a touchscreen display!

[Make sure to walk through the PyPortal introduction guide and walkthrough the pages. It'll get you setup with CircuitPython and a handful of demo code to play with!](https://learn.adafruit.com/adafruit-pyportal)

![A PyPortal on a shelf next to a plant](https://cdn-learn.adafruit.com/assets/assets/000/091/587/medium640/sensors_wireless_circuitpython_internet_of_things___iot_3d_printing_hero_%281%29.png?1591648159)

## Prerequisite Guides

If you're new to CircuitPython, take a moment to walk through the following guides to get you started and up-to-speed:

- [Welcome to CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython)
- [PyPortal Introduction Guide](https://learn.adafruit.com/adafruit-pyportal)

## Parts
### Adafruit PyPortal - CircuitPython Powered Internet Display

[Adafruit PyPortal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4116)
 **PyPortal** , our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Make custom touch screen interface GUIs, all open-source, and Python-powered using&nbsp;tinyJSON / APIs to get news, stock, weather, cat photos,...

In Stock
[Buy Now](https://www.adafruit.com/product/4116)
[Related Guides to the Product](https://learn.adafruit.com/products/4116/guides)
![Front view of a Adafruit PyPortal - CircuitPython Powered Internet Display with a pyportal logo image on the display. ](https://cdn-shop.adafruit.com/640x480/4116-00.jpeg)

### Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor

[Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor](https://www.adafruit.com/product/4026)
Most low cost soil sensors are _resistive_ style, where there's two prongs and the sensor measures the conductivity between the two. These work OK at first, but eventually start to oxidize because of the exposed metal. Even if they're gold plated! The resistivity measurement...

In Stock
[Buy Now](https://www.adafruit.com/product/4026)
[Related Guides to the Product](https://learn.adafruit.com/products/4026/guides)
![Demo Shot of the Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor in a small potted plant, with wires connecting it to an Adafruit Metro.](https://cdn-shop.adafruit.com/640x480/4026-01.jpg)

### STEMMA Cable - 4 Pin JST-PH 2mm Cable–Female/Female

[STEMMA Cable - 4 Pin JST-PH 2mm Cable–Female/Female](https://www.adafruit.com/product/3568)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-PH female 4-pin connectors on each end. These types of JST cables are commonly found on small rechargeable battery packs, RC receivers and transmitters, tiny cameras, and other small electronic devices

We're...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3568)
[Related Guides to the Product](https://learn.adafruit.com/products/3568/guides)
![Angled shot of 150mm/6" long 4-Pin JST-PH Cable](https://cdn-shop.adafruit.com/640x480/3568-05.jpg)

## Materials

You'll need some extra supplies to finish this project. If you do not have them already, pick some up from Adafruit.

### Part: PyPortal Stand
quantity: 1
Adafruit PyPortal Desktop Stand Enclosure Kit
[PyPortal Stand](https://www.adafruit.com/product/4146)

### Part: USB Cable
quantity: 1
Pink and Purple Braided USB A to Micro B Cable - 2 meter long
[USB Cable](https://www.adafruit.com/product/4148)

# PyPortal IoT Plant Monitor with Microsoft Azure IoT and CircuitPython

## PyPortal Wiring 

Danger: This project's code utilizes the Azure IoT Library which currently does not work with AirLift hardware, such as the Adafruit PyPortal. As a result, this project does not currently work (but may in the future).

For a more updated guide using CircuitPython and Microsoft Azure IoT, visit https://learn.adafruit.com/getting-started-with-microsoft-azure-and-circuitpython

We recommend using a Female-to-Female Stemma Connector and plugging it in between the PyPortal and the STEMMA Soil Sensor. No soldering is involved - just connect the cable between the Stemma Soil Sensor and the PyPortal's I2C port.

### STEMMA Cable - 4 Pin JST-PH 2mm Cable–Female/Female

[STEMMA Cable - 4 Pin JST-PH 2mm Cable–Female/Female](https://www.adafruit.com/product/3568)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-PH female 4-pin connectors on each end. These types of JST cables are commonly found on small rechargeable battery packs, RC receivers and transmitters, tiny cameras, and other small electronic devices

We're...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3568)
[Related Guides to the Product](https://learn.adafruit.com/products/3568/guides)
![Angled shot of 150mm/6" long 4-Pin JST-PH Cable](https://cdn-shop.adafruit.com/640x480/3568-05.jpg)

The cable makes the following connections between the PyPortal's I2C port and the STEMMA Soil Sensor:

- **PyPortal 5V** to&nbsp; **Sensor VIN**
- **PyPortal GND** &nbsp;to&nbsp; **Sensor GND**
- **PyPortal SCL&nbsp;** to&nbsp; **Sensor SCL**
- **PyPortal SDA** &nbsp;to&nbsp; **Sensor SDA**

![wireless_output-onlinepngtools_(1).png](https://cdn-learn.adafruit.com/assets/assets/000/075/912/medium640/wireless_output-onlinepngtools_%281%29.png?1558642532)

_That's it_ - your PyPortal is wired up!

When you're ready, just stick the STEMMA Soil sensor into your plant's soil. Be sure to leave the&nbsp; **white** portion of the sensor not covered by soil. You may also want to position the sensor at the edge of your plant's pot.

![](https://cdn-learn.adafruit.com/assets/assets/000/076/033/medium800/wireless_IMG_4960.jpg?1558727940)

# PyPortal IoT Plant Monitor with Microsoft Azure IoT and CircuitPython

## PyPortal CircuitPython Setup

To use all the amazing features of your PyPortal with CircuitPython, you must first install a number of libraries. This page covers that process.

# Adafruit CircuitPython Bundle

Download the Adafruit CircuitPython Library Bundle. You can find the latest release here:

[Latest Adafruit CircuitPython Library Bundle](https://circuitpython.org/libraries)
Download the **adafruit-circuitpython-bundle-\*.x-mpy-\*.zip** bundle zip file where **\*.x MATCHES THE VERSION OF CIRCUITPYTHON YOU INSTALLED** , and unzip a folder of the same name. Inside you'll find a **lib** folder. You have two options:

- You can add the **lib** folder to your **CIRCUITPY** drive. This will ensure you have _all the drivers_. But it will take a bunch of space on the 8 MB disk  
- Add each library as you need it, this will reduce the space usage but you'll need to put in a little more effort.

At a minimum we recommend the following libraries, in fact we more than recommend. They're basically required. So grab them and install them into **CIRCUITPY/lib** now!

- **adafruit\_esp32spi** - This is the library that gives you internet access via the ESP32 using (you guessed it!) SPI transport. You need this for anything Internet
- **adafruit\_requests** - This library allows us to perform HTTP requests and get responses back from servers. GET/POST/PUT/PATCH - they're all in here!
- adafruit\_connection\_manager - used by adafruit\_requests.
- **adafruit\_pyportal** - This is our friendly wrapper library that does a lot of our projects, displays graphics and text, fetches data from the internet. Nearly all of our projects depend on it!
- **adafruit\_portalbase** &nbsp;- This library is the base library that adafruit\_pyportal library is built on top of.
- **adafruit\_touchscreen** - a library for reading touches from the resistive touchscreen. Handles all the analog noodling, rotation and calibration for you.
- **adafruit\_io** - this library helps connect the PyPortal to our free datalogging and viewing service
- **adafruit\_imageload** - an image display helper, required for any graphics!
- **adafruit\_display\_text** - not surprisingly, it displays text on the screen
- **adafruit\_bitmap\_font** - we have fancy font support, and its easy to make new fonts. This library reads and parses font files.
- **adafruit\_slideshow** - for making image slideshows - handy for quick display of graphics and sound
- **neopixel** - for controlling the onboard neopixel
- **adafruit\_adt7410** - library to read the temperature from the on-board Analog Devices ADT7410 precision temperature sensor (not necessary for Titano or Pynt)
- **adafruit\_bus\_device** - low level support for I2C/SPI
- **adafruit\_fakerequests** &nbsp;- This library allows you to create fake HTTP requests by using local files.

# PyPortal IoT Plant Monitor with Microsoft Azure IoT and CircuitPython

## Create Your settings.toml File

CircuitPython works with WiFi-capable boards to enable you to make projects that have network connectivity. This means working with various passwords and API keys. As of [CircuitPython 8](https://circuitpython.org/downloads), there is support for a **settings.toml** file. This is a file that is stored on your **CIRCUITPY** drive, that contains all of your secret network information, such as your SSID, SSID password and any API keys for IoT services. It is designed to separate your sensitive information from your **code.py** file so you are able to share your code without sharing your credentials.

CircuitPython previously used a **secrets.py** file for this purpose. The **settings.toml** file is quite similar.

Warning: Your **settings.toml** file should be stored in the main directory of your **CIRCUITPY** drive. It should not be in a folder.

## CircuitPython **settings.toml** File

This section will provide a couple of examples of what your **settings.toml** file should look like, specifically for CircuitPython WiFi projects in general.

The most minimal **settings.toml** file must contain your WiFi SSID and password, as that is the minimum required to connect to WiFi. Copy this example, paste it into your **settings.toml** , and update:

- `your_wifi_ssid`
- `your_wifi_password`

```auto
CIRCUITPY_WIFI_SSID = "your_wifi_ssid"
CIRCUITPY_WIFI_PASSWORD = "your_wifi_password"
```

Many CircuitPython network-connected projects on the Adafruit Learn System involve using Adafruit IO. For these projects, you must _also_ include your Adafruit IO username and key. Copy the following example, paste it into your settings.toml file, and update:

- `your_wifi_ssid`
- `your_wifi_password`
- `your_aio_username`
- `your_aio_key`

```auto
CIRCUITPY_WIFI_SSID = "your_wifi_ssid"
CIRCUITPY_WIFI_PASSWORD = "your_wifi_password"
ADAFRUIT_AIO_USERNAME = "your_aio_username"
ADAFRUIT_AIO_KEY = "your_aio_key"
```

Some projects use different variable names for the entries in the **settings.toml** file. For example, a project might use `ADAFRUIT_AIO_ID` in the place of `ADAFRUIT_AIO_USERNAME`. **If you run into connectivity issues, one of the first things to check is that the names in the settings.toml file match the names in the code.**

Warning: Not every project uses the same variable name for each entry in the **settings.toml** file! Always verify it matches the code.

## **settings.toml** File Tips
Here is an example **settings.toml** file.

```auto
# Comments are supported
CIRCUITPY_WIFI_SSID = "guest wifi"
CIRCUITPY_WIFI_PASSWORD = "guessable"
CIRCUITPY_WEB_API_PORT = 80
CIRCUITPY_WEB_API_PASSWORD = "passw0rd"
test_variable = "this is a test"
thumbs_up = "\U0001f44d"
```

In a **settings.toml** file, it's important to keep these factors in mind:

- Strings are wrapped in double quotes; ex: `"your-string-here"`
- Integers are _ **not** _ quoted and may be written in decimal with optional sign (`+1`, `-1`, `1000`) or hexadecimal (`0xabcd`).
  - Floats (decimal numbers), octal (`0o567`) and binary (`0b11011`) are not supported.

- Use `\u` escapes for weird characters, `\x` and `\ooo` escapes are not available in **.toml** files
  - Example: `\U0001f44d` for 👍 (thumbs up emoji) and `\u20ac` for € (EUR sign)

- Unicode emoji, and non-ASCII characters, stand for themselves as long as you're careful to save in "UTF-8 without BOM" format

&nbsp;

&nbsp;

When your&nbsp; **settings.toml&nbsp;** file is ready, you can save it in your text editor with the **.toml** &nbsp;extension.

![adafruit_products_dotToml.jpg](https://cdn-learn.adafruit.com/assets/assets/000/117/071/medium640/adafruit_products_dotToml.jpg?1671034293)

## Accessing Your **settings.toml** Information in **code.py**
In your **code.py** file, you'll need to `import` the `os` library to access the **settings.toml** file. Your settings are accessed with the `os.getenv()` function. You'll pass your settings entry to the function to import it into the **code.py** file.

```python
import os

print(os.getenv("test_variable"))
```

![](https://cdn-learn.adafruit.com/assets/assets/000/117/072/medium800/adafruit_products_tomlOutput.jpg?1671034496)

In the upcoming CircuitPython WiFi examples, you'll see how the **settings.toml&nbsp;** file is used for connecting to your SSID and accessing your API keys.

# PyPortal IoT Plant Monitor with Microsoft Azure IoT and CircuitPython

## Internet Connect!

# Connect to WiFi

OK, now that you have your&nbsp; **settings.toml** file set up - you can connect to the Internet.

To do this, you need to first install a few libraries, into the lib folder on your **CIRCUITPY** drive. Then you need to update **code.py** with the example script.

Thankfully, we can do this in one go. In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, open the directory **examples/** and then click on the directory that matches the version of CircuitPython you're using and copy the contents of that directory to your **CIRCUITPY** drive.

Your **CIRCUITPY** drive should now look similar to the following image:

![CIRCUITPY](https://adafruit.github.io/Adafruit_CircuitPython_Bundle/esp32spi_esp32spi_simpletest.py.png )

Info: Update to CircuitPython 9.2.x or later to use this example.

https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/blob/main/examples/esp32spi_simpletest.py

And save it to your board, with the name **code.py**.

Don't forget you'll also need to create the **settings.toml** file as seen above, with your WiFi ssid and password.

In a serial console, you should see something like the following. For more information about connecting with a serial console, view the guide [Connecting to the Serial Console](https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console).

```terminal
&gt;&gt;&gt; import wifitest
ESP32 SPI webclient test
ESP32 found and in idle mode
Firmware vers. 1.7.5
MAC addr: 24:C9:DC:BD:0F:3F
	HomeNetwork             RSSI: -46
	HomeNetwork             RSSI: -76
	Fios-12345              RSSI: -92
	FiOS-AB123              RSSI: -92
	NETGEAR53               RSSI: -93
Connecting to AP...
Connected to HomeNetwork 	RSSI: -45
My IP address is 192.168.1.245
IP lookup adafruit.com: 104.20.39.240
Ping google.com: 30 ms
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
----------------------------------------
This is a test of Adafruit WiFi!
If you can read this, its working :)
----------------------------------------

Fetching json from http://wifitest.adafruit.com/testwifi/sample.json
----------------------------------------
{'fun': True, 'company': 'Adafruit', 'founded': 2005, 'primes': [2, 3, 5], 'pi': 3.14, 'mixed': [False, None, 3, True, 2.7, 'cheese']}
----------------------------------------
Done!
```

Going over the example above, here's a breakdown of what the program is doing:

- Initialize the ESP32 over SPI using the SPI port and 3 control pins:

```python
esp32_cs = DigitalInOut(board.ESP_CS)
esp32_ready = DigitalInOut(board.ESP_BUSY)
esp32_reset = DigitalInOut(board.ESP_RESET)

#...

else:
    spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
```

- Get the socket pool and the SSL context, and then tell the `adafruit_requests` library about them.

```python
pool = adafruit_connection_manager.get_radio_socketpool(esp)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(esp)
requests = adafruit_requests.Session(pool, ssl_context)
```

- Verify an ESP32 is found, checks the firmware and MAC address

```auto
if esp.status == adafruit_esp32spi.WL_IDLE_STATUS:
    print("ESP32 found and in idle mode")
print("Firmware vers.", esp.firmware_version)
print("MAC addr:", ":".join("%02X" % byte for byte in esp.MAC_address))
```

- Perform a scan of all access points it can see and print out the name and signal strength.

```python
for ap in esp.scan_networks():
    print("\t%-23s RSSI: %d" % (ap.ssid, ap.rssi))
```

- Connect to the AP we've defined here, then print out the local IP address. Then attempt to do a domain name lookup and ping google.com to check network connectivity. (Note sometimes the ping fails or takes a while; this isn't a big deal.)

```python
print("Connecting to AP...")
while not esp.is_connected:
    try:
        esp.connect_AP(ssid, password)
    except OSError as e:
        print("could not connect to AP, retrying: ", e)
        continue
print("Connected to", esp.ap_info.ssid, "\tRSSI:", esp.ap_info.rssi)
print("My IP address is", esp.ipv4_address)
print(
    "IP lookup adafruit.com: %s" % esp.pretty_ip(esp.get_host_by_name("adafruit.com"))
)
```

Now we're getting to the really interesting part of the example program. We've written a library for web fetching web data, named [adafruit\_requests](https://github.com/adafruit/Adafruit_CircuitPython_Requests). It is a lot like the regular Python library named [requests](https://requests.readthedocs.io/en/latest/). This library allows you to send HTTP and HTTPS requests easily and provides helpful methods for parsing the response from the server.

- Here is the part of the example program is fetching text data from a URL.

```python
TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"  # Further up in the program

# ...

print("Fetching text from", TEXT_URL)
r = requests.get(TEXT_URL)
print('-' * 40)
print(r.text)
print('-' * 40)
r.close()
```

- Finally, here the program is fetching some JSON data. The `adafruit_requests` library will parse the JSON into a Python dictionary whose structure is the same as the structure of the JSON.

```auto
JSON_URL = "http://wifitest.adafruit.com/testwifi/sample.json"   # Further up in the program

# ...

print("Fetching json from", JSON_URL)
r = requests.get(JSON_URL)
print('-' * 40)
print(r.json())
print('-' * 40)
r.close()
```

# Advanced Requests Usage

Want to send custom HTTP headers, parse the response as raw bytes, or handle a response's http status code in your CircuitPython code?

We've written an&nbsp;example to show advanced usage of the requests module below.

To use with CircuitPython, you need to first install a few libraries, into the lib folder on your **CIRCUITPY** drive. Then you need to update **code.py** with the example script.

Thankfully, we can do this in one go. In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, open the directory **examples/** and then click on the directory that matches the version of CircuitPython you're using and copy the contents of that directory to your **CIRCUITPY** drive.

https://github.com/adafruit/Adafruit_CircuitPython_Requests/blob/main/examples/esp32spi/requests_esp32spi_advanced.py

Your **CIRCUITPY** drive should now look similar to the following image:

![CIRCUITPY](https://adafruit.github.io/Adafruit_CircuitPython_Bundle/requests_esp32spi_requests_esp32spi_advanced.py.png )

# WiFi Manager

The way the examples above connect to WiFi works but it's a little finicky. Since WiFi is not necessarily so reliable, you may have disconnects and need to reconnect. For more advanced uses, we recommend using the `WiFiManager` class. It will wrap the connection/status/requests loop for you - reconnecting if WiFi drops, resetting the ESP32 if it gets into a bad state, etc.

Here's a more advanced example that shows using the `WiFiManager` and also how to fetch the current time from a web source.

https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/blob/main/examples/esp32spi_localtime.py

# Further Information

For more information on the basics of doing networking in CircuitPython, see this guide:

### Networking in CircuitPython

[Networking in CircuitPython](https://learn.adafruit.com/networking-in-circuitpython)
# PyPortal IoT Plant Monitor with Microsoft Azure IoT and CircuitPython

## Azure IoT Central Setup

Danger: This project's code utilizes the Azure IoT Library which currently does not work with AirLift hardware, such as the Adafruit PyPortal. As a result, this project does not currently work (but may in the future).

For a more updated guide using CircuitPython and Microsoft Azure IoT, visit https://learn.adafruit.com/getting-started-with-microsoft-azure-and-circuitpython

Info: 

## Azure IoT Central

[Azure IoT Central](https://azure.microsoft.com/services/iot-central/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn) is an IoT platform allowing you to quickly create an IoT application that gathers data from devices and displays it on a dashboard. It also has many more capabilities including being able to synchronize data to a device, command the device to perform an action, export data to a range of other Azure services, and set up rules that can be triggered when data breaches certain ranges.

## Azure Subscription

To use Azure IoT Central it is recommended to have an Azure subscription. If you don't already have an Azure Subscription, you can sign up for free.

- [**Azure for Students**](https://azure.microsoft.com/free/students/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn) - If you are a student aged 18 or over you can sign up for a free Azure for Students account at [azure.microsoft.com/free/students](https://azure.microsoft.com/free/students/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn). This will give you US$100 of Azure credit and 12 months of free tiers of various Azure services, along with some services offering free tiers for life. This can be renewed every 12 months that you remain a student.
- [**Azure free account**](https://azure.microsoft.com/free/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn) - Sign up for an Azure free subscription at [azure.microsoft.com/free](https://azure.microsoft.com/free/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn). This will give you US$200 of credit for the first 30 days along with 12 months of free tiers of various Azure services, along with some services offering free tiers for life. You will need a credit card for verification purposes, but your card will NOT be charged until you explicitly convert to a pay-as-you-go account, if you run out of credit your services will be disabled instead of you receiving a bill.

Info: 

## Azure IoT Central application

To get started with Azure IoT Central, you need to create an IoT Central application. Applications manage the IoT devices they are connected to, as well as defining what the capabilities of the devices are - for example what telemetry values they might send. Applications can also define dashboards for devices to visualize the data they send.

The simplest way to create an application is to copy one from an existing application template. Click the button below to launch Azure IoT Central and create a pre-defined application for this project.

[Create the IoT Central application](https://apps.azureiotcentral.com/build/new/fbf20919-05f6-4187-9c7c-cddaae9c3c8d?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn)
You will need to log in with a Microsoft account. If you have an Azure subscription, use the account that was used to create the Azure subscription. If you don't have a Microsoft account, there is an option to create one. You can create one with any email address.

Once you have logged in, you will be presented with a template for a new application with some fields to fill in.

### App information
![The IoT Central app name and URL fields](https://cdn-learn.adafruit.com/assets/assets/000/091/591/medium800/sensors_SetIoTCentralAppName.png?1591648415 Set the application name and URL)

- **Application name:** &nbsp;Set this to a name that makes sense for your application, for example&nbsp;`PyPortal Plant Monitor`.
- **URL:** &nbsp;Set this to a unique URL for your app. The final app URL will end with `.azureiotcentral.com`.&nbsp;This value needs to be globally unique, so you can leave it as the default value that is created, or try to find a unique value of your own, for example by including your name.

### Pricing plan
![Pricing details for Azure IoT Central with a free tier for up to 7 days, an S1 tier for 5000 messages a month and a S2 tier for 30000 messages a month](https://cdn-learn.adafruit.com/assets/assets/000/091/594/medium800/sensors_PricingPlan.png?1591648461 Set the pricing plan)

Select the pricing plan you want to use.

For the&nbsp; **Free** plan you don't need an Azure subscription, but you will need to provide a phone number for verification. Free plans expire after 7 days,

For the&nbsp; **S** plans, you can have up to 2 devices for free, and will need an Azure subscription. If you exceed the message limits then you won't be charged more, instead the messages will be lost.

To get more details on pricing, including the cost to use more than 2 devices, read the [Azure IoT Central Pricing docs](https://azure.microsoft.com/pricing/details/iot-central/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn).

### Contact info (Free plan)
![Contact info form with fields for name, email, phone number and region](https://cdn-learn.adafruit.com/assets/assets/000/091/595/medium800/sensors_ContactInfo.png?1591648536 Set your contact info)

If you select the free plan, you will need to provide some contact information. Enter your name, phone number and the region closest to you.

The phone number will be verified to ensure you are not a bot. The region will be used to work out where in the world to deploy your application so that it is as close to you as possible.

### Billing info (Standard plans)
![Billing info form with fields for the Azure directory, subscription and location](https://cdn-learn.adafruit.com/assets/assets/000/091/598/medium800/sensors_BillingInfo.png?1591648559 Select your Azure subscription details)

If you select a standard plan, you will need to select your Azure directory and subscription. If you only have one subscription then the directory and subscription will be pre-filled for you. If you have access to more then select the one you want to use.

Then select the location closest to you. The location will be used to work out where in the world to deploy your application so that it is as close to you as possible.

### Create
![The create button](https://cdn-learn.adafruit.com/assets/assets/000/091/599/medium800/sensors_CreateButton.png?1591648586 Select Create to create the app)

Once the form is filled out, select the&nbsp; **Create** button.

Azure IoT Central will provision your application, then load it.

## Configure the PyPortal as a device

The IoT Central application that was created defines a **device template** for the PyPortal - a description of the telemetry data that a device can send as well as a dashboard to visualize that data. This device template lists two possible telemetry values - temperature and soil moisture. The dashboard shows these values by listing the last received value, as well as a graph of values over time.

To connect a PyPortal, you need to create a **device** in IoT Central that uses the device template.

![Selecting the devices tab, then the PyPortal Plant Monitor template, then the New button](https://cdn-learn.adafruit.com/assets/assets/000/091/600/medium800/sensors_Create_a_new_device.png?1591648608 Create a new device)

From the side menu, select&nbsp; **Devices**. This will show a list of device templates, so select&nbsp; **PyPortal Plant Monitor**. Then select&nbsp; **+ New**.

![The create new device dialog where you can select the template type and give the device a name and id](https://cdn-learn.adafruit.com/assets/assets/000/091/602/medium800/sensors_CreateDevice.png?1591648639 The create device dialog)

In the Create a new device dialog, enter the details for the device.

- **Template type:** &nbsp;This is already set to the PyPortal template
- **Device name:** Give the device a name that makes sense to you
- **Device ID:** Give the device a unique ID
- **Simulate this device:** Set this to&nbsp; **No**. IoT Central can create simulated devices to test out your application, and these send dummy data.

Then select&nbsp; **Create**.

The device will be created and show up in the Devices list.

![The IoT Central dashboard for the PyPortal without any data](https://cdn-learn.adafruit.com/assets/assets/000/091/603/medium800/sensors_DashboardWaitingForData.png?1591648662 The device dashboard)

Select the device from the Devices list, and it will show up with a dashboard, with fields for the temperature and soil moisture data showing **Waiting for data**.

![The device connect button](https://cdn-learn.adafruit.com/assets/assets/000/091/604/medium800/sensors_DeviceConnectButton.png?1591648686 The device connect button)

The final step is to get connection information for the device. This is a set of fields that are needed by the the device to connect to IoT Central and authenticate itself as the device in question.

Select the&nbsp; **Connect** button in the top corner.

![The connect dialog showing the ID scope, device id and keys](https://cdn-learn.adafruit.com/assets/assets/000/091/605/medium800/sensors_ConnectDialog.png?1591648710 The Device Connection dialog)

From this dialog, take a copy of the&nbsp; **ID scope** , the **Device ID** and the **Primary key**.

# PyPortal IoT Plant Monitor with Microsoft Azure IoT and CircuitPython

## Code Setup 

Danger: This project's code utilizes the Azure IoT Library which currently does not work with AirLift hardware, such as the Adafruit PyPortal. As a result, this project does not currently work (but may in the future).

For a more updated guide using CircuitPython and Microsoft Azure IoT, visit https://learn.adafruit.com/getting-started-with-microsoft-azure-and-circuitpython

## Add CircuitPython Code and Project Assets

In the embedded code element below, click on the&nbsp; **Download Project Bundle** button, and save the .zip archive file to your computer.

Then, **uncompress the .zip file** , it will unpack to a folder named **PyPortal\_Azure\_Plant\_Monitor**.

Copy the contents of the **PyPortal\_Azure\_Plant\_Monitor** directory to your PyPortal's **CIRCUITPY** drive.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/PyPortal/PyPortal_Azure_Plant_Monitor/code.py

This is what the final contents of the&nbsp; **CIRCUITPY** &nbsp;drive will look like:

![CIRCUITPY](https://adafruit.github.io/Adafruit_Learning_System_Guides/PyPortal_PyPortal_Azure_Plant_Monitor.png )

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://circuitpython.org/board/pyportal/)&nbsp;for your board.

Before continuing make sure your board's **lib** folder has the following files and folders **&nbsp;** copied over.

- **adafruit\_azureiot**
- **adafruit\_binascii**
- **adafruit\_bitmap\_font**
- **adafruit\_bus\_device**
- **adafruit\_display\_text**
- **adafruit\_esp32spi**
- **adafruit\_logging**
- **adafruit\_minimqtt**
- **adafruit\_ntp**
- **adafruit\_requests**
- **adafruit\_seesaw**
- **neopixel**

## Install an editor
This guide requires you to edit and interact with CircuitPython code. While you can use any text editor of your choosing, two recommended editors are [**Visual Studio Code**](https://code.visualstudio.com?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn) and&nbsp;[**Mu**](https://codewith.mu).

**Visual Studio Code** is a free, open source code editor with a huge range of extensions to support multiple languages and technologies. It runs on Windows, MacOS, and Linux.

After installing Visual Studio Code, you will need to install the Python extension if you want intellisense and code completion. You can read about this in the the [Python in Visual Studio Code documentation](https://code.visualstudio.com/docs/languages/python?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn).

[Install Visual Studio Code](https://code.visualstudio.com/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn)
 **Mu** is a simple code editor that works with the Adafruit CircuitPython boards. It's written in Python and works on Windows, MacOS, Linux and Raspberry Pi. The serial console is built right in, so you get immediate feedback from your board's serial output!

[Install Mu Editor](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor)
## Settings File Setup

First, use Visual Studio Code or Mu to open up a **settings.toml** file on your **CIRCUITPY** drive. Next, you're going to edit&nbsp;the file to enter your local WiFi credentials along with data about your Azure IoT Central Device.

Make the following changes to the code below in the **settings.toml** file:

- Replace `your-wifi-ssid` with the name of your WiFi SSID
- Replace `your-wifi-password` with your WiFi's password
- Replace `MY_AZURE_IOT_CENTRAL_ID_SCOPE`&nbsp;with the ID Scope of your Azure IoT Central device from the connection dialog.
- Replace&nbsp;`MY_AZURE_IOT_CENTRAL_DECVICE_ID`with the&nbsp;Device ID&nbsp;of your Azure IoT Central device from the connection dialog.
- Replace&nbsp; `MY_AZURE_IOT_CENTRAL_PRIMAEY_KEY`&nbsp;with the&nbsp;Primary Key&nbsp;of your Azure IoT Central device from the connection dialog.

```python
# 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

CIRCUITPY_WIFI_SSID="your-wifi-ssid"
CIRCUITPY_WIFI_PASSWORD="your-wifi-password"
id_scope="MY_AZURE_IOT_CENTRAL_ID_SCOPE"
device_id="MY_AZURE_IOT_CENTRAL_DEVICE_ID"
key="MY_AZURE_IOT_CENTRAL_PRIMARY_KEY"
```

You can then close **settings.toml** , saving the updated file onto the device.

## Done

Setting up the PyPortal with the Azure IoT Central is finished! You do not need to repeat this process again unless you change your IoT Central device.

# PyPortal IoT Plant Monitor with Microsoft Azure IoT and CircuitPython

## Code Usage

Danger: This project's code utilizes the Azure IoT Library which currently does not work with AirLift hardware, such as the Adafruit PyPortal. As a result, this project does not currently work (but may in the future).

For a more updated guide using CircuitPython and Microsoft Azure IoT, visit https://learn.adafruit.com/getting-started-with-microsoft-azure-and-circuitpython

## Viewing Data on the PyPortal
When the PyPortal starts up, it will first load the **azure\_splash.bmp** &nbsp;image in the **images** &nbsp;folder on your **CIRCUITPY** drive. This is a "loading screen" while the code waits for the fonts and display objects load on the screen.

![The apps splash screen showing the Azure IoT Central logo and the title PyPortal plant monitor](https://cdn-learn.adafruit.com/assets/assets/000/091/612/medium640/sensors_azure_splash.png?1591648231)

You should see the PyPortal&nbsp;display update to display the temperature value and moisture level.

The status indicator at the bottom of the PyPortal will display when it's sending data to Azure IoT Central and also display when the data is sent.&nbsp;

![The PyPortal display showing the temperature and soil moisture level](https://cdn-learn.adafruit.com/assets/assets/000/091/617/medium640thumb/sensors_output.jpg?1591648250)

## Monitoring the data with Azure IoT Central

Once your device is connected and sending data, you will see the temperature and soil moisture values start to appear in your IoT Central app.

![sensors_DashboardWithData.pngThe IoT Central dashboard showing the temperature and moisture with the current level and a graph showing the last hour of data](https://cdn-learn.adafruit.com/assets/assets/000/091/619/medium800/sensors_DashboardWithData.png?1591648307 The IoT Central app dashboard)

## Going Further

Ready to go further with your CircuitPython-Powered Azure-connected IoT Device? The [`CircuitPython_AzureIoT`](https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT) module provides usage examples for advanced Azure IoT Central operations such as [properties](https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/blob/master/examples/iotcentral_properties.py) and [commands](https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/blob/master/examples/iotcentral_commands.py).

Azure IoT Central has a number of additional capabilities you can add to your IoT App:

- [Set up a rule](https://docs.microsoft.com/azure/iot-central/core/tutorial-create-telemetry-rules?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn) to send you an email if your soil moisture levels are too low and the plant needs watering.
- [Export all your data](https://docs.microsoft.com/azure/iot-central/core/howto-export-data?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn) into storage to keep a history of all the recorded values.

You can also take advantage of other Azure services to work with the data:

- [Connect to Azure Logic Apps](https://docs.microsoft.com/azure/iot-central/core/howto-configure-rules-advanced?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn) to build more advanced rules on top of the telemetry data.
- [Use Azure ML Studio](https://azure.microsoft.com/services/machine-learning/?WT.mc_id=iotcentral-adafruitlearningsystem-jabenn) to run machine learning models on your telemetry

# PyPortal IoT Plant Monitor with Microsoft Azure IoT and CircuitPython

## Code Walkthrough

Danger: This project's code utilizes the Azure IoT Library which currently does not work with AirLift hardware, such as the Adafruit PyPortal. As a result, this project does not currently work (but may in the future).

For a more updated guide using CircuitPython and Microsoft Azure IoT, visit https://learn.adafruit.com/getting-started-with-microsoft-azure-and-circuitpython

## Importing CircuitPython Libraries
```python
import time
import json
import board
import busio
from digitalio import DigitalInOut
from adafruit_esp32spi import adafruit_esp32spi, adafruit_esp32spi_wifimanager
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
import neopixel
from adafruit_ntp import NTP
from adafruit_azureiot import IoTCentralDevice
from adafruit_seesaw.seesaw import Seesaw

# gfx helper
import azure_gfx_helper
```

The code first imports all of the modules required to run the code. Some of these libraries are&nbsp; [CircuitPython core modules](https://circuitpython.readthedocs.io/en/4.x/shared-bindings/index.html) (they're "burned into" the firmware) and some of them you dragged into the library folder.

The code for this project&nbsp;imports a _special_ `adafruit_azureiot` library. To help simplify communication between your device and Azure IoT Central, we wrote a CircuitPython helper module called [Adafruit\_CircuitPython\_AzureIoT](https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/).&nbsp;

- For more information about how the MQTT requests behind the API work - check out our [All The Internet of Things guide on this topic here](https://learn.adafruit.com/alltheiot-protocols/mqtt?preview_token=iMFr59PcHODf-hGg5jStMA).

We've also included an **azure\_gfx\_helper.py** file which handles displaying the status of the code on the PyPortal's display.

## Configuring the Graphical Helper&nbsp;

The graphics helper, which manages' the PyPortal's display is created. Once created it shows a splash screen whilst the device connects to WiFi and Azure IoT Central. If you want to show the temperature in Fahrenheit instead of Celsius, change `is_celsius=True` to `is_celsius=False`.

```python
# init. graphics helper
gfx = azure_gfx_helper.Azure_GFX(is_celsius=True)
```

## Configuring the PyPortal's WiFi

The next chunk of code grabs information from a **settings.toml** file including wifi configuration. Then, it&nbsp;sets up the ESP32's SPI connections for use with the PyPortal. The&nbsp;`wifi`&nbsp;object is set up here too to manage the WiFi connection.

Finally a Network Time Protocol, or NTP object is set up to synchronize the current time from a server.

```python
# PyPortal ESP32 Setup
esp32_cs = DigitalInOut(board.ESP_CS)
esp32_ready = DigitalInOut(board.ESP_BUSY)
esp32_reset = DigitalInOut(board.ESP_RESET)
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)

# Set up the WiFi manager with a status light to show the WiFi connection status
tatus_pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2)
wifi = adafruit_esp32spi_wifimanager.WiFiManager(esp, ssid, password, status_pixel=status_pixel)
print("WiFi connecting...")
wifi.connect()
print("WiFi connected!")

# Time setup, needed to authenticate with Azure IoT Central
ntp = NTP(esp)
while not ntp.valid_time:
    print("Failed to obtain time, retrying in 5 seconds...")
    time.sleep(5)
    ntp.set_time()
```

## Configuring the Soil Sensor

An I2C busio device is set up and linked to the soil sensor's address (`0x36`)

```python
# Soil Sensor Setup
i2c_bus = busio.I2C(board.SCL, board.SDA)
ss = Seesaw(i2c_bus, addr=0x36)
```

## Configuring the Azure IoT Central Module

Next, we'll create an instance of the Azure IoT Central device client called `device`. It takes in the ESP network socket, `socket`, the ESP object, `esp`, and the IoT Central connection details from the **settings.toml** file. Once created, the device connects to IoT Central.

```python
# Create an instance of the Azure IoT Central device
device = IoTCentralDevice(
    socket, esp, getenv("id_scope"), getenv("device_id"), getenv("key")
)

# Connect to Azure IoT Central
device.connect()
```

## Hide the splash screen and show the telemetry

Once the device is connected, the graphical helper can hide the splash screen and start displaying the telemetry values on screen.

```python
# Hide the splash screen and show the telemetry values
gfx.show_text()
```

## Main Loop

The first part of the main loop reads the soil sensor's (`ss`) moisture level and temperature. It then calls `gfx.display_moisture` and `gfx.display_temp` to display the moisture and temperature values on the PyPortal's display

```python
while True:
    try:
        # read moisture level
        moisture_level = ss.moisture_read()
        # read temperature
        temperature = ss.get_temp()
        # display soil sensor values on pyportal
        gfx.display_moisture(moisture_level)
        gfx.display_temp(temperature)
```

The next block of code changes the displays status to indicate that data is about to be sent. It then builds a JSON object, `message`,&nbsp;containing the temperature and soil moisture.

This message is then sent to Azure IoT Central as telemetry data using the `device.send_telemetry()`&nbsp;call. The `device.loop()` method is then called to process any communication back and&nbsp;further between the Azure IoT Central module and&nbsp;the&nbsp;Azure IoT Central application.

Finally&nbsp;the display status is changed to show data has been sent.

```python
# send the temperature and moisture level to Azure
message = {
    "Temperature": temperature,
    "MoistureLevel": moisture_level
}
device.send_telemetry(json.dumps(message))
device.loop()

gfx.display_azure_status('Data sent!')
print('Data sent!')
```

All of this code is wrapped in a&nbsp;`try`/`except` control flow block. If connection is lost at any point, then the&nbsp;`except` code will be run before going back to the&nbsp;`try`.

This&nbsp;`except` code block will reset and reconnect the&nbsp;`wifi` object, then reconnect to Azure IoT Central.

```python
except (ValueError, RuntimeError) as e:
    print("Failed to get data, retrying\n", e)
    wifi.reset()
    wifi.connect()
    device.reconnect()
    continue
```

Finally the loop sleeps for 10 minutes, represented as 600 seconds. This is to ensure IoT Central doesn't receive too much data - the S1 tier is limited to 5,000 messages a month, and one message every 10 minutes is a maximum of 4,464 messages a month.

```python
# Sleep for 10 minutes before getting the next value
time.sleep(600)
```


## Featured Products

### Adafruit PyPortal - CircuitPython Powered Internet Display

[Adafruit PyPortal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4116)
 **PyPortal** , our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Make custom touch screen interface GUIs, all open-source, and Python-powered using&nbsp;tinyJSON / APIs to get news, stock, weather, cat photos,...

In Stock
[Buy Now](https://www.adafruit.com/product/4116)
[Related Guides to the Product](https://learn.adafruit.com/products/4116/guides)
### Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor

[Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor](https://www.adafruit.com/product/4026)
Most low cost soil sensors are _resistive_ style, where there's two prongs and the sensor measures the conductivity between the two. These work OK at first, but eventually start to oxidize because of the exposed metal. Even if they're gold plated! The resistivity measurement...

In Stock
[Buy Now](https://www.adafruit.com/product/4026)
[Related Guides to the Product](https://learn.adafruit.com/products/4026/guides)
### STEMMA Cable - 4 Pin JST-PH 2mm Cable–Female/Female

[STEMMA Cable - 4 Pin JST-PH 2mm Cable–Female/Female](https://www.adafruit.com/product/3568)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-PH female 4-pin connectors on each end. These types of JST cables are commonly found on small rechargeable battery packs, RC receivers and transmitters, tiny cameras, and other small electronic devices

We're...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3568)
[Related Guides to the Product](https://learn.adafruit.com/products/3568/guides)
### Adafruit PyPortal Desktop Stand Enclosure Kit

[Adafruit PyPortal Desktop Stand Enclosure Kit](https://www.adafruit.com/product/4146)
PyPortal is&nbsp;our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Create little pocket universes of joy that connect to something good.

And now that you've made a cool internet-connected project...

In Stock
[Buy Now](https://www.adafruit.com/product/4146)
[Related Guides to the Product](https://learn.adafruit.com/products/4146/guides)
### Pink and Purple Braided USB A to Micro B Cable - 2 meter long

[Pink and Purple Braided USB A to Micro B Cable - 2 meter long](https://www.adafruit.com/product/4148)
This cable is&nbsp;super-fashionable&nbsp;with a woven pink and purple Blinka-like pattern!

First let's talk about the cover and over-molding. We got these in custom colors, and if you&nbsp;_have_&nbsp;to have visible cables, then you might as well have the nicest fabric-bound...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/4148)
[Related Guides to the Product](https://learn.adafruit.com/products/4148/guides)
### AdaBox011 - PyPortal

[AdaBox011 - PyPortal](https://www.adafruit.com/product/4061)
Reach out beyond your desk - to the stars and beyond - with **PyPortal**! This ADABOX features a new, easy-to-use IoT device that allows you to customize and create your very own "Internet of Things" portal. We take CircuitPython to the max, pairing a SAMD51 chip with a...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/4061)
[Related Guides to the Product](https://learn.adafruit.com/products/4061/guides)

## Related Guides

- [Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor](https://learn.adafruit.com/adafruit-stemma-soil-sensor-i2c-capacitive-moisture-sensor.md)
- [Adafruit PyPortal - IoT for CircuitPython](https://learn.adafruit.com/adafruit-pyportal.md)
- [Adafruit STEMMA & STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt.md)
- [Discord and Slack Connected Smart Plant with Adafruit IO Actions](https://learn.adafruit.com/discord-and-slack-connected-smart-plant-with-adafruit-io-triggers.md)
- [PyPortal New New New Product Viewer](https://learn.adafruit.com/pyportal-new-new-new-product-viewer.md)
- [CircuitPython Neko Kitty with Displayio](https://learn.adafruit.com/circuitpython-neko-kitty-with-displayio.md)
- [Saving CircuitPython Bitmaps and Screenshots](https://learn.adafruit.com/saving-bitmap-screenshots-in-circuitpython.md)
- [Playing Animated GIF Files in CircuitPython](https://learn.adafruit.com/using-animated-gif-files-in-circuitpython.md)
- [CircuitPython Display Support Using displayio](https://learn.adafruit.com/circuitpython-display-support-using-displayio.md)
- [PyPortal Hurricane Tracker](https://learn.adafruit.com/pyportal-hurricane-tracker.md)
- [PyPortal WFH Busy Sounds Simulator](https://learn.adafruit.com/pyportal-wfh-busy-sounds-simulator.md)
- [PyPortal IoT Plant Monitor with Google Cloud IoT Core and CircuitPython](https://learn.adafruit.com/pyportal-iot-plant-monitor-with-google-cloud-iot-core-and-circuitpython.md)
- [EZ Make Oven](https://learn.adafruit.com/ez-make-oven.md)
- [Smart Mirror with PyPortal](https://learn.adafruit.com/smart-mirror-with-pyportal.md)
- [Use circup to easily keep your CircuitPython libraries up to date](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup.md)
- [PyPortal 2FA TOTP Authentication Friend](https://learn.adafruit.com/pyportal-2fa-totp-authentication-friend.md)
- [Program CircuitPython USB Devices with iPhone & iPad](https://learn.adafruit.com/use-circuitpython-devices-with-iphone-ipad.md)
