Documentation

RPCortex Nebula v0.8.1-beta2  •  Full reference for the shell, commands, registry, and hardware

Getting Started

What you need:

Thonny note: Thonny's built-in REPL works for basic use, but arrow key navigation, history, and the editor all require a proper terminal emulator. Use PuTTY for the full experience.

Installation

  1. Flash MicroPython to your board
  2. Copy all files from the repo to the root of the board's filesystem
  3. Connect your serial terminal at 115200 baud
  4. Reboot — main.py starts automatically on power-up

First boot

A setup wizard runs on first boot:

  1. You set the root password (the administrator account)
  2. You choose whether to enable verbose boot (detailed POST messages on each startup)
  3. A guest account is created automatically — it accepts any password including blank

The official package repo is added automatically. Run pkg update after first boot to fetch the package list.

After that, log in and you're at the shell prompt. The wizard only runs once.

Boot Sequence

main.py
  └── Core/post.py              POST: hardware checks, registry, WiFi
       └── Core/initialization.py   reads startup mode, runs login loop
            └── Core/launchpad.py   launchpad_init -- the interactive shell

If initialization fails, recovery_init() starts an unauthenticated shell so you can diagnose the problem. The recovery shell has access to all the same commands.

The Shell

The shell prompt format is:

username@nebula:~>
username@nebula:~/docs>
username@nebula:/Core>

~ is shorthand for the user's home directory (/Users/<username>/). The shell starts there on login. cd ~ and bare cd both return home.

Keyboard shortcuts

KeyAction
Up / DownScroll command history (last 50)
Left / RightMove cursor within the line
Home / Ctrl+AJump to beginning of line
End / Ctrl+EJump to end of line
DeleteDelete character under cursor
BackspaceDelete character before cursor
Ctrl+CCancel current input

Characters are inserted at the cursor position — you can edit anywhere in the line, not just at the end.

Command loading

Built-in commands (sys_fs, sys_sys, sys_net, sys_user, wifi, settings) are loaded via __import__() and live in sys.modules permanently. After a cache clear they reload for free — no re-reading or recompiling. Package-installed commands use a separate exec-based path.

Critical commands

reboot, sreboot, freeup, and gc are implemented as inline functions that bypass the loader entirely. They always work regardless of heap state.

Heap management

The RP2040 has 264 KB of RAM. After loading several commands or running HTTPS requests, the heap may become fragmented — gc.mem_free() can show 90 KB free while a MemoryError still occurs, because no single contiguous block is large enough for a new allocation. Run freeup to compact the heap. The shell also automatically retries after a cache clear on MemoryError.

Filesystem Commands

CommandDescription
ls [path]List directory — type, size, modification time, name
cd <path>Change directory. cd, cd ~, and cd ~/sub all work
pwdPrint working directory
mkdir <path>Create directory
rm <path>Remove file or directory (recursive for directories)
touch <file>Create an empty file
read <file>Print file contents
head <file> [n]First n lines (default 10)
tail <file> [n]Last n lines (default 10)
mv <src> <dst>Move or rename
cp <src> <dst>Copy file
rename <old> <new>Rename in place
dfFlash usage: total, used, free
tree [path]Recursive directory listing
exec <file>Run a Python file directly

System Commands

CommandDescription
sysinfoOS version, user, CPU, RAM, flash summary
meminfoDetailed RAM breakdown
uptimeTime since last boot
dateCurrent date/time from RTC
verOS version string
clear / clsClear the terminal
fetch / neofetchSystem info display with ASCII logo
rebootHard reset
sreboot / softresetSoft reset (faster, keeps filesystem)
freeup / gcClear command cache, run GC, report RAM freed
echo <text>Print text
historyShow command history
env [section]Dump registry contents
reg get <key>Read a registry key
reg set <key> <val>Write a registry key
settingsOpen the settings panel
edit [file]Open the built-in editor
benchRun the NebulaMark benchmark

pulse subcommands

CommandDescription
pulse statusShow clock info (current freq, boot OC state)
pulse set <MHz>Set CPU frequency for this session (e.g. pulse set 220)
pulse min <MHz>Save minimum clock value (e.g. pulse min 30)
pulse max <MHz>Save maximum clock value (e.g. pulse max 220)
pulse boot <MHz>Set boot clock and enable OC on boot (e.g. pulse boot 200)
pulse boot on|offEnable or disable boot overclock
Overclock note: POST calibration stores 220 MHz as the safe max for RP2040/RP2350. You can set any value manually with pulse set <MHz> — a warning is shown above 220 MHz, but the clock is set regardless. Stability beyond 220 MHz is not guaranteed.

OS Management

These commands manage the OS itself — updates, factory reset, and full reinstall.

update from-file

Extracts a .rpc release archive to the running OS:

update from-file /path/to/os.rpc
Browser update: You can also update from the browser at rpc.novalabs.app/update.html — no WiFi required on the device. The page transfers the archive over the serial connection.

factoryreset

Soft reset — restores the OS to a clean first-run state while keeping core files intact:

factoryreset

reinstall

Full OS wipe — deletes everything and writes a self-contained reinstall stub:

reinstall                      # wipe and show Web Installer instructions
reinstall /path/to/os.rpc      # wipe and stage .rpc for auto-install on boot

User Management

CommandDescription
whoamiCurrent logged-in user
mkacctCreate a new account (prompts for username and password)
rmuser <user>Delete an account. Non-root users must verify the target's password first.
chpswd <user>Change a password
logout / exitEnd session, return to login

Account details

Networking

WiFi works on any board with a network module: Pico W, Pico 2 W, and most ESP32 variants.

WiFi commands

CommandDescription
wifi statusConnection state, SSID, IP
wifi scanNearby networks with signal strength
wifi connect [ssid]Connect (prompts for password; uses saved if available)
wifi disconnectDrop the current connection
wifi listSaved networks
wifi add <ssid>Save a network
wifi forget <ssid>Remove a saved network

Up to 2 networks can be saved. Enable autoconnect on boot:

reg set Settings.Network_Autoconnect true

Or toggle it in settings.

Download commands

CommandDescription
wget <url> [file]Download to flash — streams directly, no full-file RAM load
curl <url> [-v]Fetch and print response body
runurl <url> [--keep]Fetch and execute a Python file; deletes after unless --keep
ping <host> [n]TCP connectivity test
nslookup <host>DNS lookup

Both HTTP and HTTPS are supported. The client follows redirects iteratively with a 15-second socket timeout.

HTTPS on Pico 1 W: TLS needs ~9.5 KB contiguous heap. Run freeup before network-heavy work, or use HTTPS from a fresh boot. If your host uses Cloudflare's "Always Use HTTPS" redirect, HTTP requests will be 301'd and may hit this limit. Use https:// URLs directly or disable that Cloudflare setting for your repo host.

Package Manager

Packages are .pkg files: standard ZIP archives with a package.cfg metadata file inside.

Package metadata (package.cfg)

KeyDescription
pkg.nameDisplay name
pkg.devAuthor
pkg.verVersion string
pkg.dirInstall path (e.g. /Packages/HelloWorld)
pkg.descShort description
pkg.cmdShell command: name:/path/handler.py:function

Commands

CommandDescription
pkg availableList all packages in the repo cache
pkg search <query>Search cache by name or description
pkg install <name>Install from repo cache
pkg install <file.pkg>Install a local archive
pkg remove <name>Uninstall
pkg listInstalled packages
pkg info <name>Details for an installed package
pkg updateRefresh repo indexes from the network
pkg upgradeUpgrade installed packages that have newer versions in cache
pkg repo listConfigured repo URLs
pkg repo add <url>Add a repo
pkg repo remove <url>Remove a repo

Commands installed by packages are available immediately after install. They vanish immediately after removal. No reboot required either way.

Quick start

pkg repo add http://rpc.novalabs.app/repo/index.json
pkg update
pkg available
pkg install HelloWorld

Repo index format

Repos are JSON files hosted anywhere (GitHub raw URLs work):

{
  "name": "My Repo",
  "packages": [
    {
      "name": "HelloWorld",
      "ver": "1.0.0",
      "author": "dash1101",
      "desc": "Sample package",
      "url": "https://..."
    }
  ]
}

Building packages

repo/make_pkg.py is a PC-side script that builds a .pkg from a source directory:

python make_pkg.py MyPackage/

Packages must use ZIP_STORED (no compression) — make_pkg.py handles this automatically. If you build with a standard ZIP tool using deflate, install will fail unless the target firmware has zlib.

Full package development guide →

Web Tools

Three browser-based tools let you interact with a connected device over USB — no WiFi, no raw REPL required. All use the Web Serial API (Chromium-based browsers: Chrome, Edge).

Web Installer

Flash MicroPython and copy RPCortex to the board directly from your browser. No software to install.

Package Browser

Browse and install packages while the device is running the shell. Files are pushed via the _xfer serial protocol. One-click install, no reboot needed, no WiFi required on the device.

OS Update

Update RPCortex from a browser tab while the shell is running. Load a .rpc archive from your computer or pick a version from the server. The page reads the archive with JSZip, skips user data paths, pushes each file via _xfer, and sends reboot when done.

Editor

The built-in terminal editor is invoked with:

edit myfile.py
nano /Core/somefile.py
vi                         # scratch buffer, no file

Controls

KeyAction
Arrow keysMove cursor
Ctrl+SSave
Ctrl+QQuit
Ctrl+XSave and quit
Ctrl+KCut line
Ctrl+UPaste line
Ctrl+FFind
Ctrl+GGo to line number
Requires a real terminal emulator. Thonny's REPL doesn't render ANSI escape sequences correctly.

Settings Panel

Run settings to open an interactive panel:

┌───────────────────────────────────────────────────────────────┐
│  RPCortex Settings               125 MHz  27.4C  92 KB      │
├───────────────────────────────────────────────────────────────┤
│                                                              │
│  SYSTEM                                                      │
│  [1] Verbose Boot         : OFF                              │
│  [2] Program Execution    : ON                               │
│                                                              │
│  HARDWARE                                                    │
│  [3] Boot Overclock       : OFF                              │
│  [4] Beeper               : OFF                              │
│  [5] SD Card Support      : OFF                              │
│                                                              │
│  NETWORK                                                     │
│  [6] WiFi Autoconnect     : ON                               │
│                                                              │
│  [1-6] toggle   [r] refresh   [q] quit                       │
│                                                              │
└───────────────────────────────────────────────────────────────┘

[1–6] toggle the setting. [r] refreshes the display. [q] exits.

Settings reference

#SettingRegistry key
1Verbose BootSettings.Verbose_Boot
2Program ExecutionFeatures.Program_Execution
3Boot OverclockSettings.OC_On_Boot
4BeeperFeatures.beeper
5SD Card SupportFeatures.SD_Support
6WiFi AutoconnectSettings.Network_Autoconnect

Registry

The registry lives at /Nebula/Registry/registry.cfg as a plain INI file. It's created from an embedded template on first boot if missing.

[Settings]

KeyValuesDescription
Setuptrue/falseFirst-run wizard completed
OC_On_Boottrue/falseApply max clock on every boot
Verbose_Boottrue/falseShow POST info messages
Network_Autoconnecttrue/falseWiFi autoconnect on boot
Active_UserstringCurrent session user
Startup0 / 1 / 3 / 6 / 7Boot state sentinel. 0 = clean, 1 = session active, 3 = update crashed, 6 = clock calibration crashed, 7 = boot clock crashed
VersionstringOS version
NotestringOne-shot post-action notification. Set to "update_ok" after a successful update; displayed at next login then cleared.

[Hardware]

KeyDescription
Clockabletrue after clock calibration completes
Min_ClockMinimum safe CPU clock (e.g. 30.0MHz)
Max_ClockMaximum safe CPU clock (e.g. 220.0MHz)
Boot_ClockSpecific boot clock override (blank = use Max_Clock)
beeper_pinGPIO pin for beeper, or None

[Networks]

WiFi credentials for up to 2 saved networks. Keys are created dynamically when you save a network.

[Features]

KeyDefaultDescription
Program_ExecutiontrueAllow running scripts with exec
SerialtrueSerial interface active
SD_SupportfalseSD card (not yet implemented)
NovafalseNova GUI (future)

Shell access

reg get Settings.OC_On_Boot        # read a key
reg set Settings.OC_On_Boot true   # write a key
env                                 # dump all sections
env Settings                        # dump one section

POST

POST runs on every boot before the login prompt. It prints status for each check and stops if a critical check fails.

CheckCriticalNotes
RegistryYesCreates registry from template if missing
CPU arithmeticYesFloat, int, comparison, bitwise
RAMYesAllocates a buffer and verifies a write pattern
Clock calibrationNoRuns once; RP2 gets 220 MHz max without probing
WLANNoChecks for WiFi hardware; autoconnects if configured
BeeperNoInitializes GPIO beeper if configured

Session Logging

Every session is logged to /Nebula/Logs/latest.log. The log captures everything printed through the OS output functions (ok, info, warn, error, fatal).

Log rotation on each boot:

latest.log -> log_1.log -> log_2.log -> ... -> log_9.log (dropped)

Up to 10 logs are kept. The /Nebula/Logs/ directory is created automatically by POST on first boot. You don't need to create it manually.

Hardware & Performance

Overclocking

RPCortex detects the CPU's safe clock range on first boot. For RP2040/RP2350 the stored max is 220 MHz.

pulse set 220      # set CPU to 220 MHz for this session
pulse set 240      # overclock beyond safe default (warning shown)
pulse boot on      # apply on every boot
settings           # toggle via settings panel

Manual overclock beyond 220 MHz is allowed. A warning is shown but the clock is set to whatever you specify. The RP2040 is generally stable up to around 240–250 MHz with the right flash timing.

NebulaMark

bench runs the NebulaMark suite: integer ops, floating-point ops, Mandelbrot iteration, and Pi approximation. Results are printed as calculation times in milliseconds.

Heap and fragmentation

freeup clears the command cache and runs garbage collection. Use it before heavy network operations or when you get a MemoryError despite apparent free RAM. meminfo shows the current heap state.

Supported Hardware

BoardStatusRAM
Raspberry Pi Pico 2 W (RP2350 + WiFi)Recommended520 KB
ESP32-S3RecommendedVaries
Raspberry Pi Pico (RP2040)Supported264 KB
Raspberry Pi Pico W (RP2040 + WiFi)Supported264 KB
Raspberry Pi Pico 2 (RP2350)Supported520 KB
ESP32 / ESP32-S2SupportedVaries

MicroPython v1.20 or newer  •  4 MB flash recommended  •  256 KB+ RAM  •  Serial terminal at 115200 baud

Security

Known Limitations

RPCortex Nebula v0.8.1-beta2  •  by dash1101