This repository contains some example MicroPython scripts that explore different ways to get metrics from devices to Prometheus / Grafana Cloud. The code runs on Raspberry Pi Pico W microcontrollers. One example requires a couple of arcade or similar type buttons, another is specific to the Pimoroni Enviro+ Pack.
Before trying the examples, you'll need to complete a few common setup steps...
At the terminal, clone this repository to your local machine:
git clone https://github.com/simonprickett/micropython-team-talk.git
We'll use MicroPython's mpremote
command to copy files to the Pico W and run them. Install mpremote
on your local machine by following these instructions.
Verify that mpremote
has been installed by checking its version:
mpremote --version
You should see output similar to this:
mpremote 1.25.0
This repository contains a number of MicroPython demos. Each is standalone and contains its own detailed README file. If you're new to MicroPython and want to follow more of a learning path through the code, we'd suggest looking at the demos in this order:
- Hello World - a simple blinking LED.
- Counting with Arcade Buttons - sending button count metrics to a Prometheus remote write endpoint.
- Scraping Metrics with Prometheus - exposing metrics via HTTP so that Prometheus can scrape them.
- Environment Monitoring with the Pimoroni Enviro+ and Grafana Cloud - monitoring the environment in a room with a variety of sensors connected to the Pimoroni Enviro+ add-on pack.