Labs / MicroPython tutorials / Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

Author: Li Zisheng · Source: FreakStudio open documentation, v1.3 · License: CC BY 4.0

Contents

1. Project Background

101 BH1750

In the early days of the MicroPython ecosystem, when developers shared or used third-party libraries, they often had to manually download multiple files and then copy them into the project directory. This "copy-and-paste" approach has many pain points:

Later, the MicroPython community introduced the mip (mip installs packages) tool, similar to pip in Python, which can automatically download and manage packages. However, the default index is micropython-lib, and the publication and discovery of third-party libraries are still not convenient enough.

Package platforms similar to PyPI for MicroPython include mim and awesome-micropython, but they all have relatively significant issues:

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform
Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

Thus, uPyPi (https://upypi.net/) came into being —— it is a package management repository specifically designed for MicroPython, like the "PyPI for MicroPython", enabling developers to easily upload, share, and discover driver packages, completely resolving the early library management challenges.

Core issues of the mim platform:

Core issues of the mim platform:

microPython-jp5000

Core issues of the awesome-micropython project:

2. What benefits can uPyPi bring?

Using uPyPi to manage driver packages has these core advantages:

101 bh1750 10

Simply put, the uPyPi platform is the "distribution center" for MicroPython driver packages, where we can search for, view, download, and upload the required driver packages.

Core features include:

99 PIO_SPI_RP2040
1 lm1750 1.0.1 BH1750
PioNeoPixel_RP2040 1.0.0 rp2040 2026 3 7
Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

Other features include:

3. Quickly Install the Driver Package

If you're new to the MicroPython and uPyPi platforms, don't worry! This guide will start from the most basic preparations and teach you step by step how to download and use driver packages from the uPyPi platform on Raspberry Pi Pico2 (without network) and Pico2W (with network), using bmp280_driver as an example for the barometric temperature sensor driver. It will also briefly introduce how to upload driver packages (for users with sharing needs).

3.1 Preparatory Work for Beginners with No Prior Knowledge

Before using uPyPi, it is necessary to prepare the hardware, software, and complete the basic settings, all of which are indispensable.

3.1.1 Hardware Preparation

Hardware NameUsageRemarks
Any single-chip microcomputer that supports mpy firmware, whether it supports networking or not, can be used
Here, we use Raspberry Pi Pico2 or Pico2W
Core hardware for running MicroPython codePico2 has no WiFi functionality (requires local installation); Pico2W has WiFi functionality (can be installed remotely)
USB-C data cableConnect the development board to the computer for code transfer / power supply Needs to support data transfer (charging cable unavailable)
BMP280 Barometric Pressure and Temperature Sensor Module (optional) or other common electronic modulesTest the hardware of the driver packageUsed to verify whether the installed bmp280_driver is available
DuPont wires (a number of)Connect the development board to the sensor Public-to-public / public-to-female DuPont wires need to be prepared, selected according to wiring requirements

3.1.2 Software Preparation

  1. Install Thonny Editor:

Thonny is the most suitable MicroPython development tool for beginners, supporting code writing, development board connection, and file management.

  1. Install the mpremote tool (computer side)

This is a tool for communication between a computer and a MicroPython development board, used for locally installing driver packages ( essential for single-chip microcomputers without network connectivity ).

Open the "Command Prompt (CMD)" or "PowerShell" on your computer, enter the following command, and press Enter:

pip install mpremote

The prompt "Successfully installed mpremote" indicates successful installation.

3.2 Development Board Basic Settings (Flashing MicroPython Firmware)

You need to first flash an mpy firmware to your MCU. Here we take Raspberry Pi Pico2 / Pico2W as an example, which comes without a MicroPython firmware out of the box and needs to be flashed first before use.

  1. Press and hold the BOOTSEL button on the development board, then connect the development board to the computer using a USB-C cable, and release the button.
  2. The computer will recognize a USB drive named "RPI-RP2".
  3. Open the browser and download the corresponding firmware:
  4. Copy and paste the downloaded .uf2 firmware file to the "RPI-RP2" USB drive.
  5. After the copying is completed, the development board will automatically restart, the USB drive will disappear, and at this point, the firmware flashing is completed.

3.3 Open the uPyPi platform to search for packages and copy commands

The uPyPi platform is the "hub" for MicroPython driver packages, where we can search for, view, and download the required driver packages.

101 DMA_ADC_RP2040

Open your browser and visit the official uPyPi website:https://upypi.net/

Enter bmp280 in the search box at the top of the page, then click the "Search" button on the right:

bmp280 bh1750

Search results will display matching driver packages (such as bmp280_driver 1.0.0), including two core buttons:

bmp280 bmp280_driver 1.0.0 BMP280

Click "View Details" to enter the driver package details page, where you can switch driver package versions on the right side of the page:

bmp280_driver 1.0.0 BMP280 bmp280

The left side of the page will display core installation commands (local installation / remote installation):

bmp280_driver BMP280 bmp280

3.4 Download and Install the Driver Package

Depending on whether the development board has network connectivity, it is divided into local installation (Pico2) and remote installation (Pico2W) two methods.

3.4.1 Local Installation (for development boards without WiFi)

Connect to the computer via USB and use the mpremote tool to install the driver package from uPyPi onto the development board.

Enter execution command:

mpremote mip install https://upypi.net/pkgs/bmp280_driver/1.0.0

Wait for the command to execute. When the following content appears in the terminal, the installation is successful:

upypi.net/pkg/bmp280_driver/1.0.0 bmp280 3.4.1

We can also use the following command to check the files inside the board and confirm whether the download was successful:

# List the root file directory
mpremote fs ls
# List the directory under the 'lib/' folder
mpremote fs ls 'lib/'
bmp280_float.py 3.4.2

3.4.2 Remote Installation (for development boards with WiFi)

First, connect the development board to WiFi, then directly install the driver package in the REPL terminal of the development board.

After the >>> in the Shell panel, enter the following code line by line (replace with your WiFi name and password), and press Enter after each line:

import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect("Your WiFi Name", "Your WiFi Password")
# Wait for the WiFi connection to succeed
import time
while not wlan.isconnected():
    print("Connecting to WIFI...")
    time.sleep(1)
print("WIFI Connected! IP Address:", wlan.ifconfig()[0])

If it shows "WIFI Connected! IP Address: 192.168.xx.xx", it indicates that the WiFi connection is successful:

192.168.2.122 8080

After >>> in the Shell panel, enter the following complete installation command:

import mip
mip.install("https://upypi.net/pkgs/bmp280_driver/1.0.0")

After execution is completed, the following display indicates successful installation:

upypi.net/pkgs/bmp280_driver/1.0.0

Click "Raspberry Pi Pico2" in the left "File" panel, expand the "lib" folder, if you can see the bmp280_float.py file, it means the installation is successful:

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform
Pico2 bmp280_float.py

3.5 Use the installed driver package

After the installation is complete, we use the BMP280 sensor to test whether the driver package can work properly. You can refer to the following cloud document for this part:

BMP280 I2C 0 0x76 1 0x77

https://freakstudio.cn/node/019ba20b-b702-7118-a3b3-c3fb7218fd61

4. Upload Driver Packages (Advanced: For Users Who Want to Share Drivers)

If you have developed your own MicroPython driver and would like to share it on uPyPi for others to use, you can follow these steps (using bmp280_driver as an example).

4.1 Prepare a compliant driver package file

The file directory of the driver package must follow the following structure (refer to Figure 6-9), and all components are indispensable:

Your driver package folder (e.g., bmp280_driver)/
├── code/                  # Folder for core driver code
│   ├── core_driver_file.py (e.g., bmp280_float.py)
│   └── test_example_file.py (e.g., main.py, optional)
├── package.json           # "ID card" of the driver package (required file)
├── README.md              # Driver usage instructions (recommended file)
└── LICENSE                # Open source license file (recommended file)
bmp280_driver 4.1
bmp280_float.py 2026 1 16 10 23 19KB 3KB 4.1

package.json is the core configuration of the driver package and must contain the following required fields, and optional fields can be added to enrich the information:

{
  "name": "bmp280_driver",  // Package name, lowercase, separated by underscores
  "version": "1.0.0",       // Version number, following Major.Minor.Patch rules
  "urls": [                 // File mapping: ["device-side filename", "local file path"]
    ["bmp280_float.py", "code/bmp280_float.py"]
  ],
  "description": "MicroPython driver for controlling the BMP280 pressure and temperature sensor",  // Optional: Function description
  "author": "Your Name",     // Optional: Author
  "license": "MIT",         // Optional: Open source license
  "keywords": ["micropython", "bmp280", "sensor"]  // Optional: Search keywords
}

4.2 Upload the driver package to uPyPi

4.2.1 Local Upload

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

Ensure that your project's root directory contains the following files (without nested folders, directly placed in the root directory):

⚠️ Key Requirement: The Compressed Packet must not contain nested additional folders, and all files should be directly under the root directory of the Compressed Packet (refer to the example structure: BH1750_driver.zip → directly contains code/, package.json, etc.).

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

Next, package the library files into a Compressed Packet:

  1. Select all files under the root directory of the selected project (code/, LICENSE, package.json, README.md).
  2. Right-click → Select "7-Zip" → "Add to Compressed Packet" (or directly select "Add to [Package Name].zip").
  3. In the compression settings:
    • Compression Format Selection zip
    • It is recommended that the file name be consistent with the package name (e.g., BH1750_driver.zip )
    • Confirm that the path mode is "Relative Path" to avoid generating nested directories
  4. After generating the Compressed Packet, check its internal structure: open the ZIP to confirm that all files are directly in the root directory without additional folder nesting.
BH1750_driver.7z BH1750_driver.zip 4 2 7-Zip
7-Zip BH1750_driver.zip 32 128 2 4

Visit the official uPyPi website, click on "Log in with GitHub" in the top right corner, and authorize to log in using your GitHub account:

v15310x_driver

After logging in, click on "My Panel" at the top, then click on "Click Here to Upload the First Compressed Packet":

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

Go to the upload page, click "Select File", and select the ZIP Compressed Packet generated just now:

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

After confirming that the folder contains package.json , click the "Upload Package" button and wait for the upload to complete:

BH1750.zip
bh1750 1.0.1 BH1750
bh1750 BH1750 1.0.1

After successfully uploading, your driver package will be searchable on uPyPi, and other users can install it directly.

4.2.2 Github URL Upload

Submitting the driver package directly via the GitHub repository address is a convenient upload method suitable for open-source projects, and the operation steps are as follows:

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

Ensure that your driver package code has been hosted on a GitHub repository and meets the following specifications:

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

Go to your GitHub repository page, click the green "Code" button, and copy theHTTPS formatrepository URL (e.g.,https://github.com/FreakStudioCN/uPyPI_Test_Package.git) from the pop-up options.

10MiB

Under the "Upload Driver Package" module on the uPyPi platform, enter the "Upload via GitHub URL" interface, open the "Submit Package from Git Repository" form, and fill in the following information in sequence:

10MiB

Carefully read the "Submission Requirements" below the form, and after confirming that your repository fully complies with the specifications, click the "Submit Package" button.

3 bh1750

The platform will automatically pull the code from the specified directory of the GitHub repository, complete the parsing and publishing of the driver package:

4.3 Frequently Asked Questions - Avoiding Version Conflicts and Package Name Duplication

bmp280_driver 1.0.0

When uploading a driver package to uPyPi, you may encounter a prompt like the one shown in the picture: "Package bmp280_driver version 1.0.0 already exists." This is because the uPyPi platform has strict rules for package management to ensure that each package's version and name are unique, facilitating users to accurately install and use packages.

uPyPi does not allow uploadingidentical version numbersfor the same package name. This is like the update log of a mobile app:

The version number follows the "major.minor.patch" rule (Semantic Versioning), and must be incremented with each upload:

If your package name is too broad (such as sensor_driver), it is very likely to have the same name as packages from other developers, leading to confusion during user installation. It is recommended to follow the following rules:

Steps to resolve the "Version already exists" prompt:

  1. Open the package.json file in the driver package, and modify the version field to the new version number (e.g., 1.0.1).
  2. Save the file to ensure that the file name and content remain unchanged.
  3. Return to the uPyPi upload page, reselect the driver package folder, and click "Upload Package".
  4. If the prompt shows "Upload successful", the version update is completed; if an error is still prompted, check whether the package name is a duplicate or whether the version number has indeed been incremented.

Version History

Version Number

Revision Time

Modifier

Modified content

v1.0

2026-02-25

Lee Eryong

Initial version.

v1.1

2026-03-02

Lee Eryong

Add English Version Document:Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

v1.2

2026-03-16

Lee Eryong

Updated some content, package upload method, and operation video.

v1.2.1

2026-03-16

Lee Eryong

Updated some content.

v1.3

2026-03-23

Lee Eryong

Added 4.2.2 Github URL Upload.