|
1 | | -MicroPythonOS |
2 | | -======= |
| 1 | +Main repository for MicroPythonOS. |
3 | 2 |
|
4 | | -This is an operating system for microcontrollers like the ESP32. |
5 | | - |
6 | | -It's written entirely in MicroPython, including device drivers, interrupt handlers, boot code, multitasking, display handling. |
7 | | - |
8 | | -The architecure is inspired by the Android operating system for smartphones: |
9 | | -- 'thin' operating system with facilities for apps |
10 | | -- 'everything is an app' idea |
11 | | -- making it as simple as possible for developers to build new apps |
12 | | - |
13 | | -##Installation |
14 | | - |
15 | | -Seehttps://install.MicroPythonOS.com |
16 | | - |
17 | | -##Apps |
18 | | - |
19 | | -The operating system comes with a few apps built-in that are necessary to bootstrap: |
20 | | -- launcher: to be able to start apps |
21 | | -- wificonf: to be able to connect to the wifi |
22 | | -- appstore: to be able to download and install new apps |
23 | | -- osupdate: to download and install operating system updates |
24 | | - |
25 | | -Other apps are available in the AppStore. |
26 | | - |
27 | | -Seehttps://apps.MicroPythonOS.com/ |
28 | | - |
29 | | -##Supported hardware |
30 | | - |
31 | | -###ESP32 computers |
32 | | --https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-2 |
33 | | - |
34 | | -###Desktop computers |
35 | | -- Linux desktop (uses SDL) |
36 | | -- MacOS should work. Untested. |
37 | | - |
38 | | -###Raspberry Pi |
39 | | -- Should work, especially if it's running a Linux desktop like Raspbian. Untested. |
40 | | - |
41 | | -##Architecture |
42 | | - |
43 | | -- boot.py: initializes the hardware on ESP32 / boot_unix.py: initializes the hardware on linux desktop |
44 | | -- main.py: initializes the User Interface, contains helper functions for apps, and starts the launcher app |
45 | | - |
46 | | -##Filesystem layout: |
47 | | - |
48 | | -- /apps: new apps are downloaded and installed here |
49 | | -- /apps/com.example.app1: example app1 installation directory |
50 | | -- /apps/com.example.app1/MANIFEST.MF: info about app1 such as Name, Start-Script |
51 | | -- /apps/com.example.app1/mipmap-mdpi: medium dpi images for app1 |
52 | | -- /apps/com.example.app1/mipmap-mdpi/icon_64x64.bin: icon for app1 (64x64 pixels) |
53 | | -- /builtin/: read-only filesystem that's compiled in and mounted at boot by main.py |
54 | | -- /builtin/apps: apps that are builtin and necessary for minimal facilities (launcher, wificonf, appstore etc) |
55 | | -- /builtin/res/mipmap-mdpi/default_icon_64x64.bin: default icon for apps that don't have one |
56 | | -- /data/: place where apps store their data |
57 | | -- /data/images/: place where apps (like the camera) store their images |
58 | | -- /data/com.example.app1/: storage (usually config.json) specific to com.example.app1 |
59 | | - |
60 | | -#Building |
61 | | - |
62 | | -Prepare all the sources: |
63 | | - |
64 | | -``` |
65 | | -mkdir ~/MicroPythonOS |
66 | | -cd ~/MicroPythonOS |
67 | | -
|
68 | | -git clone https://github.com/MicroPythonOS/MicroPythonOS.git |
69 | | -
|
70 | | -git clone https://github.com/MicroPythonOS/freezeFS |
71 | | -
|
72 | | -git clone https://github.com/cnadler86/micropython-camera-API |
73 | | -echo 'include("~/MicroPythonOS/lvgl_micropython/build/manifest.py")' >> micropython-camera-API/src/manifest.py |
74 | | -
|
75 | | -git clone https://github.com/MicroPythonOS/lvgl_micropython |
76 | | -
|
77 | | -git clone https://github.com/MicroPythonOS/secp256k1-embedded-ecdh |
78 | | -``` |
79 | | - |
80 | | - |
81 | | -Start the build for ESP32: |
82 | | - |
83 | | -``` |
84 | | -cd ~/projects/MicroPythonOS/MicroPythonOS |
85 | | -``` |
86 | | - |
87 | | - |
88 | | -``` |
89 | | -./scripts/build_lvgl_micropython.sh esp32 prod |
90 | | -``` |
91 | | - |
92 | | -Or if you want to build for development, so without any preinstalled files, do: |
93 | | - |
94 | | -``` |
95 | | -./scripts/build_lvgl_micropython.sh esp32 dev |
96 | | -``` |
97 | | - |
98 | | -Now make sure your ESP32 is in bootloader mode (long-press the BOOT button if you're already running MicroPythonOS) and install it with: |
99 | | - |
100 | | -``` |
101 | | -./scripts/flash_over_usb.sh |
102 | | -``` |
103 | | - |
104 | | -If you made a 'devbuild', then you probably want to install all files and apps manually: |
105 | | - |
106 | | -``` |
107 | | -./scripts/install.sh |
108 | | -``` |
109 | | - |
110 | | -Release checklist |
111 | | -================= |
112 | | -- Make sure CURRENT_OS_VERSION in internal_filesystem/lib/mpos/info.py is incremented |
113 | | -- Make sure version numbers of apps that have been changed are incremented: |
114 | | -``` |
115 | | -git diff --stat 0.0.4 internal_filesyste/ # see everything that changed since tag 0.0.4 |
116 | | -git diff 0.0.4 -- internal_filesystem/apps/*/META-INF/* # list manifests that might have already had their version number incremented |
117 | | -git diff 0.0.4 -- internal_filesystem/builtin/apps/*/META-INF/* # list manifests that might have already had their version number incremented |
118 | | -``` |
119 | | -- Update CHANGELOG |
120 | | -- commit all code |
121 | | -- tag -a the main repo and external repo's like LightningPiggy |
122 | | -- git push --tags |
123 | | -- ./scripts/bundle_apps.sh |
124 | | -- ./scripts/build_lvgl_micropython.sh esp32 prod |
125 | | -- ./scripts/release_to_updates.sh |
126 | | -- ./scripts/release_to_install.sh |
127 | | - |
128 | | -Building for desktop |
129 | | -==================== |
130 | | -Building to run as an app on the Linux desktop or MacOS (untested) is supported. |
131 | | - |
132 | | -To do so, make sure you have the necessary dependencies: |
133 | | -- seehttps://github.com/MicroPythonOS/lvgl-micropython/ |
134 | | -- sudo apt install libv4l-dev # for webcam.c |
135 | | - |
136 | | -``` |
137 | | -cd ~/projects/MicroPythonOS/MicroPythonOS/ |
138 | | -
|
139 | | -``` |
140 | | -./scripts/build_lvgl_micropython.sh unix dev |
141 | | -``` |
142 | | -
|
143 | | -or |
144 | | -
|
145 | | -``` |
146 | | -./scripts/build_lvgl_micropython.sh macOS dev |
147 | | -``` |
148 | | -
|
149 | | -# Running on desktop |
150 | | -
|
151 | | -Either build it yourself, or download the latest release, for example: MicroPythonOS_amd64_Linux_0.0.6 |
152 | | -
|
153 | | -Then to run it, do: |
154 | | -
|
155 | | -``` |
156 | | -cd internal_filesystem/ |
157 | | -/path/to/MicroPythonOS_amd64_Linux_0.0.6 -X heapsize=32M -v -i -c "$(cat boot_unix.py main.py)" |
158 | | -``` |
159 | | -
|
160 | | -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. |
| 3 | +Seehttps://MicroPythonOS.com/ andhttps://docs.MicroPythonOS.com/ |