mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-08-03 17:30:14 +00:00
The previous hardcoded LAN IP in platformio.ini identified a specific
deployment (Mac rnsd at a 10.0.0.x address). Move host:port to env
vars read at build time via PIO's ${sysenv.X} interpolation, with
a .env.example template + .env gitignored. Production builds (no
PYXIS_TEST_HOOKS) skip the macros entirely.
Changes:
- platformio.ini (both env blocks): replace literal IP/port with
${sysenv.PYXIS_TEST_TCP_HOST} / ${sysenv.PYXIS_TEST_TCP_PORT}.
Both quoted so an unset env var expands to an empty string
literal "" rather than an empty token (the latter would break
the PORT > 0 numeric compare in main.cpp).
- src/main.cpp test-hooks block: guard host/port assignment so
empty values fall back to NVS-stored settings. atoi() handles
the port string side. Missing env var won't silently brick
test mode — it just becomes "use whatever's in NVS".
- .env.example: checked-in template with placeholder values
(TEST-NET-1 192.0.2.x range, not a real LAN IP).
- .gitignore: add `.env` so the populated local copy stays out
of source.
Build: verified clean with env vars UNSET (NVS-fallback path) and
SET (override path); 27.4% RAM, 79.8% Flash in both cases.
18 lines
638 B
Bash
18 lines
638 B
Bash
# Pyxis test-mode environment overrides.
|
|
#
|
|
# Copy to `.env` (gitignored) and customize. Source before `pio run`:
|
|
#
|
|
# source .env && pio run -e tdeck
|
|
#
|
|
# Only consumed when the firmware is built with -DPYXIS_TEST_HOOKS
|
|
# (production/release builds ignore these entirely). If left unset
|
|
# but PYXIS_TEST_HOOKS is on, main.cpp falls back to NVS-stored
|
|
# TCP settings — so a missing var doesn't silently brick test mode.
|
|
|
|
# IP / hostname of the Mac (or any host) running rnsd with a
|
|
# TCPServerInterface that pyxis should dial.
|
|
export PYXIS_TEST_TCP_HOST=192.0.2.1
|
|
|
|
# Port the rnsd listener is bound to.
|
|
export PYXIS_TEST_TCP_PORT=4242
|