Skip to content

The Agent

Timo Sariwating edited this page Nov 27, 2026 · 20 revisions

The agent is the small program on a computer beside your machines: a Raspberry Pi, a Mac, a PC. One agent drives every device plugged into that computer. It talks to the hub the way a Prusa printer talks to Prusa Connect: it starts the connection itself, so it works behind any router or firewall.

What it drives

Device How it is plugged in The one reference it follows
DYMO LabelManager PnP (tape) USB HID, no driver labelle
DYMO LabelWriter 450 (labels) USB, no driver DYMO's CUPS driver 1.4.0, with DYMO Connect's catalogue of rolls
A 3D printer on Marlin USB serial OctoPrint 1.11.8's serial layer
A laser on GRBL (reporting only so far) USB serial the gnea/grbl wiki, and LaserFoundry v0.6.0 where it is silent

Each device's port is proved against its reference by an audit: see docs/audits. A GRBL laser is on the agent, reporting only so far (#164 brings its buttons and jobs). Ported and proved but not yet on the agent: DYMO scales (usbscale) and USB webcams (nokhwa). A Prusa MK3 (PrusaLink) is still to be ported. The roadmap has the order.

Starting it

./maker-connect-agent
Option What
--dir <folder> Where it keeps its settings (default: ~/.maker-connect-agent)
--listen <address> Where its own page is served (default: 0.0.0.0:8470)
--version Which build this is

It needs nothing else on the command line: everything is set on its page.

Its page

Open http://<that computer>:8470 in a browser.

The agent's page: this agent connected to the hub, a card per device (DYMO LabelManager PnP, LabelWriter 450, Marlin printer) with its link, Turn off and Reset registration, and the hub's address

The page has four tabs: Devices, Cameras (when the agent has the cameras device: its card; a camera itself is set up in the hub, under Space → Cameras), Settings and About. (The Settings tab is on the branch wip/191-192 until it is released; before it, the hub's address was on Devices.)

Devices

  • One card per device: switch its module on for a device that is plugged in. It then registers with the hub and shows a code. On the hub, open Add machine (the + next to "Machines"), choose A machine on USB, and enter that code. From then on the card shows the link's state.
  • A Marlin printer or a laser: while it is off, choose its serial port (and, for a Marlin, the baud rate), then press Turn on: the port opens with the module. To choose another port, turn it off first. The agent remembers the USB device behind the port, so it finds the printer again when the port's name changes after a replug.
  • Reset the registration: the device forgets its token, and is no longer known at the hub until it is added again with a new code.

Settings

  • Hub: the hub's address and port (192.168.1.20, 8460), and TLS if the hub is behind HTTPS. Every device on this agent uses this hub.
  • WireGuard, under it: an optional tunnel of the agent's own to reach the hub; see WireGuard below.

About

  • This agent, Load and Computer: which build it is, how busy it is, and what it runs on.

A Stream Deck (idea, work in progress)

Not in a release yet: on the branch wip/191-192; see Stream Deck and #190.

An Elgato Stream Deck plugged into the agent's computer shows this agent's devices on its keys. It is local to the agent: it does not register at the hub and sends nothing there yet.

  • Its card on the agent's page: Turn on / Turn off, as every card; while on, the agent looks for a deck once a second and connects when one is there. The card says which deck, or why none is connected.
  • On the deck, read only: the top row shows each device as its card here shows it (state in its colour, its status line) and the hub's link; press a device for its page (state, hub, status, registered). The bottom row is always navigation: Back, and in the middle where you are (press it to go home).
  • Close the Elgato app first: it holds the deck (the owner's note of 2026-11-23, from trying deckhand). What the card says while it runs: not tried.
  • On Linux the deck needs udev rules to be opened without root: deckhand's 40-streamdeck.rules (not tried yet). Windows: not tried.
  • Tried on a Stream Deck Original V2 on macOS. Unplugging it while it runs: not tried.

WireGuard (work in progress)

Not in a release yet: on the branch wip/191-192; see #194. Tried on 2026-11-23: a Windows agent at an office reached a hub at home through a MikroTik.

The agent can reach the hub through a WireGuard tunnel of its own, with no VPN app on the computer and no admin rights: useful when the agent is somewhere else than the hub (another building, a member's home, an office) and the hub sits behind a router.

How it works: while the tunnel is on, the agent forwards a local port (127.0.0.1:18460) through the tunnel to the hub's address on Settings → Hub, and every device on the agent reaches the hub that way. Nothing else on the computer goes through the tunnel. Underneath: Cloudflare's boringtun for WireGuard, smoltcp for TCP inside the agent, and the glue between them ported from onetun v0.3.10.

On the agent (Settings):

  1. Hub: the hub's IP address on the far side (a name like hub.local cannot be looked up from elsewhere) and its port, then Save.
  2. WireGuard: copy This agent's public key (the agent makes its own key pair once; the private key never leaves its folder).
  3. Fill in the Endpoint (the WireGuard server's name or IP and port, for example a router's DDNS name and 13231), The server's public key, This agent's tunnel address (for example 10.10.10.2), and if the agent is behind NAT a Keepalive of 25 seconds. Save, then Turn on.
  4. The card shows the tunnel: Connected once a handshake came back, the last handshake and the bytes sent and received. The endpoint's name is looked up when the tunnel starts; if the server's address changed, Turn off and Turn on looks it up again.

On a MikroTik (RouterOS 7), as the WireGuard server, for example:

/interface wireguard add name=wg-agents listen-port=13231
/ip address add address=10.10.10.1/24 interface=wg-agents
/interface wireguard peers add interface=wg-agents allowed-address=10.10.10.2/32 public-key="<the agent's public key>"
/ip firewall filter add chain=input protocol=udp dst-port=13231 action=accept place-before=0
/ip firewall filter add chain=forward in-interface=wg-agents action=accept place-before=0
/interface wireguard print

The last line shows the router's public key, for the agent's The server's public key. One peer per agent, each with its own tunnel address. The firewall rules must come before the router's drop rules (place-before=0 puts them first). These steps were used on the owner's router; they are not checked against MikroTik's own documentation, so adapt them to yours.

When it says "No handshake yet": the agent's handshakes do not get an answer. On the MikroTik, /ip firewall filter print stats shows whether they arrive (the UDP rule counts 176-byte packets): if they do, the router does not know the agent: add it as a peer with the agent's public key (not the router's own), and check that the agent has the router's public key (not its private key). If nothing arrives, the network on the way blocks UDP to that port, or the router has no public address of its own.

What it keeps

In --dir, one folder per device (dymo, labelwriter-450, marlin), each with a prusa_printer_settings.ini as PrusaLink keeps it: the hub's address, the device's token and serial number, whether its module is on, and for a Marlin printer its serial port. A Marlin printer's files are in marlin/gcodes/. WireGuard keeps its settings and the agent's key pair in wireguard/wireguard.ini (readable by the agent's user only); the Stream Deck whether it is on, in streamdeck/deck.ini.

Keep the folder: it is the devices' pairing with the hub.

Printing on a Marlin printer

A job from the hub is downloaded into the agent's storage, then printed from there. The agent streams it as OctoPrint does: each line numbered and checksummed, acknowledged before the next, sent again when the printer asks.

  • Pause stops sending between two lines; Resume goes on; Stop ends the print.
  • The terminal on the machine's page sends G-code and shows what the printer answers.
  • The printer names itself with M115. When that name belongs to exactly one profile, the hub gives the printer that profile by itself; otherwise choose one on the machine's Machine tab, which shows the name beside the choice ("This printer calls itself: …"). A choice made for a name no profile knows is kept, so the name can join that profile (Machine Profiles).
  • When the printer's firmware can level its bed (Cap:AUTOLEVEL in its M115), Probe bed on the machine's page measures it (G28, G29, M420 V), and the hub reads and draws the mesh as OctoPrint's Bed Level Visualizer does. To use that mesh when printing, the slicer's start G-code turns it on (M420 S1 after G28), or measures again before each print (G29 after G28).

On a Raspberry Pi

The agent runs on a Pi with a 64-bit OS (Raspberry Pi 4 or 5, Raspberry Pi OS 64-bit): the build maker-connect-agent-linux-aarch64.

  1. Get the agent from your hub: Add machine → A machine on USB offers the builds the hub has.

  2. chmod +x it, and let your user reach the devices:

    sudo usermod -aG dialout $USER          # serial ports (printers); log in again after

    For the DYMO printers, a udev rule that gives access to their USB devices (vendor 0922):

    echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="0922", MODE="0666"' | sudo tee /etc/udev/rules.d/99-dymo.rules
    sudo udevadm control --reload && sudo udevadm trigger
  3. To start it with the Pi, a user service:

    # ~/.config/systemd/user/maker-connect-agent.service
    [Unit]
    Description=Maker Connect agent
    After=network-online.target
    
    [Service]
    ExecStart=%h/maker-connect-agent/maker-connect-agent --dir %h/maker-connect-agent
    Restart=on-failure
    RestartSec=3
    
    [Install]
    WantedBy=default.target

    systemctl --user enable --now maker-connect-agent, and sudo loginctl enable-linger $USER so it runs without anyone logged in. Its log: journalctl --user -u maker-connect-agent -f.

The Windows and macOS builds run too (2026-11-23): on Windows a Marlin printer connected and answered, but the agent cannot be sent a file there yet (#184); a release for both: #141.

Building it

cargo build --release -p maker-connect-agent
scripts/build-release.sh                # every platform, as the releases are made

build-release.sh cross-builds with cargo-zigbuild (cargo install cargo-zigbuild, and Zig). The hub offers every file named maker-connect-agent-<os>-<arch>[.exe] in its downloads folder on its Add machine page.

Clone this wiki locally