fix: deployment issues from Pi testing
- WiFi: use iwgetid -r (privilege-free) before nmcli fallback - systemd: move StartLimit directives to [Unit] section - pi-gen: add netdev group for NetworkManager permissions - Setup page: add enter pairing code shortcut link Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
99a39e5d08
commit
3b993894e4
@ -522,8 +522,11 @@ export function SetupRobotPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Bottom link */}
|
||||
<div className="mt-6 flex items-center justify-center gap-1 text-sm text-slate-400">
|
||||
{/* Bottom links */}
|
||||
<div className="mt-6 flex flex-col items-center gap-2 text-sm text-slate-400">
|
||||
<Link to="/pair" className="text-brand-400 hover:text-brand-300">
|
||||
Déjà sur le réseau ? Entrer un code
|
||||
</Link>
|
||||
<Link to="/" className="hover:text-slate-200">
|
||||
← Retour au tableau de bord
|
||||
</Link>
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
Description=Ti-Pote Robot Client
|
||||
After=network.target NetworkManager.service
|
||||
Wants=NetworkManager.service
|
||||
StartLimitIntervalSec=300
|
||||
StartLimitBurst=5
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
@ -14,8 +16,6 @@ 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
|
||||
|
||||
@ -28,6 +28,14 @@ export class WifiService {
|
||||
* Check if the Pi is currently connected to a WiFi network.
|
||||
*/
|
||||
async isConnected(): Promise<boolean> {
|
||||
try {
|
||||
// Use iwgetid first (no privileges needed), fallback to nmcli
|
||||
const { stdout } = await execAsync('iwgetid -r');
|
||||
if (stdout.trim()) return true;
|
||||
} catch {
|
||||
// iwgetid failed, try nmcli
|
||||
}
|
||||
|
||||
try {
|
||||
const { stdout } = await execAsync('nmcli -t -f TYPE,STATE device | grep wifi');
|
||||
return stdout.includes('connected') && !stdout.includes('disconnected');
|
||||
|
||||
@ -9,7 +9,7 @@ on_chroot << 'CHEOF'
|
||||
if ! id tipote &>/dev/null; then
|
||||
useradd --system --create-home --home-dir /opt/tipote \
|
||||
--shell /usr/sbin/nologin \
|
||||
--groups dialout,audio \
|
||||
--groups dialout,audio,netdev \
|
||||
tipote
|
||||
fi
|
||||
CHEOF
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user