Device Hub: install, pair, and print
The on-premise bridge between browser apps and warehouse hardware: install on the workstation, pair once, connect printers/scales, and watch the print queue in the print center.
What Device Hub is#
A browser sandbox cannot open raw TCP / USB / serial ports, so web WMS cannot talk directly to ZPL printers or electronic scales. Device Hub is a tray-resident app installed on each warehouse workstation (Windows PC / Mac) that bridges “browser ↔ hardware”: it auto-starts with the machine and runs unnoticed. It’s built with Tauri v2 — one codebase for Windows + macOS (Intel and Apple Silicon).
Download and install#
- Get it from the official download page (/zh/download or /en/download): the page auto-recommends Mac DMG or Windows MSI (universal) by your platform.
- Download → install → next-next-finish. The whole thing needs zero manual steps — no drivers to install by hand, no commands, no config files to edit.
- First-run setup wizard: ① it shows a pairing code → ② it auto-discovers printers (mDNS + USB); tick the devices and set the default label printer → ③ done.
- Auto-starts with the machine and runs quietly in the background.
Pairing#
- The Hub tray icon shows a 6-digit pairing code.
- On the web side, use the Device Hub panel in the page header (or the pairing prompt in Print Center — both run the same flow) in a browser on the same computer as the Hub: enter the code shown on the Hub and confirm. Pairing only works from that computer — the browser talks to the Hub on the same machine, so a Hub in another warehouse is paired from a browser on its own computer.
- Pairing needs the “Device pairing” permission. If your account does not have it, the same dialog asks a permission holder (for example your organization admin) to enter their account email and password right there — that one-time approval pairs the Hub and does not change your own login.
- Pairing is recorded in the cloud for your organization, and the Hub keeps reporting to every organization it is connected to — connecting it to another organization never removes the existing ones. The pairing code rotates automatically every 90 days; for 24 hours after a rotation the previous code still works. The Hub only binds 127.0.0.1 by default, so it can’t be scanned from outside; LAN mode (for phone/tablet printing) is opt-in and still requires a paired connection.
The main place to pair is the Device Hub panel in the page header: open it, enter the pairing code shown on the Hub, and confirm — the panel shows success once your organization’s roster lists the Hub as connected. A Hub can serve several organizations at once, and pairing it here never disconnects it elsewhere. Organization admins get a notification whenever a Hub is paired, and can review the pairing history (who paired it, and who approved it) at any time. Confirmation normally completes within a few seconds; until then the panel keeps showing a confirming state — closing and reopening the panel does not cancel the pairing.
Pairing is per browser: each browser on this computer pairs once, and the pairing is kept separately for each Docklify site you open in it. That is why a Hub can already show as connected in the top-bar Device Hub panel while a screen — for example the packing camera preview — still says this browser is not paired. When that happens, open the top-bar Device Hub panel and, in its Pairing section, choose “Enable local features in this browser” and enter the pairing code: it enables only this browser and does not change the Hub’s connection to your organization. Note that one site on one computer recognizes only one browser at a time — enabling this browser means the previous one needs to be enabled again before it can use local devices on this site. At the packing station, the camera preview window itself shows an “Enable local features” button that opens the same wizard. After pairing, the preview reloads on its own.
The same header panel also manages this computer’s Hub connection. The Cameras number in the panel counts the cameras the Hub can actually see right now — plug a camera in and the number follows, whether or not it has been assigned to a station yet; camera assignment itself is managed on the device and packing-station screens.
- Pair another Hub: when the panel shows this computer’s Hub as connected, the Pairing section always offers “Pair another Hub” — start the other Hub on this computer, open the panel, choose “Pair another Hub” and enter the code shown on that Hub’s tray app. The Hub that is already connected stays as it is.
- Unpair: “Unpair this Hub” in the panel asks for confirmation first, spelling out what happens — unpairing takes effect in the cloud right away (even if the Hub is offline) and its sign-in is revoked. If the Hub is online, it is told at once to stop recording (including any recording in progress) and release every camera on it — usually within about two seconds; if it is offline, it does so as soon as it reconnects. Past recordings and events are kept. After you confirm, the panel first shows that it is waiting for the Hub to confirm, and only reports how many cameras were released once the Hub has confirmed — if the Hub is offline, the panel says so instead of claiming the cameras are already off. The Hub needs to be paired again before it can be used.
- If “Unpair this Hub” is greyed out, that Hub was connected with an older setup and has no pairing identity yet — pair it once more from the panel (or the Print Center) and unpairing will work here after that.
Connecting printers#
- ZPL printers (Zebra and similar): USB or network port 9100; the Hub sends raw ZPL and polls printer status (out of paper / ribbon / cover open).
- All web print buttons go through the SDK to the Hub. If the Hub isn’t installed, the print button pops a “Device Hub not detected” card with the download link for your platform; downloading the ZPL remains as a fallback.
- Printers are grouped by category (label, document and the like): the category can be changed afterwards on the device page, and the first-run wizard now requires you to pick a type for each printer before finishing.
- Default label printer (one per organization): mark it on the print-devices page (is_default_label_printer). Cloud print routes jobs only to the default printer, and the Device Hub on its computer must be running — if the Hub is off, you get a clear prompt instead of a job that stays queued forever.
- Electronic scales connect over serial / USB-serial, with configurable baud rate, prefix/suffix and unit, supporting common continuous-output protocols (e.g. Mettler Toledo, CAS, AND). Register the scale on the print-devices page as a scale-type device.
- USB scales (Device Hub test10+): plug the scale in and the Hub auto-discovers it — no pairing, no serial-port settings. Tap once to read the weight (units g / kg / mg / oz / lb). The Hub status page now shows printers and scales in separate sections with counts.
- Delete a device: on the Print Center devices page, the actions column has a delete button (with a confirm step). Deleting removes the cloud record immediately — but if the Device Hub app still has that printer paired, the next sync will re-register it. To remove it for good, remove it in the Device Hub app first, then delete it here.
Phone cloud-print pipeline#
- Tap print label on the phone web → POST /api/wms/print-jobs → the print_jobs table (queued, carrying the ZPL content).
- The Device Hub on a warehouse workstation subscribes to Supabase Realtime (with a 3-second polling fallback) → atomically claims the job (UPDATE … WHERE status=queued — zero rows means it was cancelled, so it never prints; this prevents misprints).
- Prints locally on the Zebra → writes back done/failed → the phone polls the status for feedback.
Print center (Admin app)#
- Print queue: the full print_jobs table; filter by status/warehouse/printer/label type/time. Jobs unhandled for >5 minutes are highlighted; queued jobs can be cancelled, failed jobs can be reprinted; Realtime live refresh; after submitting from a WMS print button you get a jump link here.
- Print devices: the full devices table; online/offline computed from the last_seen_at heartbeat (2-minute threshold); connection type, default-label-printer flag, owning Hub; Hub pairing management lives here too.
test6 (Mac) — the Hub becomes a desktop device console#
- Tray menu: the first item is "Show main window"; on macOS, clicking the Dock icon also restores the window (RunEvent::Reopen).
- Status page: "Printers" is now "Connected devices" — every connected printer/hardware shows; an empty list shows "No devices".
- Device details: click any device for a popup with name, model, connection type, address, type, default flag, and status.
- Test print: every printer gets a "Test print" button that prints a test label to verify connectivity.
- Embedded run log: the status page shows a collapsible "Run log" section (expanded by default) with the latest 50 lines, auto-scrolling to the bottom, plus a refresh button and the log file path.
- Log coverage completed: connection errors and the print-job lifecycle (claimed / succeeded / failed) are all logged.
test7 (Mac) — 6-language first-run wizard#
- The setup wizard is now fully localized in six languages (zh / en / es / pt / fr / ja), switchable from a dropdown in the top-right corner.
- Every step gets a "Back" button so you can revisit earlier choices; the wizard's final step is now "Done" (the old "Get started" / "Skip wizard" buttons are gone).
- The official download page now serves the test7 Mac DMG. Windows MSI is still paused — it resumes once the self-hosted runner on a Windows PC is ready (GitHub cloud builds are blocked by a billing issue).
