# OctoPrint printers The **OctoPrint printer** widget shows 3D printers run by [OctoPrint](https://octoprint.org): **OctoPi** on a Raspberry Pi, or OctoPrint installed by hand on any computer, with a Prusa, an Ender, an Anycubic or any other printer OctoPrint drives over USB. For each printer it shows the state, the progress, the time left and when the print will be done, the file name and the nozzle, bed and chamber temperatures. The widget draws the same card as the [Klipper printer](KLIPPER.md) widget, at every size, compact view included. The agent on the computer asks OctoPrint, never the phone, and it only reads: it sends no command and no G-code, so it cannot start, pause, stop or change a print. ## Set it up 1. Find the OctoPrint server's IP address: in your router, or in the address bar when OctoPrint is open in your browser. 2. In OctoPrint, open **Settings › Application Keys**, enter an application name such as `PhoneBox` and press **Generate**. Copy the key. (The user's own API key under **Settings › API** works as well.) 3. In **Settings › General › OctoPrint printers**, press **Add a printer** and enter a **Name** (what the phone shows), the **IP address** and the **API key**. The **Port** is 80 on OctoPi and 5000 for an OctoPrint installed by hand. 4. Press **Test**. It asks OctoPrint once, with what is on the page (even before you save), and says OctoPrint's version and the printer's state, or what went wrong. 5. Turn on **Read OctoPrint printers** and save. 6. Add the **OctoPrint printer** widget to a page (**Web & data**). With **Printer name** empty it shows every printer; with a name, only that one. Its options also hide the file name or the temperatures. Up to four printers can be added. The server has to be on your local network: a private IPv4 address (`10.x`, `172.16–31.x`, `192.168.x`), a link-local one, an IPv6 unique local one (`fd…`) or this computer. Any other address is refused, and so is a name that resolves to none of these (such as `octopi.local` when it does not resolve to a local address), before anything is sent. A name is looked up through this computer's DNS resolver first; an IP address needs no lookup. ### API key OctoPrint answers its API only with a key. The key is write-only, like the MQTT password: the settings page shows that one is saved but never gets it back, and it never reaches the phone or the log. **Remove the saved key**, under the printer, removes it when you save. Two things to know about the key: - The agent talks to OctoPrint over plain HTTP, so the key crosses the local network unencrypted, as it does from OctoPrint's own web page when that is opened over `http://`. - An OctoPrint key allows control as well as reading: whoever has it can start, pause or cancel a print. PhoneBox only reads with it, and it stays on this computer for that reason. An application key can be revoked on its own in OctoPrint › Settings › Application Keys. ## What the widget shows | | Where it comes from | |---|---| | State | OctoPrint's state (`/api/job` `state`): printing (also from SD, starting, finishing), paused, cancelling, error, idle. A finished job shows as finished, and "Not connected" means OctoPrint runs but has no connection to the printer | | Progress | `progress.completion` | | Time left, finish time | OctoPrint's own estimate (`progress.printTimeLeft`), else the pace so far. The phone counts down between updates and works out the finish time on its own clock | | File | The file's name without its folder and `.gcode` | | Nozzle | `tool0`, or a chip per tool head (`tool0`, `tool1`…) on a printer with several, with its temperature and target | | Bed, chamber | `bed`, and `chamber` when the printer reports one | OctoPrint does not know the current layer by itself, so the widget shows no layer line. ## When it asks the printer A printer is asked only while an **OctoPrint printer** widget on an enabled page (or in an enabled Smart Stack) shows it: every 5 seconds, `GET /api/job` and `GET /api/printer?exclude=sd,history`. While OctoPrint has no connection to the printer, `/api/printer` answers 409, which the widget shows as "Not connected", not as an error. With no such widget, with the setting off or the printer removed, the agent does not ask it on its own. Only **Test** in Settings still asks `/api/version` and `/api/job` once, when you press it. A server that does not answer is tried again after 5 seconds, then 10, 20, 40 and every 60 seconds. The phone gets each printer's name, the connection's state (and only the kind of an error) and what the table above lists. It never gets the address, the port or the API key, and it never contacts OctoPrint itself. ## Troubleshooting | The widget says | Check | |---|---| | The printer could not be reached | The IP address and the port, that OctoPrint is running and on the same network as the computer. OctoPrint should open at `http://
` from the computer | | OctoPrint refused the API key | Create a new one in OctoPrint › Settings › Application Keys, see [API key](#api-key) | | Something answered, but not OctoPrint | The port: 80 on OctoPi, 5000 for an OctoPrint installed by hand | | This address is not on your local network | Enter the server's local address (such as `192.168.1.40`), not a public one or an OctoEverywhere/Obico link | | Not connected | OctoPrint runs, but is not connected to the printer: press **Connect** in OctoPrint's Connection panel |