kingkong 636ae5333b feat: add Pi device agent installer + provisioning runtime hai 2 meses
..
agent 636ae5333b feat: add Pi device agent installer + provisioning runtime hai 2 meses
scripts 636ae5333b feat: add Pi device agent installer + provisioning runtime hai 2 meses
systemd 636ae5333b feat: add Pi device agent installer + provisioning runtime hai 2 meses
README.md 636ae5333b feat: add Pi device agent installer + provisioning runtime hai 2 meses
heartbeat-poc.py 966b095b2e feat: add heartbeat-poc.py for end-to-end pipeline testing hai 2 meses
package.json 607157183a feat: Phase 1 MVP — Auth stub + Devices heartbeat + Dashboard shell hai 2 meses
requirements.txt 636ae5333b feat: add Pi device agent installer + provisioning runtime hai 2 meses

README.md

Timelapse Device Agent (Pi4 + DSLR)

Agent này chạy trên thiết bị Pi4 đầu cuối để:

  1. Claim thiết bị về server bằng claim code
  2. Poll trạng thái approved/rejected
  3. Lưu API key one-time vào /boot/timelapse/agent.key
  4. Gửi heartbeat định kỳ về server

Không chạy trên Mac

Script install chỉ chạy trên Pi/Linux systemd.

Setup trên Pi 4

cd /opt/timelapse
git pull

# install agent service
sudo bash apps/device-agent/scripts/install-agent.sh

# theo dõi logs
journalctl -u timelapse-agent.service -f

Cấu hình

File: /etc/timelapse/agent.env

TL_SERVER_URL=http://<server-ip>:3001
TL_DEVICE_NAME=Pi-DSLR-01
TL_SERIAL_NO=PI4-DSLR-01
TL_HEARTBEAT_INTERVAL=30
TL_CLAIM_POLL_INTERVAL=10
TL_CONFIG_DIR=/boot/timelapse

Luồng claim

Khi service chạy lần đầu:

  • Agent in claim code ra terminal/log
  • Dashboard admin approve device
  • Agent tự nhận API key và bắt đầu heartbeat

File runtime

  • /boot/timelapse/agent.json — metadata (deviceUuid, deviceId)
  • /boot/timelapse/agent.key — API key (chmod 600)