For sellers

Installing and running the agent

Download the agent, link it to your shop from its local dashboard or with an 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 connects out from your workshop to Yantra Bhavan, so you never open a port on your router.

The download also contains the local dashboard: a web page the agent serves on your shop's own network, on port 8800, for watching and running your printers. It is separate from your seller dashboard on Yantra Bhavan. You can set the agent up from that page in a browser, or from a terminal with an enrolment code. Either way the agent gets its own secret, and no person's sign-in is kept on the computer.

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.

Set it up in a browser

  1. Download the agent and start it

    Get the build for this computer from the agent download page, open a terminal in the folder with the file, and start it without enrolling:

    ./yantra-agent run

    The agent is waiting to be set up, and only this computer can open its page.

  2. Open the setup page

    In a browser on the same computer, open http://127.0.0.1:8800. On a computer with no screen, such as a Raspberry Pi, forward the page to your laptop over SSH and open the same address there:

    ssh -L 8800:127.0.0.1:8800 you@the-computer

    You see the four setup steps: Admin, Enrol, Activate and Printer.

  3. Create the break-glass admin

    This local account lets you in even when the internet is down. Keep its password somewhere safe. Once it exists, the page is also open to your shop network, at this computer's address on port 8800.

    Other computers on your network can now reach the sign-in page.

  4. Link it to your shop

    Choose Link with Yantra Bhavan, sign in on any device as the shop's owner or a manager, enter the code the page shows, then pick your shop and name the agent. Only approve if you started this yourself and the sign-in page shows the same code. If you would rather use an enrolment code, add an agent in Agents in your seller dashboard and paste its code instead.

    To watch printers for free without a Yantra Bhavan account, choose Monitor without linking. You can link later.

    The agent stops to restart with its new secret. Start it again with ./yantra-agent run if it does not come back on its own.

  5. Activate and add your printers

    Press Activate to load your plan, then choose Add printer. Pick a printer from Find on network, type its address and press Check IP, or fill it in yourself. Pair each printer with a machine in your fleet, or keep it Local only. Printer changes take effect after Restart now.

    Your printers appear in the local dashboard with live readings, and paired machines show live status on the Production Floor.

Or set it up in a terminal

This is the way for a computer you only reach by command line, or when the person installing it has no seller account.

  1. Add an agent in your seller 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 seller 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

Most people never edit this file: printers added in the local dashboard are written to it for you. Without the local dashboard, run ./yantra-agent sync after pairing 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 seller 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, run ./yantra-agent service install --user once the agent is linked to your shop. It refuses on an agent that is not linked yet. For that, or for a computer you keep for monitoring only, set it up yourself on Linux 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 seller dashboard. The record of what it did stays.
  • Removing an agent made by mistake: delete it in the seller 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 seller 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 seller 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.
  • The local dashboard does not open from another computer. Until the break-glass admin exists, it opens only on the agent's own computer, so use the SSH command above. After that, check that the computer's firewall allows port 8800 from your shop network. Never forward that port on your router.
  • The local dashboard says monitoring only. The agent is not linked, your shop has no active plan, or the agent has not been able to check your plan for two days. Connect it to the internet and press Activate.
  • 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

Download the file, run it, open the local dashboard, link it to your shop and add your printers. Or, from a terminal, enrol it once with a code from your seller dashboard and pair your machines there. Then read The local dashboard for what it can do, or go back to Connecting your machines.