For sellers

Installing and running the agent

Download the agent, connect it with your enrolment code, keep it running, and fix the usual problems.

The agent is one small file. There is nothing to install, no database and no administrator account needed. It only makes connections out from your workshop, so you do not open any port on your router.

If you have not read it yet, Connecting your machines explains what the agent does and how pairing differs from binding. This guide covers the computer itself.

  1. Add an agent in your dashboard

    Go to Agents and add one. You get a one-time enrolment code.

    The agent is listed as not yet connected, and you have a code to copy.

  2. Download the agent

    Open the agent download page on the computer that will run it. The page suggests the build that fits that computer. A Raspberry Pi needs one of the Linux ARM builds. Put the file anywhere you like.

    You have a file called yantra-agent (on Windows, yantra-agent.exe).

  3. Connect it with the enrolment code

    Open a terminal in the folder with the file and run this once. The --name part is optional.

    ./yantra-agent enrol --code YOUR-CODE-HERE --name "Shed 2 bench"

    The agent prints its id and saves its own secret on this computer.

  4. Start it

    ./yantra-agent run

    Leave it running. Press Ctrl and C to stop it. It finishes what it is doing first, so stopping it is safe. A job that is already printing keeps printing.

    The agent shows as connected in your dashboard, and starts looking for printers on your shop network.

  5. Pair your machines

    In Agents, choose Pair printers. Every machine in your fleet is listed with the printers the agent found. Say which is which. The agent never guesses, because a printer paired to the wrong machine prints the wrong part.

    Paired machines show live status on the Production Floor.

Check the download

The download page shows a SHA-256 checksum next to each file. To check yours, run the line for your system and compare the result.

sha256sum yantra-agent          # Linux
shasum -a 256 yantra-agent      # macOS
Get-FileHash yantra-agent.exe   # Windows PowerShell

Where the agent keeps its files

Everything lives in one folder:

  • Linux: ~/.config/yantra-agent
  • macOS: ~/Library/Application Support/yantra-agent
  • Windows: %ProgramData%\yantra-agent

To use a different folder, set YANTRA_AGENT_HOME. That is also how you run two agents on one computer. Inside the folder:

  • agent.json lists the machines this computer drives. It is safe to share, for example in a support request.
  • credentials.json is this computer's own secret. Never share it. The agent refuses to start if other people on the computer can read it.
  • data holds the agent's saved work and its copies of job files.

Editing agent.json

For most printers you never edit this file. After pairing, run ./yantra-agent sync and it writes the entries for you. Run it again whenever you add a printer. It leaves anything you wrote by hand alone.

Some machines, such as a Klipper printer, are added by hand. Create the machine in your dashboard, pair it to the agent, then add an entry. Each entry ties one machine in your fleet to one driver:

{
  "cloudUrl": "https://yantrabhavan.com/seller",
  "machines": [
    {
      "machineInstanceId": "<the machine's id>",
      "driver": "moonraker",
      "config": { "baseUrl": "http://mainsail.local" }
    }
  ]
}

Every entry has the same three keys. machineInstanceId is the machine in your fleet, driver says how the agent talks to it, and config holds that driver's settings. The drivers below are the ones this guide covers.

Elegoo Centauri Carbon (driver: centauri)

  • mainboardId (required): the printer's id. Pairing or ./yantra-agent discover gives it to you.
  • host (optional): the printer's IP address. Leave it out if you can. Without it the agent finds the printer by its id, which keeps working if your router hands out a new address.
  • uploadPort (optional, default 80): the web port used to send files.
  • printPlatformType (optional, default 0): the code for the build plate type.
  • calibrationSwitch (optional, default 0): set to 1 to make the printer calibrate before each job.

Klipper (driver: moonraker)

  • baseUrl (required): the address of your Moonraker, for example http://mainsail.local or http://192.168.1.50:7125.
  • apiKey (optional): only if your Moonraker asks for one.

Keeping it running

While you are setting things up, run the agent in a terminal with ./yantra-agent run and watch it. Add -v for more detail in the log. In another terminal, ./yantra-agent status shows what the agent knows about itself.

The agent is built to be stopped at any time. Jobs it has received are saved first, and after a restart it picks up whatever your machine is actually doing.

To start it automatically after a restart, yantra-agent service install will do this for you in a later agent version. It is not available yet. On Linux you can set it up yourself without administrator rights as a user service. Save this as ~/.config/systemd/user/yantra-agent.service:

[Unit]
Description=Yantra shop-floor agent
After=network-online.target

[Service]
Type=simple
ExecStart=%h/bin/yantra-agent run
Restart=always
RestartSec=5

[Install]
WantedBy=default.target

Then turn it on:

systemctl --user daemon-reload
systemctl --user enable --now yantra-agent
systemctl --user status yantra-agent

To keep it running when nobody is logged in, an administrator runs loginctl enable-linger for your account once.

Starting over or moving to another computer

  • Moving to a new computer: issue a new enrolment code for the same agent and run enrol on the new computer. The name, machines and history come with it. The old computer stops working as soon as you issue the code.
  • Retiring a computer for good: revoke the agent in the dashboard. The record of what it did stays.
  • Removing an agent made by mistake: delete it in the dashboard. Its history is erased too.

./yantra-agent reset clears what is saved on the computer itself. It does not cancel the agent's access. Only the dashboard does that.

When something is not working

  • Enrolling says the code is invalid or has expired. Codes work once and expire quickly. Make a new one in the dashboard.
  • Enrolling says the agent is already enrolled. Run ./yantra-agent reset first if you really mean to enrol again, then use a new code.
  • Enrolling fails with a 403. The problem is on our side, not on your computer. Contact partner support, then try again with a fresh code.
  • The agent says its credentials file is readable by other users. It refuses to run on a secret others could read. On Linux, run chmod 600 on credentials.json.
  • The agent runs but a machine shows offline. Offline means the machine cannot be reached, not the agent. Check the address in agent.json, and that this computer can reach the printer.
  • Pairing says the agent has not reported any devices. It reports when it starts and every few minutes after. Check it is running with ./yantra-agent status. It only sees what its own network can reach.
  • discover finds nothing. Try a longer wait first: ./yantra-agent discover --timeout 15s. If it still finds nothing, the computer and the printer are probably not on the same network. A VPN, a guest network, or a Wi-Fi router that keeps devices apart will block it.
  • It keeps reconnecting. Read the log line. It names the reason. Two common ones are a computer clock that is far out, and a company proxy that blocks live connections.

In short

Add an agent, download the file, enrol it once, run it, then pair your machines. Keep the enrolment code safe until it has worked. Back to Connecting your machines.