2025-06-05 00:02:16 +02:00
|
|
|
MicroPythonOS
|
2025-04-30 09:22:06 +02:00
|
|
|
=======
|
|
|
|
|
|
|
|
|
|
This is an operating system for microcontrollers like the ESP32.
|
|
|
|
|
|
|
|
|
|
It's written entirely in MicroPython, including device drivers, interrupt handlers, boot code, multitasking, display handling.
|
|
|
|
|
|
|
|
|
|
The architecure is inspired by the Android operating system for smartphones:
|
|
|
|
|
- 'thin' operating system with facilities for apps
|
|
|
|
|
- 'everything is an app' idea
|
|
|
|
|
- making it as simple as possible for developers to build new apps
|
|
|
|
|
|
2025-06-15 09:34:45 +02:00
|
|
|
## Installation
|
|
|
|
|
|
|
|
|
|
See https://install.MicroPythonOS.com
|
|
|
|
|
|
2025-04-30 09:22:06 +02:00
|
|
|
## Apps
|
|
|
|
|
|
|
|
|
|
The operating system comes with a few apps built-in that are necessary to bootstrap:
|
|
|
|
|
- launcher: to be able to start apps
|
|
|
|
|
- wificonf: to be able to connect to the wifi
|
|
|
|
|
- appstore: to be able to download and install new apps
|
|
|
|
|
- osupdate: to download and install operating system updates
|
2025-06-15 09:34:45 +02:00
|
|
|
|
|
|
|
|
Other apps are available in the AppStore.
|
|
|
|
|
|
|
|
|
|
See https://apps.MicroPythonOS.com/
|
2025-04-30 09:22:06 +02:00
|
|
|
|
|
|
|
|
## Supported hardware
|
|
|
|
|
|
2025-06-15 09:34:45 +02:00
|
|
|
### ESP32 computers
|
|
|
|
|
- https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-2
|
|
|
|
|
|
|
|
|
|
### Desktop computers
|
|
|
|
|
- Linux desktop (uses SDL)
|
|
|
|
|
- MacOS should work. Untested.
|
|
|
|
|
|
|
|
|
|
### Raspberry Pi
|
|
|
|
|
- Should work, especially if it's running a Linux desktop like Raspbian. Untested.
|
2025-04-30 09:22:06 +02:00
|
|
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
2025-06-15 09:34:45 +02:00
|
|
|
- boot.py: initializes the hardware on ESP32 / boot_unix.py: initializes the hardware on linux desktop
|
2025-04-30 09:22:06 +02:00
|
|
|
- main.py: initializes the User Interface, contains helper functions for apps, and starts the launcher app
|
|
|
|
|
|
|
|
|
|
## Filesystem layout:
|
|
|
|
|
|
|
|
|
|
- /apps: new apps are downloaded and installed here
|
|
|
|
|
- /apps/com.example.app1: example app1 installation directory
|
|
|
|
|
- /apps/com.example.app1/MANIFEST.MF: info about app1 such as Name, Start-Script
|
|
|
|
|
- /apps/com.example.app1/mipmap-mdpi: medium dpi images for app1
|
|
|
|
|
- /apps/com.example.app1/mipmap-mdpi/icon_64x64.bin: icon for app1 (64x64 pixels)
|
|
|
|
|
- /builtin/: read-only filesystem that's compiled in and mounted at boot by main.py
|
|
|
|
|
- /builtin/apps: apps that are builtin and necessary for minimal facilities (launcher, wificonf, appstore etc)
|
|
|
|
|
- /builtin/res/mipmap-mdpi/default_icon_64x64.bin: default icon for apps that don't have one
|
2025-06-15 09:34:45 +02:00
|
|
|
- /data/: place where apps store their data
|
|
|
|
|
- /data/images/: place where apps (like the camera) store their images
|
|
|
|
|
- /data/com.example.app1/: storage (usually config.json) specific to com.example.app1
|
2025-04-30 09:22:06 +02:00
|
|
|
|
2025-04-30 13:50:04 +02:00
|
|
|
# Building
|
|
|
|
|
|
2025-04-30 13:58:27 +02:00
|
|
|
Prepare all the sources:
|
|
|
|
|
|
|
|
|
|
```
|
2025-06-15 09:34:45 +02:00
|
|
|
mkdir ~/MicroPythonOS
|
|
|
|
|
cd ~/MicroPythonOS
|
2025-04-30 13:50:04 +02:00
|
|
|
|
2025-06-05 00:02:16 +02:00
|
|
|
git clone https://github.com/MicroPythonOS/MicroPythonOS.git
|
2025-04-30 13:50:04 +02:00
|
|
|
|
2025-06-15 09:34:45 +02:00
|
|
|
git clone https://github.com/MicroPythonOS/freezeFS
|
2025-04-30 13:50:04 +02:00
|
|
|
|
|
|
|
|
git clone https://github.com/cnadler86/micropython-camera-API
|
2025-06-15 10:25:38 +02:00
|
|
|
echo 'include("~/MicroPythonOS/lvgl_micropython/build/manifest.py")' >> micropython-camera-API/src/manifest.py
|
2025-04-30 13:50:04 +02:00
|
|
|
|
2025-06-15 09:34:45 +02:00
|
|
|
git clone https://github.com/MicroPythonOS/lvgl_micropython
|
2025-04-30 13:50:04 +02:00
|
|
|
|
2025-06-15 09:34:45 +02:00
|
|
|
git clone https://github.com/MicroPythonOS/secp256k1-embedded-ecdh
|
2025-04-30 13:58:27 +02:00
|
|
|
```
|
2025-04-30 13:50:04 +02:00
|
|
|
|
2025-06-15 09:34:45 +02:00
|
|
|
|
|
|
|
|
Start the build for ESP32:
|
2025-04-30 13:58:27 +02:00
|
|
|
|
|
|
|
|
```
|
2025-06-15 09:34:45 +02:00
|
|
|
cd ~/projects/MicroPythonOS/MicroPythonOS
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
./scripts/build_lvgl_micropython.sh esp32 prod
|
2025-04-30 13:58:27 +02:00
|
|
|
```
|
|
|
|
|
|
2025-05-07 10:27:03 +02:00
|
|
|
Or if you want to build for development, so without any preinstalled files, do:
|
|
|
|
|
|
|
|
|
|
```
|
2025-06-15 09:34:45 +02:00
|
|
|
./scripts/build_lvgl_micropython.sh esp32 dev
|
2025-05-07 10:27:03 +02:00
|
|
|
```
|
|
|
|
|
|
2025-06-15 09:34:45 +02:00
|
|
|
Now make sure your ESP32 is in bootloader mode (long-press the BOOT button if you're already running MicroPythonOS) and install it with:
|
2025-04-30 13:58:27 +02:00
|
|
|
|
|
|
|
|
```
|
2025-06-15 09:34:45 +02:00
|
|
|
./scripts/flash_over_usb.sh
|
2025-04-30 13:58:27 +02:00
|
|
|
```
|
2025-05-07 10:27:03 +02:00
|
|
|
|
|
|
|
|
If you made a 'devbuild', then you probably want to install all files and apps manually:
|
|
|
|
|
|
|
|
|
|
```
|
2025-06-15 09:34:45 +02:00
|
|
|
./scripts/install.sh
|
2025-05-07 10:27:03 +02:00
|
|
|
```
|
|
|
|
|
|
2025-05-08 13:07:17 +02:00
|
|
|
Release checklist
|
|
|
|
|
=================
|
2025-06-17 18:20:20 +02:00
|
|
|
- Make sure CURRENT_OS_VERSION in internal_filesystem/lib/mpos/info.py is incremented
|
2025-06-13 15:04:24 +02:00
|
|
|
- Make sure version numbers of apps that have been changed are incremented:
|
2025-06-16 21:45:05 +02:00
|
|
|
```
|
2025-06-17 18:20:20 +02:00
|
|
|
git diff --stat 0.0.4 internal_filesyste/ # see everything that changed since tag 0.0.4
|
2025-06-16 21:45:05 +02:00
|
|
|
git diff 0.0.4 -- internal_filesystem/apps/*/META-INF/* # list manifests that might have already had their version number incremented
|
|
|
|
|
git diff 0.0.4 -- internal_filesystem/builtin/apps/*/META-INF/* # list manifests that might have already had their version number incremented
|
|
|
|
|
```
|
2025-06-13 15:09:14 +02:00
|
|
|
- Update CHANGELOG
|
2025-06-16 21:45:05 +02:00
|
|
|
- commit all code
|
2025-06-16 21:48:09 +02:00
|
|
|
- tag -a the main repo and external repo's like LightningPiggy
|
2025-06-16 21:45:05 +02:00
|
|
|
- git push --tags
|
2025-05-08 13:07:17 +02:00
|
|
|
- ./scripts/bundle_apps.sh
|
2025-06-13 15:04:24 +02:00
|
|
|
- ./scripts/build_lvgl_micropython.sh esp32 prod
|
2025-06-13 15:20:47 +02:00
|
|
|
- ./scripts/release_to_updates.sh
|
|
|
|
|
- ./scripts/release_to_install.sh
|
2025-05-10 17:44:31 +02:00
|
|
|
|
|
|
|
|
Building for desktop
|
|
|
|
|
====================
|
|
|
|
|
Building to run as an app on the Linux desktop or MacOS (untested) is supported.
|
|
|
|
|
|
2025-05-13 16:12:21 +02:00
|
|
|
To do so, make sure you have the necessary dependencies:
|
2025-06-15 09:34:45 +02:00
|
|
|
- see https://github.com/MicroPythonOS/lvgl-micropython/
|
2025-05-13 16:12:21 +02:00
|
|
|
- sudo apt install libv4l-dev # for webcam.c
|
|
|
|
|
|
2025-05-10 17:44:31 +02:00
|
|
|
```
|
2025-06-15 09:34:45 +02:00
|
|
|
cd ~/projects/MicroPythonOS/MicroPythonOS/
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
./scripts/build_lvgl_micropython.sh unix dev
|
2025-05-10 17:44:31 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
or
|
|
|
|
|
|
|
|
|
|
```
|
2025-06-15 09:34:45 +02:00
|
|
|
./scripts/build_lvgl_micropython.sh macOS dev
|
2025-05-10 17:44:31 +02:00
|
|
|
```
|
|
|
|
|
|
2025-06-17 19:05:42 +02:00
|
|
|
# Running on desktop
|
|
|
|
|
|
|
|
|
|
Either build it yourself, or download the latest release, for example: MicroPythonOS_amd64_Linux_0.0.6
|
|
|
|
|
|
2025-05-10 17:44:31 +02:00
|
|
|
Then to run it, do:
|
|
|
|
|
|
|
|
|
|
```
|
2025-06-17 19:05:42 +02:00
|
|
|
cd internal_filesystem/
|
|
|
|
|
/path/to/MicroPythonOS_amd64_Linux_0.0.6 -X heapsize=32M -v -i -c "$(cat boot_unix.py main.py)"
|
2025-05-10 17:44:31 +02:00
|
|
|
```
|
2025-06-17 19:05:42 +02:00
|
|
|
|
|
|
|
|
Also take a look at scripts/run_on_desktop.sh for tips on how to run fullscreen or to immediately start an app, for quick development.
|