Skip to content

Commit e12a4b9

Browse files
feat: v1.5.0 — Elegoo CC2 live integration + TigerScale Enhanced
## Elegoo Neptune 4 / CC2 live integration - MQTT port 1883, UDP discovery port 52700 - Real-time temperatures, print job progress, AMS-style filament slots - History thumbnail queue with correct firmware correlation (firmware echoes method 1045 as response id — use _historyThumbPendingFn as discriminator instead of request ID) - Live camera widget (widget_camera.js) ## TigerScale Enhanced WebSocket panel - Connect/disconnect toggle button per scale card (manual disconnect suppresses 5s auto-reconnect) - Collapsible WS event log (80-line ring buffer, direction arrows + timestamps) - CORS fix: removed fetch() ping (blocked by Chromium renderer), WS connects directly; field names corrected to camelCase (netWeight, scaleStatus) - Gradient live card matching mobile app: send-status badge, filament mini-panel (WS-driven brand/material/color with hex extraction), 56px weight display, CONTAINER/FILAMENT split row - UID reader 2-column grid with resolve() twin logic: empty slot shows twin UID in green (#4ade80) when Firestore resolves it - TARE hold-to-confirm (1s) → POST /api/tare; card + button auto-hidden on disconnect via CSS sibling selector on empty .scale-card-local - Zero values show — for container and filament (not main weight) ## Also in this release - Creality live integration (v1.4.15): WebSocket port 9999, CFS colour grid, WebRTC camera, print thumbnail, WS event log - Add Product multi-colour picker: Mono/Dual/Tri/Rainbow modes (v1.4.14) - Custom product image for DIY & Cloud spools (v1.4.13)
1 parent c98eb38 commit e12a4b9

76 files changed

Lines changed: 9241 additions & 3402 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CLAUDE.md‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,23 @@ renderer/
5555
60-modals.css — Rack-edit / friend / account / login / alert modals
5656
70-detail-misc.css — icons, stats, table/grid, detail panel, debug, twin-link, toolbox, TD edit, TD1S, display-name
5757
locales/ — en.json fr.json de.json es.json it.json zh.json pt.json pt-pt.json pl.json
58+
printers/ — one sub-folder per brand; each has PROTOCOL.md + index.js
59+
bambulab/
60+
PROTOCOL.md — agent skill: MQTTS port 8883, AMS, SSDP+TLS discovery, camera JPEG/RTSP
61+
index.js — live integration (stub — not yet implemented)
62+
creality/
63+
PROTOCOL.md — agent skill: WS port 9999, heartbeat, CFS boxsInfo, WebRTC camera
64+
RETRO.md — live SSH observations on real Ender-3 V4 hardware (reference)
65+
index.js — live integration (implemented)
66+
elegoo/
67+
PROTOCOL.md — agent skill: MQTT port 1883, UDP discovery port 52700
68+
index.js — live integration (stub — not yet implemented)
69+
flashforge/
70+
PROTOCOL.md — agent skill: HTTP port 8898, TCP 8899, UDP multicast discovery, MJPEG camera
71+
index.js — live integration (implemented)
72+
snapmaker/
73+
PROTOCOL.md — agent skill: WS port 7125 (Moonraker), JSON-RPC, HTTP discovery
74+
index.js — live integration (implemented)
5875
data/
5976
id_brand.json id_material.json id_aspect.json id_type.json
6077
id_diameter.json id_measure_unit.json id_version.json
@@ -63,6 +80,20 @@ assets/svg/
6380
tigertag_logo.svg tigertag_logo_contouring.svg
6481
```
6582

83+
## Printer agent skills
84+
85+
Each brand under `renderer/printers/<brand>/PROTOCOL.md` is a **self-contained agent skill** — a complete reference that lets an AI implement the integration without reading Flutter source. Read the relevant `PROTOCOL.md` **before** touching any `index.js` in that folder.
86+
87+
| Brand | PROTOCOL.md highlights | index.js status |
88+
|-------|------------------------|-----------------|
89+
| **Bambu Lab** | MQTTS 8883 TLS, AMS 16-slot, SSDP+TLS scan, JPEG TCP 6000 / RTSP 322 | stub |
90+
| **Creality** | WS 9999, heartbeat `"ok"`, CFS boxsInfo type 0/1, WebRTC port 8000 | ✅ implemented |
91+
| **Elegoo** | MQTT 1883, UDP spray port 52700, filament 4 slots canvas/tray | stub |
92+
| **FlashForge** | HTTP poll 8898, TCP M-codes 8899, UDP multicast 225.0.0.9:19000 | ✅ implemented |
93+
| **Snapmaker** | WS 7125 Moonraker + proprietary, RRGGBBAA color, HTTP scan | ✅ implemented |
94+
95+
> **RETRO.md** (Creality only) — raw live-hardware SSH observations; PROTOCOL.md is the authoritative merge.
96+
6697
## LocalStorage keys
6798
| Key | Content |
6899
|-----|---------|

‎DEVLOG.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,39 @@ Mis à jour en fin de chaque session Claude.
55

66
---
77

8+
## 2026-05-11 — v1.5.0
9+
10+
### Demandes
11+
- **Elegoo** : fix corrélation thumbnail historique (firmware renvoie le numéro de méthode 1045 en tant qu'`id`, pas notre request ID incrémental)
12+
- **TigerScale** : bouton connexion/déconnexion WS unique par card
13+
- **TigerScale** : log WS collapsible dans chaque card (80 lignes, direction ← → ·, timestamp)
14+
- **TigerScale** : fix CORS — `fetch()` ping bloqué par Chromium dans Electron renderer → supprimé, WS se connecte directement
15+
- **TigerScale** : fix noms de champs WS (`netWeight`, `scaleStatus` camelCase, pas snake_case)
16+
- **TigerScale** : refonte complète du panneau live — gradient violet, badge statut, mini-panel filament, affichage poids 56 px, split CONTAINER/FILAMENT, grille UID 2 colonnes avec logique `resolve()` twin, bouton TARE hold-to-confirm
17+
- **TigerScale** : card et bouton TARE masqués automatiquement à la déconnexion
18+
- **TigerScale** : 0 → `—` pour container et filament (pas pour le poids principal)
19+
20+
### Fichiers modifiés
21+
| Fichier | Nature de la modification |
22+
|---------|--------------------------|
23+
| `renderer/printers/elegoo/index.js` | Corrélation thumbnail : remplace ID-based par `_historyThumbPendingFn !== null`; live-print thumbnail supprimé pendant queue active |
24+
| `renderer/IoT/tigerscale/index.js` | `connectScaleWs` sync (no ping); `_scaleLocalState` étendu (`brand`, `material`, `color`, `uidTwin`); `onmessage` parse `brand`/`material`/`color` + clear sur `"ready"`; `_buildScaleLocalBlockHtml` entièrement réécrit (gradient card, badge, filament panel WS-driven, weight, split row, UID grid avec `resolve()`); `_buildScaleCardHtml` : tare-btn sibling hors `.scale-card-local`; `_wireScaleCardEvents` hold-to-confirm 1 s; `.tare-success` → `.success` |
25+
| `renderer/IoT/tigerscale/tigerscale.css` | Refonte CSS : `.sc2-live-card` gradient spec, `.send-status`, `.filament-panel`/`-dot`/`-row`/`-label`/`-value`, `.sc2-inner`, `.user-name`, `.weight-display`, `.sc2-weight-num`, `.weight-unit`, `.weight-meta-*`, `.uid-rows` grid 2 col, `.uid-row`/`-chip-label`/`-value`, `.uid-value--twin` (vert), `.tare-hold-btn` + `.tare-progress` + `@keyframes fillProgress` + `.success`; suppression classes obsolètes sc2-badge/split/readers |
26+
| `package.json` | version `1.4.15` → `1.5.0` |
27+
| `README.md` | Sections changelog v1.4.15 et v1.5.0 |
28+
| `ROADMAP.md` | ✅ TigerScale live WS panel + backlog mis à jour |
29+
| `DEVLOG.md` | Ce fichier |
30+
31+
### Notes techniques
32+
- **Elegoo thumbnail** : `_historyThumbPendingFn !== null` comme discriminateur — pas besoin de comparer des IDs que le firmware ne respecte pas
33+
- **CORS Electron** : `fetch()` vers IP locale bloqué par Chromium renderer (pas d'en-tête `Access-Control-Allow-Origin`); WebSocket contourne CORS nativement
34+
- **Filament panel** : données 100 % WS (`brand`, `material`, `color`). Format couleur firmware : `"Red #FF0000"` → regex `/#([0-9A-Fa-f]{6})\b/` pour extraire le hex; fallback `rgba(255,255,255,0.25)`
35+
- **UID resolve()** : si slot physique vide + autre slot occupé + `uidTwin` connu → afficher twin en vert dans le slot vide. Si `uidTwin` absent → `🔗 Twin` (placeholder vert). Grille toujours à 2 colonnes.
36+
- **TARE** : bouton sibling hors `.scale-card-local` → jamais re-rendu au 10 Hz. CSS sibling selector `.scale-card-local:empty ~ .tare-hold-btn { display:none }` pour masquer sans JS supplémentaire
37+
- **10 Hz rebuild** : `_buildScaleLocalBlockHtml` retourne `""` si `!st.connected` → `.scale-card-local:empty { display:none }` cache la card automatiquement
38+
39+
---
40+
841
## 2026-05-09 — v1.4.15
942

1043
### Demandes

‎README.md‎

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- **Friends system** — Share a 6-character public code (`XXX-XXX`) with friends, send/accept/refuse/block friend requests, view a friend's inventory in the main interface in read-only mode, optional public inventory toggle for frictionless sharing
3636
- **Friend inventory view** — A friend appears as a switchable pseudo-account in the avatar dropdown and profiles modal; clicking opens their inventory in the same table/grid UI with a "Read-only" banner and a quick "← My inventory" button
3737
- **3D printer management** — Dedicated "Printers" tab with a drag-and-drop grid of all your printers across the 5 supported brands (Bambu Lab / Creality / Elegoo / FlashForge / Snapmaker); per-brand "Add" flow with model picker, side card with editable connection details, and online / offline indicator driven by an HTTP ping
38+
- **TigerScale live integration** — Real-time WebSocket connection to the open-source TigerScale ESP32 filament scale. Each scale card shows live weight (56 px display), CONTAINER / FILAMENT split, send-status badge (`idle` → `scanning` → `stable` → `send` → `success`), filament mini-panel (brand + material + colour dot, driven by the WS frame), and a 2-column UID reader grid where the empty slot auto-fills with the Firestore-resolved twin tag in green. TARE is a hold-to-confirm button (1 s) that POSTs `/api/tare`. The card and TARE button hide automatically when the WebSocket is disconnected; a connect/disconnect toggle in the card header gives manual control with auto-reconnect suppression on explicit disconnect.
3839
- **Snapmaker live integration** — Real-time WebRTC camera, live extruder + bed temperatures, filament data per slot (color, brand, material) with click-to-edit, and active-print job card (preview thumbnail + progress + state + layer counter) over the Moonraker WebSocket
3940
- **FlashForge live integration** — HTTP polling on port 8898 (`/detail` every 2 s), real-time MJPEG camera with auto-recovery on connection failure (mjpg-streamer's 1-client limit handled gracefully), 5-slot matlStation grid (`Ext.` + `1A` `1B` `1C` `1D`) showing each bay's assigned colour + material — even when empty — so the user knows what to refill where, click-to-edit per slot via FlashForge's `/control` HTTP API (`msConfig_cmd` / `ipdMsConfig_cmd`), and a debug-mode Request log surfacing every outgoing POST + response in real time
4041
- **Snapmaker LAN discovery** — Side-panel scanner that finds Snapmaker printers on the local network: instant mDNS browse on `_snapmaker._tcp.local.` (TXT record carries IP / model / device name / serial), parallel Moonraker port-scan as fallback (port 7125 with `/printer/info` + `/server/info` + `/machine/system_info`), per-source batch sizing (24 on local LAN, 4 on user-declared extras to survive anti-scan firewalls), brand-confirmed candidates only (`machine_type` containing "Snapmaker"), one-click add that writes the printer doc directly to Firestore and opens its detail panel, plus inline "Add by IP" with live IPv4 validation
@@ -52,6 +53,34 @@
5253

5354
## Changelog
5455

56+
### v1.5.0 — 2026-05-11
57+
58+
#### TigerScale — live WebSocket panel
59+
- **Connect / disconnect toggle button** on each scale card. A single button in the card header opens or closes the WebSocket connection manually; manual disconnect suppresses the 5-second auto-reconnect so the card stays quiet until the user reconnects explicitly.
60+
- **WS event log** — collapsible `<details>` strip below each scale card showing the last 80 events (connect, raw frames, errors, retries) with direction arrows (← / → / ·) and per-line timestamps. Useful for diagnosing firmware issues without opening DevTools.
61+
- **CORS fix** — removed the pre-connect `fetch()` ping (blocked by Chromium CORS in Electron renderer when the firmware returns no `Access-Control-Allow-Origin` header). `connectScaleWs` is now synchronous and opens the WebSocket directly; `onclose` handles retries.
62+
- **Field-name fix** — WS parser corrected from snake_case (`net_weight`, `status`) to the actual camelCase fields the firmware sends (`netWeight`, `scaleStatus`).
63+
- **Gradient live card** — a second card below the dark info card (head + chips + last spool) shows live data with a purple gradient matching the TigerScale mobile app. Hidden automatically when the WS is disconnected; reappears on reconnect.
64+
- **Send-status badge** — top-left absolute pill inside the gradient card maps `scaleStatus` firmware values (`idle`, `scanning:N`, `stable:N`, `send`, `success`, `error`, `done`, `ready`) to emoji + text with per-state background colours.
65+
- **Filament mini-panel** — top-right overlay (dark blur) shows the colour dot (extracted from the firmware `color` field `"Red #FF0000"` format), brand, and material. Appears only when the firmware sends non-empty brand or material; clears automatically when `scaleStatus` becomes `"ready"` (spool removed). Data comes from the WebSocket — no Firestore lookup.
66+
- **Weight display** — 56 px bold weight number with unit. Container and filament show `—` when zero; main weight shows `0` normally.
67+
- **UID reader grid** — 2-column grid (Left reader ◀ / Right reader ▶) always visible. A `resolve()` function fills the empty slot with the twin UID (green `#4ade80`) when Firestore resolves it, or `🔗 Twin` as placeholder while waiting. The twin row is never a third row — it appears in the vacant slot.
68+
- **TARE hold-to-confirm** — 1-second press on the TARE button (`#667eea`) fills a white progress bar then POSTs `/api/tare` to the scale. Button is hidden when disconnected (CSS sibling selector on empty `.scale-card-local`). Success flashes green (`#48bb78`).
69+
70+
#### Elegoo — thumbnail correlation fix
71+
- History thumbnail responses are now correlated by `_historyThumbPendingFn !== null` rather than by request ID. The Elegoo firmware echoes the method number (1045) as the response `id` — not our incremental request ID — so ID-based matching never worked and history thumbnails were silently dropped.
72+
73+
### v1.4.15 — 2026-05-09
74+
75+
#### Creality live integration
76+
- Real-time WebSocket connection to Creality printers on port 9999 with automatic heartbeat (request/response polling every 2 s).
77+
- Live nozzle, bed, and enclosure temperatures with colour-coded indicators; print state (`idle` / `printing` / `finished`), job progress bar, layer counter, and estimated duration.
78+
- **CFS colour grid** — activated when `cfsConnect=1` and `materialBoxs[]` is non-empty; shows each slot's assigned colour pill and material label.
79+
- **WebRTC camera** — inline `<iframe>` at `http://$ip/webcam/webrtc` (same pattern as Snapmaker / Crowsnest) when `webrtcSupport=1`.
80+
- **Print thumbnail** — fetched from `http://$ip/downloads/original/current_print_image.png` while a job is active.
81+
- WS event log with Pause / Clear / row-expand, same UI as Snapmaker and FlashForge.
82+
- Online / Offline badge in the printer grid and side panel driven by a lightweight WS probe (open → mark online → close immediately, 30 s TTL).
83+
5584
### v1.4.14 — 2026-05-08
5685

5786
#### Add Product — multi-colour picker (Mono / Dual / Tri / Rainbow)
@@ -816,4 +845,10 @@ Please use [GitHub Issues](https://github.com/TigerTag-Project/TigerTag_Studio_M
816845

817846
[MIT](LICENSE) — © TigerTag Project
818847

819-
You are free to use, modify, and distribute this software. See the [LICENSE](LICENSE) file for details.
848+
You are free to use, modify, and distribute Tiger Studio — including commercially.
849+
850+
The **"TigerTag"** name (RFID protocol + cloud service) is a trademark of the TigerTag Project.
851+
See [TRADEMARK.md](TRADEMARK.md) for usage conditions (short version: reference freely, don't rebrand a competing service).
852+
853+
All 303 npm dependencies are permissive (MIT / ISC / BSD / Apache — zero copyleft).
854+
See [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md) for the full breakdown.

‎ROADMAP.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Grouped by domain. Versions in parentheses are the release that landed the featu
7878
- ✅ **ACR122U NFC reader** (USB) via `nfc-pcsc` — `main.js` ↔ renderer IPC bridge
7979
- ✅ **TD1S sensor** integration — TD + color reading, auto-detect on USB plug, log panel
8080
- ✅ **TigerScale heartbeat** — `users/{uid}/scales/{mac}` with 90s online threshold, scale panel render
81+
- ✅ **TigerScale live WebSocket panel** — connect/disconnect toggle, WS event log, gradient live card matching mobile app, send-status badge, filament mini-panel (WS-driven: brand/material/color from firmware), 56 px weight display, UID reader 2-col grid with `resolve()` twin logic (vert = cloud, blanc = physique), TARE hold-to-confirm 1 s → POST `/api/tare`, card + button hidden on disconnect. (v1.5.0)
8182
- ✅ **TD1S button in Add Product panel** — icon in the ADP header: disconnected → opens connect modal; connected → glows green and auto-fills colour HEX + TD value fields on scan. State syncs on every `onStatus` event and `openAddProductPanel()` call. (v1.4.13)
8283

8384
### Distribution & i18n
@@ -691,7 +692,7 @@ No commitment, no ETA. Listed roughly by likely impact.
691692
- **Print history per spool** — track which printer used which spool over time. Needs: schema decision (top-level `printJobs/` collection? embedded in spool doc?), capture hook in Snapmaker WS layer (the print job card already has the data we'd need), history UI in spool detail panel.
692693
- **Spool predictions** — *"this spool will run out around X day"* based on historical usage. Depends on print history existing first.
693694
- **Filament cost tracking** — per-spool cost field, aggregate by month / by printer / by material in stats. Pure UI + schema addition.
694-
- **TigerScale enhancements** — current scale panel shows heartbeat + battery; could add: tare action, multi-spool weighing, automatic transfer of weight to the active spool.
695+
- **TigerScale — auto weight transfer** — after a successful TARE + send cycle, auto-update the matched spool's `weight_available` in Firestore from `netWeight`.
695696
- **Marketplace / shared filament profiles** — share a `(material, brand, optimal_settings)` triple to a public registry; users could pull recommended print profiles for a given spool.
696697
- **Web build** — multiple comments in `inventory.js` mention *"future web build hosted on tigertag-cdn"*. Sidesteps Electron's NFC requirement (no NFC = no scan, but read-only inventory works fine in browser). Needs: Electron-API polyfills/stubs, build target split.
697698
- **Mobile companion app deep-linking** — the desktop app shows a QR for the mobile app; mobile could deep-link back into a specific spool / printer / friend on desktop.

‎THIRD_PARTY_LICENSES.md‎

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Third-Party Licenses
2+
3+
Tiger Studio Manager is released under the **MIT License**.
4+
It depends on the following third-party components, each retaining its own license.
5+
6+
---
7+
8+
## Runtime — Electron framework
9+
10+
### Electron
11+
- **License**: MIT
12+
- **Source**: https://github.com/electron/electron
13+
14+
Electron bundles **Chromium** (BSD / various) and **Node.js** (MIT).
15+
Their respective license notices are included in the distributed app binary
16+
under `LICENSE.electron.txt` (generated by electron-builder at build time).
17+
18+
---
19+
20+
## npm dependencies — license summary
21+
22+
All 303 production and build-time dependencies are permissive.
23+
No GPL, LGPL, AGPL, MPL, CDDL, or EPL dependencies are present.
24+
25+
| License | Count |
26+
|---|---|
27+
| MIT | 238 |
28+
| ISC | 34 |
29+
| BlueOak-1.0.0 | 8 |
30+
| BSD-2-Clause | 7 |
31+
| Apache-2.0 | 6 |
32+
| BSD-3-Clause | 5 |
33+
| WTFPL / other permissive | 5 |
34+
35+
### Notable dependencies
36+
37+
| Package | License | Purpose |
38+
|---|---|---|
39+
| electron-builder | MIT | Cross-platform packaging & auto-update |
40+
| serialport | MIT | USB serial (ACR122U RFID reader, TD1S sensor) |
41+
| @pokusew/pcsclite | ISC | PC/SC smart card layer |
42+
| firebase (compat SDK) | Apache-2.0 | Firestore + Auth |
43+
| got | MIT | HTTP client |
44+
| @electron/notarize | MIT | macOS notarization |
45+
| @electron/osx-sign | BSD-2-Clause | macOS code signing |
46+
| 7zip-bin | MIT | App packaging |
47+
48+
### Full dependency list
49+
50+
To generate the complete license list with URLs:
51+
52+
```bash
53+
npx license-checker --excludePrivatePackages --csv > licenses.csv
54+
```
55+
56+
---
57+
58+
## Firebase Web SDK
59+
60+
Tiger Studio uses the **Firebase JavaScript SDK (compat)** loaded from local files:
61+
62+
- `firebase-app-compat.js`
63+
- `firebase-auth-compat.js`
64+
- `firebase-firestore-compat.js`
65+
66+
- **License**: Apache License 2.0
67+
- **Source**: https://github.com/firebase/firebase-js-sdk
68+
- **Copyright**: Google LLC
69+
70+
---
71+
72+
## Fonts & Icons
73+
74+
The UI uses system fonts only — no bundled font files.
75+
Icons are rendered via CSS (Unicode / emoji) or inline SVG — no icon library bundled.
76+
77+
---
78+
79+
## No copyleft components
80+
81+
Tiger Studio contains **no GPL, LGPL, AGPL, or other copyleft-licensed code**.
82+
All dependencies are permissive (MIT, ISC, BSD, Apache, BlueOak).
83+
This means Tiger Studio can be used commercially and in proprietary derivatives
84+
without any copyleft obligations, subject only to attribution requirements
85+
of the individual permissive licenses (MIT copyright notices, etc.).

0 commit comments

Comments
 (0)