Apps from the SD card: Lua Apps with an API to our services and widgets #13
Open
opened 2026-10-05 09:59:35 +00:00 by twisla
·
0 comments
No Branch/Tag Specified
main
badges
ci-speed
keys-tables
help-key
devlog-console
console-setting
site-dev
site-howto
site-devlog
site-guide
site-security-txt
site
fix-release-polish
gitea-updates
coverage
ci
notes
f1
s1
m3
g1
m2
ota
v0.13.0
v0.12.0
v0.11.0
v0.10.0
v0.9.0
v0.8.1
v0.8.0
v0.7.0
v0.6.1
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.1
v0.2.0
v0.1.0
Labels
Clear labels
area/apps
area/audio
area/build
area/cluster
area/gemini
area/gitea
area/gnss
area/ir
area/irc
area/lora
area/ota-debug
area/power
area/scripting
area/ssh
area/storage
area/ui
area/vpn
area/website
area/wifi
concern/memory
concern/security
Launcher and the apps in src/apps
Microphone, speaker, the codec, recording and playback
PlatformIO, Docker, scripts, partitions, sdkconfig
AtomS3 co-processors on Grove and the link protocol
GeminiService, the Gemini App, Saved Pages
The Gitea client: issues, releases, its TLS and its token
GnssService, the GNSS App, Tracks
The infrared LED and the IR Remote
IrcService and the IRC App
The Cap LoRa-1262 radio and the mesh
Updates, Probation, Safe Mode, Debug Console, crash reports
Battery, PowerService, sleep
Lua Apps from the SD card and their API
The SSH client and its terminal
StorageService, the SD card, Storage page
Canvas, widgets, dialogs, Toasts, fonts, keyboard
The WireGuard tunnel
The project website and its docs
WifiService, Wi-Fi Settings, Wi-Fi Tools
May push the heap towards its floors; measure on the device
TLS, signing, the debug token, trust on first use
kind
bug
Something that doesn't work as it should
kind
chore
Refactors, tooling, CI, scripts
kind
docs
README, CONTEXT, milestones, ADRs
kind
feature
Something new the device can do
priority
high
Next up
priority
low
Some day
priority
medium
Soon
status
blocked
Waiting on something else
status
needs-design
Needs a question round (Qnn) before code
status
ready
Designed; can be started
Milestone
No items
No Milestone
P1 Platform
Assignees
twisla (Clément Martin)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: twisla/roro9stack#13
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Idea
Run extra Apps from the SD card, written in Lua. Each one appears in the Launcher next to the built-in Apps. Through a documented API it can use the firmware's services (storage, clock, network, GNSS…) and widgets (lists, dialogs, Toasts, text entry, the canvas). New Apps no longer need a firmware build.
Why
What's known
The language.
Memory is the main risk, and Lua makes it controllable.
lua_newstatetakes an allocator, so each App can get a budget, for example 24 KB. The allocator refuses anything that would push the heap below the Q86 floors.Runaway code.
lua_sethook) stops a callback that takes too long, before the main loop's 5 s watchdog fires.pcalland shown, with the line number, on a screen like Safe Mode's, not as a reboot.How it fits the App model.
onEnter,onKey,update,draw) maps to Lua functions.LuaAppadapter, written in C++, hosts one script and forwards the calls.The API, by module (to be decided):
ui: text, shapes and theme colours on the canvas; lists, dialogs, Toasts, text entry.keys.storage: files limited to the App's own folder (/apps/<name>/), through StorageService's task.settings: per App, in its own NVS namespace or a file.clock.net: HTTP(S) and Gemini fetches through the services, with their floors.gnss: position, behind a permission.irc: send and receive, maybe.sys: version, heap, battery.The API needs a version number, and an App says which version it needs.
The sandbox and permissions.
io,osanddebuglibraries aren't loaded. Everything goes through our API.Packaging.
/apps/<name>/holdsapp.tomlormanifest.lua(name, version, API version, permissions),main.lua, and an icon for the Launcher tiles (#9).put.Development. In Debug Builds, a Lua REPL over the Debug Console would make writing Apps fast: edit on a computer, push, reload, all without unplugging. That's the same over-the-air spirit as the OTA work.
Flash. About 150 KB for Lua and the bindings. The firmware is 1.71 MB of 3.3 MB, so there's room.
Questions for the design round
ui,keys,storageandclock, with network later.Related
lib/core/src/app.handlib/core/src/app_manager.h(the App interface),src/services/storage_service.cpp,src/ui/theme.h,docs/milestones/G1.md(Q86 floors), and #1, #2, #3, #4, #8, #9, #10, #12.