PyPortal First Steps


I picked up a PyPortal from Adafruit a couple of years ago. It's been sitting on my desk gathering dust, but now that I have a bit more time on my hands, I've been diving into it.

Circuit Python is based on Python, but is hardware focused, and has some differences - certainly from the more internet services/web development/devOps python I've been using for so many years. And hardware is a different animal than just using Python in a Linux operating system, which is what I'm used to.

There are three elements you need to get Circuit Python going on hardware:

Hopefully up-to-date firmware, which is hardware specific. That page has all of the boards that Circuit Python works on, which is quite a long list! I'm looking forward to eventually trying some of these other boards.

The bootloader which is also board specific, and likely doesn't need to be updated if the firmware is working, but it's good to have this in your pocket - I needed to update mine.

And finally, the Circuit Python Libraries. This is a huge package, that won't fit on most hardware. Here's some information about the libraries that might be useful.


So the first steps are as follows:

  • Firmware:
  • Plug in PyPortal
  • Hit Reset Button twice
  • Bootloader mode is when the green light is lit
  • Drag new Firmware (gotten at link above) to Boot drive

  • Libraries:

  • Download library bundle
  • unzip
  • Move the libraries below to /board/lib
  • minimum library suggested:
    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_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 - 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_sdcard - support for reading/writing data from the onboard SD card slot.
    adafruit_bus_device - low level support for I2C/SPI
    adafruit_fakerequests - This library allows you to create fake HTTP requests by using local files.


My goal is to eventually create my own kind of framework for the PyPortal, along the lines of this one, but more flexible and broad.

I started out with three files: - (required) - (also required) - (my own code)

Secrets File

This is just a file that has a dictionary of passwords, api keys, etc. Right now, it only has:

# This file is for any secrets (passwords, api keys, etc.)

secrets = {
    'ssid' : 'My WIFI',             
    'password' : 'mywifipassword',        
    'timezone' : "America/Los_Angeles",


The main code file is called Right now, it's super simple:

from elements import caption
import time

while True:


The functions file is (for now) called It has:

import board
from adafruit_pyportal import PyPortal

def caption():
    #The current directory
    cwd = ("/"+__file__).rsplit('/', 1)[0]
    pyportal = PyPortal(status_neopixel=board.NEOPIXEL,

    # speed up projects with lots of text by preloading the font!

    # Basic program that runs the framework
    value = pyportal.set_caption(
        caption_text = "This is a big, old test!",

And, we get:

Pyportal Test Image

There's a lot more for me to do - bu this is a start. I'm hoping to have this present things like our solar panel output, perhaps notifications from environmental monitors I have (a weather station and Purple air monitor), and perhaps other things.