Labs / MicroPython tutorials / 01 Introduction to MicroPython Language — Draft Document Tutorial

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

I. Project Background

91 1.0.0 v1530x_driver tcs34725_color_driver

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

Later, the MicroPython community introduced the mip (short for mip installs packages) tool, which is similar to pip in Python and can automatically download and manage packages. However, its default index is micropython-lib, making it still not convenient enough for third-party libraries to be published and discovered.

Other package platforms for MicroPython similar to PyPI include mim and awesome-micropython, but both have significant drawbacks:

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

Accordingly, uPyPi ( https://upypi.net/ ) emerged as the times require — it is a package management repository built exclusively for MicroPython, just like "the PyPI for MicroPython", which allows developers to easily upload, share and discover driver packages, thoroughly solving the early pain points of library management.

Core Issues of the mim Platform:

Core Issues of the mim Platform:

microPython-jp5000

The core issue of the awesome-micropython project:

II. What benefits can uPyPi bring?

Using uPyPi to manage driver packages offers the following core advantages:

91 v15310x_driver

Simply put, the uPyPi platform is a "hub" for MicroPython driver packages, where we can search for, view, download, and upload the driver packages we need.

Core features include:

99 RP2040
PIO_SPI_RP2040 DMA_ADC_RP2040
PioNeoPixel_RP2040 1.0.0 RP2040 2026 3 7
Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

Other features include:

III. Quick Installation of Driver Package

If you are new to MicroPython and the uPyPi platform, don't worry! This guide will start from the most basic preparation steps, and walk you through step by step how to download and use driver packages from the uPyPi platform on Raspberry Pi Pico 2 (without network) and Pico 2 W (with network), taking the bmp280_driver barometric pressure and temperature sensor driver as an example. It will also briefly explain how to upload driver packages for users who have the need to share them.

3.1 Preparations for Absolute Beginners

Before using uPyPi, you need to prepare the hardware and software, and complete the basic setup, all of which are indispensable.

3.1.1 Hardware Preparation

Hardware NamePurposeNotes
Any microcontroller that supports mpy firmware, with or without network connectivity
Here, we use the Raspberry Pi Pico2 or Pico2W
Core hardware that runs the MicroPython codePico2 has no WiFi (local installation required); Pico2W has WiFi (remote installation possible)
USB-C data cableConnects the development board to the computer; transfers code / supplies powerMust support data transfer (charge-only cables do not work)
BMP280 barometric pressure and temperature sensor module (optional) or other common electronic modulesHardware for testing the driver packageUsed to verify that the installed bmp280_driver works
Dupont wires (several)Connect the development board to the sensorPrepare male-to-male / male-to-female Dupont wires, chosen according to wiring needs

3.1.2 Software Preparation

  1. Install the Thonny editor:

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

  1. Install the mpremote tool (for the computer side)

This is a tool for communication between a computer and a MicroPython development board, used to install driver packages locally (a necessity for microcontrollers that do not support networking functions).

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

pip install mpremote

When the prompt "Successfully installed mpremote" appears, the installation is completed successfully.

3.2 Basic Setup of the Development Board (Flashing MicroPython Firmware)

You need to first flash an mpy firmware to your MCU. Here we take Raspberry Pi Pico2 / Pico2W as an example: they do not come with MicroPython firmware from the factory, so you have to flash it first before using them.

  1. Press and hold the BOOTSEL button on the development board, then connect the board to your computer via a USB-C cable while holding the button, and finally release the button.
  2. The computer will recognize a USB flash drive named "RPI-RP2".
  3. Open your browser and download the corresponding firmware:
  4. Copy the downloaded. uf2 firmware file and paste it into the "RPI-RP2" USB drive.
  5. After the copying is complete, the development board will restart automatically, the USB flash drive will disappear, and the firmware flashing is now finished.

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

The uPyPi platform serves as a "hub" for MicroPython driver packages, where we can search for, view, and download the driver packages we need.

bmp280 mpu6050_driver

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

In the search box at the top of the page, enter bmp280 and click the "Search" button on the right:

bmp280 bmp280_driver 1.0.0 v5310x_driver

The search results will display matching driver packages (e. g., bmp280_driver 1.0.0), which you can click to use:

bmp280 bmp280_driver 1.0.0 BMP280

On the driver package details page, you can switch the driver package version on the left side of the page:

bmp280 1.0.0

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

bmp280_driver 1.0.0 upypi.net/pkg/bmp280_driver/1.0.0 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 the device to a computer via USB, then 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:

3.4.2

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

# View the root file directory
mpremote fs ls
# View the directory under the 'lib/' folder
mpremote fs ls 'lib/'
upypi.net/pkgs/bmp280_driver/1.0.0 bmp280_float.py

3.4.2 Remote Installation (for development boards with WiFi)

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

After the >>> in the Shell panel, enter the following lines of code one by one (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("你的WiFi名称", "你的WiFi密码")
# Wait for 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 "WIFI Connected! IP Address: 192.168.xx.xx" is displayed, it indicates that the WiFi connection is successful:

192.168.2.122

In the Shell panel, after >>>, enter the following complete installation command:

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

After the execution is completed, if the following content is displayed, the installation is successful:

upypi.net/pkgs/bmp280_driver/1.0.0

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

Pico2 bmp280_float.py
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 works properly. For this part, just refer to the cloud document below:

BMP280 I2C 0 0x76 1 0x77

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

IV. Uploading the Driver Package (Advanced: For Users Who Wish to Share Drivers)

If you have developed your own MicroPython driver and wish to share it on uPyPi for others to use, you can follow the steps below (taking bmp280_driver as an example).

4.1 Prepare a driver package file that complies with specifications

The file directory of the driver package must follow the structure below (refer to Figures 6-9), and none of the required components can be missing:

你的驱动包文件夹(如 bmp280_driver)/
├── code/                  # Folder holding the core driver code
│   ├── 驱动核心文件.py(如 bmp280_float.py)
│   └── 测试示例文件.py(如 main.py,可选)
├── package.json           # The driver package's "ID card" (required file)
├── README.md              # Driver usage instructions (recommended file)
└── LICENSE                # Open-source license file (recommended file)
2026 2 12 16 04 1 10 23 24 21
bmp280_float.py 2026 1 16 10 23 19KB 3KB

package.json is the core configuration of the driver package and must contain the following required fields; you can also add optional fields to enrich the information:

{
  "name": "bmp280_driver",  // Package name, lowercase, separated by underscores
  "version": "1.0.0",       // Version number, following the major.minor.patch rule
  "urls": [                 // File mapping: ["device-side file name", "local file path"]
    ["bmp280_float.py", "code/bmp280_float.py"]
  ],
  "description": "控制 BMP280 气压温度传感器的 MicroPython 驱动",  // Optional: description
  "author": "你的名字",     // Optional: author
  "license": "MIT",         // Optional: license
  "keywords": ["micropython", "bmp280", "传感器"]  // Optional: search keywords
}

4.2 Upload the driver package to uPyPi

4.2.1 Local Upload

2KB 1KB 11KB

Make sure your project root directory contains the following files (no nested folders, placed directly in the root directory):

⚠️ Key Requirement: No extra folders shall be nested inside the ZIP package, all files must be placed directly in the root directory of the Compressed Packet (refer to the example structure: BH1750_driver.zip → directly contains code/, package.json and other files).

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

Next, package the library file into a ZIP Compressed Packet:

  1. Select all files in the project root directory (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 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 set to "relative path" to avoid generating nested directories
  4. After generating the ZIP package, check its internal structure: open the ZIP file to confirm that all files are directly stored in the root directory without any extra folder nesting.
BH1750_driver.zip
G.HartfSense.Drives.MicroPython/functions/BH1750_driver.zip

Visit the official uPyPi website, click the "Log in with GitHub" button in the top right corner, and log in with authorization via your GitHub account:

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

After logging in, click "My Panel" at the top, then click "Click here to upload your first package":

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

Go to the upload page, click "Select File", and select the ZIP package you just generated:

Bht750.zip

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

BH1750.zip
1 bh1750 1.0.1 BH1750
bh1750 1.0.1 BH1750

Once uploaded successfully, your driver package will be searchable on uPyPi and can be installed directly by other users.

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. The operation steps are as follows:

3

Ensure that the code of your driver package has been hosted on a GitHub repository and complies with 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 from the pop-up options the HTTPS-formatted repository URL (e. g. https://github.com/FreakStudioCN/uPyPI_Test_Package.git ).

Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

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

10MB

Read the "Submission Requirements" below the form carefully, confirm that your repository fully complies with the specifications, and then click the "Submit Package" button.

1.0.0 3 bh1750

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

4.3 FAQ - Avoiding Version Conflicts and Duplicate Package Names

bmp280_driver 1.0.0

When uploading a driver package to uPyPi, you may encounter a prompt like the one shown in the image:"The package bmp280_driver version 1.0.0 already exists". This is because the uPyPi platform has strict rules for package management to ensure that the version and name of each package are unique, making it convenient for users to install and use them accurately.

uPyPi does not allow uploading the same package name with an exactly identical version number. This is just like the update log of a mobile app:

Version numbers follow the "major.minor.patch" convention (Semantic Versioning) and must be incremented with each upload:

If your package name is too broad (for example, sensor_driver), it will easily conflict with packages from other developers, causing confusion for users during installation. It is recommended to follow the rules below:

Steps to resolve when you encounter the "version already exists" prompt:

  1. Open the package.json file of the driver package, and modify the version field to the new version number (e. g., 1.0.1).
  2. Save the file and make sure 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 "Upload successful" appears, the version update is complete; if an error prompt still appears, check whether the package name is duplicated or whether the version number has indeed been incremented.

Version History

Version Number

Revision Date

Modifier

Modified Content

v1.0

2026-02-25

Lee Eonyong

Initialization version.

v1.1

2026-03-02

Lee Eonyong

Add the English version of this document: Instructions for Downloading and Uploading Driver Packages on the uPyPi Platform

v1.2

2026-03-16

Lee Eonyong

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

v1.2.1

2026-03-17

Lee Eonyong

Updated some of the images.

v1.3

2026-03-23

Lee Eonyong

Added 4.2.2 Github URL upload feature.