This repository contains the Lua version of Jangala's devicecode, the
program that powers our Big Box and Get Box devices.
Use the devcontainer for dependencies (see .devcontainer/devcontainer.json).
Runtime entrypoint is src/main.lua.
For on-box runs, copy both src/ and vendor/ to the target, then run devicecode from inside src/.
DEVICECODE_SERVICES: Comma-separated services to start (example:hal,config,monitor).DEVICECODE_CONFIG_DIR: Directory that contains<CONFIG_TARGET>.jsonused at startup by HAL.CONFIG_TARGET: Base filename (without.json) for the config blob consumed by the config service.
DEVICECODE_ENV:devorprod(defaults todev).
Run from src/ so Lua module paths resolve correctly:
cd src
DEVICECODE_ENV=dev \
DEVICECODE_SERVICES='hal,config,monitor' \
DEVICECODE_CONFIG_DIR=/path/to/config/dir \
CONFIG_TARGET=config \
luajit main.luaRun make build-all to copy sources into build/ and inject secrets into config files.
Config files under src/configs/ may contain $VAR placeholders for sensitive values (credentials, URLs, etc.). During make build-all, these are replaced in the build output only — src/ is never modified.
Create .env.secret in the repository root with the following keys:
SWITCH_USERNAME=
SWITCH_PASSWORD=
UNIFI_ADDRESS=
CLOUD_URL=
.env.secret is listed in .gitignore and must never be committed. If the file is absent, make build-all will print a warning and leave placeholders unreplaced.
lua-fibers: v0.8.1
lua-trie: v0.3
lua-bus: v0.4