diff --git a/fusion_iot/CLAUDE.md b/fusion_iot/CLAUDE.md index 129d8372..b5defdc9 100644 --- a/fusion_iot/CLAUDE.md +++ b/fusion_iot/CLAUDE.md @@ -38,12 +38,27 @@ fusion_iot/ **Tailscale auth**: pre-authed to the `gurpreet6672@` tailnet. Survives reboots (`tailscaled` enabled). -### entech LXC (Odoo server) +### entech LXC (Odoo server, hosted on our Proxmox — client's ERP runs here) - `iot_base` + `iot` + `fusion_plating_iot` all installed -- Ingest endpoint: `POST http://10.200.1.26:8069/fp/iot/ingest` +- Ingest endpoint (public): `POST https://erp.enplating.ca/fp/iot/ingest` - Token lives in `ir.config_parameter['fusion_plating_iot.ingest_token']` — rotated via `scripts/fp_iot_setup_live_sensor.py` at setup time; rotate again in Settings → Technical → System Parameters as needed +**Why the public URL (not the LAN IP)**: the Pi needs to work at any +customer site, not just our office. Using the same URL the customer +types into a browser means zero reconfig when the Pi physically +moves between sites. `10.200.1.26:8069` would only work when the Pi +is on our internal network. + +**Tailscale on entech**: attempted in LXC 111 but the unprivileged +container can't create a tun device and iptables isn't installable +(apt state is broken from an unrelated python3-lxml-html-clean conflict). +Userspace-networking mode also failed to start cleanly. Skipped — the +public HTTPS URL is strictly simpler anyway. If future ops need +internal Tailscale reach on entech, either (a) switch to a privileged +LXC with tun support, (b) run tailscaled on the host pve-worker5 and +reverse-proxy, or (c) fix the apt state first. + ## Repackaging notes — `iot_base` + `iot` Both copied as-is from `/Users/gurpreet/Github/RePackaged-Odoo/_dependencies/` diff --git a/fusion_iot/pi/fp_iot_poller.py b/fusion_iot/pi/fp_iot_poller.py index 6a9cd45d..6b070e0d 100644 --- a/fusion_iot/pi/fp_iot_poller.py +++ b/fusion_iot/pi/fp_iot_poller.py @@ -6,9 +6,14 @@ and POSTs each reading to the configured Odoo instance. Runs forever under systemd; reads a config file at /etc/fp-iot/poller.conf. Config file format: - ODOO_URL=http://10.200.1.26:8069 + ODOO_URL=https://erp.enplating.ca INGEST_TOKEN=fp-iot-XXXXXXXXXXXXX INTERVAL_SECONDS=30 + +Use the customer-facing public URL (whatever their browser uses to +log into Odoo) — not an internal LAN IP. This way the Pi is site- +portable: same image/config works at office, client, or anywhere +with internet. """ import glob import json