correct conf

This commit is contained in:
ordinarthur 2026-04-13 23:27:18 +02:00
parent 1b9be90018
commit 99a39e5d08
11 changed files with 91 additions and 6 deletions

View File

@ -32,7 +32,7 @@ jobs:
- name: Prepare pi-gen stage files
run: |
STAGE_FILES="tools/pi-gen-tipote/stage-tipote/01-install-tipote/files"
STAGE_FILES="tools/pi-gen-tipote/stage3/01-install-tipote/files"
rm -rf "$STAGE_FILES"
mkdir -p "$STAGE_FILES"

View File

@ -19,9 +19,9 @@ RUN git clone --depth 1 --branch bookworm https://github.com/RPi-Distro/pi-gen.g
# Copy config and stage
COPY config /build/pi-gen/config
COPY stage-tipote/ /build/pi-gen/stage-tipote/
COPY stage3/ /build/pi-gen/stage3/
# Skip stage2 image export (we export from stage-tipote)
# Skip stage2 image export (we export from stage3)
RUN touch /build/pi-gen/stage2/SKIP_IMAGES
# Patch pi-gen for Docker compatibility:

View File

@ -10,4 +10,4 @@ TIMEZONE_DEFAULT=Europe/Paris
ENABLE_SSH=1
# Only run base stages + our custom stage (skip desktop/apps)
STAGE_LIST="stage0 stage1 stage2 stage-tipote"
STAGE_LIST="stage0 stage1 stage2 stage3"

View File

@ -61,8 +61,9 @@ $SSH "echo 'SSH OK — $(uname -m) — $(cat /etc/os-release | grep PRETTY_NAME
echo "▸ [3/7] Installing system dependencies..."
$SSH "sudo apt-get update -qq && sudo apt-get install -y -qq \
python3 python3-venv python3-pip \
portaudio19-dev libatlas-base-dev alsa-utils \
network-manager curl"
portaudio19-dev alsa-utils \
network-manager curl \
libsystemd-dev build-essential"
# Install Node.js 22 if not present
$SSH "node --version 2>/dev/null | grep -q 'v22' || {

View File

@ -0,0 +1,6 @@
# /etc/systemd/journald.conf.d/tipote.conf
# Limit journal size on Pi Zero 2W (32GB SD card)
[Journal]
SystemMaxUse=50M
SystemMaxFileSize=10M
MaxRetentionSec=7day

View File

@ -0,0 +1,41 @@
{
"name": "@ti-pote/robot-client",
"version": "0.0.1",
"private": true,
"type": "module",
"description": "Ti-Pote Robot Client — Runs on Raspberry Pi Zero 2W",
"bin": {
"tipote": "./dist/cli.js"
},
"scripts": {
"dev": "tsx watch src/main.ts",
"build": "tsup src/main.ts src/cli.ts --format esm --dts --clean",
"start": "node dist/main.js",
"lint": "eslint \"src/**/*.ts\" --fix",
"format": "prettier --write \"src/**/*.ts\"",
"test": "vitest run",
"test:watch": "vitest",
"hw:demo": "pnpm exec tsx scripts/hardware-demo.ts",
"audio:loopback": "pnpm exec tsx scripts/audio-loopback.ts",
"audio:beep": "pnpm exec tsx scripts/audio-beep.ts",
"esp:record": "pnpm exec tsx ../robot-hardware/scripts/esp-record.ts",
"esp:play": "pnpm exec tsx ../robot-hardware/scripts/esp-play.ts"
},
"dependencies": {
"socket.io-client": "^4.8.3",
"dotenv": "^17.3.1",
"pino": "^9.6.0",
"pino-pretty": "^13.0.0",
"serialport": "^12.0.0",
"sd-notify": "^2.8.0"
},
"devDependencies": {
"typescript": "^5.8.3",
"tsx": "^4.21.0",
"tsup": "^8.5.0",
"@types/node": "^22.15.0",
"vitest": "^3.2.1",
"eslint": "^10.1.0",
"prettier": "^3.8.1"
}
}

View File

@ -0,0 +1,37 @@
[Unit]
Description=Ti-Pote Robot Client
After=network.target NetworkManager.service
Wants=NetworkManager.service
[Service]
Type=notify
ExecStart=/usr/bin/node /opt/tipote/dist/main.js
WorkingDirectory=/opt/tipote
EnvironmentFile=/opt/tipote/.env
User=tipote
Group=tipote
# Restart policy: max 5 restarts per 5 minutes
Restart=on-failure
RestartSec=5
StartLimitIntervalSec=300
StartLimitBurst=5
# Watchdog: process must ping every 60s or gets killed
WatchdogSec=60
# Logging via journald
StandardOutput=journal
StandardError=journal
SyslogIdentifier=tipote
# Security: bind port 80 (captive portal) without root
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
# Resource limits (Pi Zero 2W has 416MB RAM)
MemoryMax=200M
MemoryHigh=150M
[Install]
WantedBy=multi-user.target