Thursday, April 19, 2018

Octopi and Octoprint

Cura used to hang during long print jobs, when I used it to drive the printer from my desktop. (Lulzbot Mini has a USB connection, no SD card slot.) Octopi addresses that problem, and adds some additional useful features.

Octopi is a Raspberry Pi linux build that runs Octoprint, connecting on USB. It's basically a mini-computer that acts as the printer server.

The benefits of Octoprint:
  • A dedicated server - nothing else is running on it, making it very stable
  • Built-in web-based GUI - you can upload files directly to it, start/cancel jobs, extrude/retract, heat bed/nozzle...
  • Plugins are available, including API access (I use it for the Octowatch app for my Pebble)
  • Any computer on your network can access it (and there is id/password for control)
  • USB webcams can be easily added in for monitoring/time lapse
  • Modern Cura/slic3r plug directly into Octoprint, allowing you to send gcode directly from your laptop/desktop slicer application - can print these files without proper settings in Octoprint
  • If the micro SD card stops working correctly, wipe it, reinstall
The challenges of Octoprint:
  • Must open the web browser to reconnect to the printer, after the printer has been off
  • Has its own printer settings (used ONLY when uploading stl files to Octoprint)
It took a number of failures. Starting with a Raspberry Pi 2 B+, with a wifi USB stick, keyboard, mouse, monitor...Octoprint didn't work. I put the Octopi image on the micro SD card from my desktop OSX, following the instructions. Could see it on the network, log into it from ssh, but couldn't see it as http://octopi.local from a browser. Eventually it did work, after repeating the process again. Either the micro SD card's image got corrupted, or I don't follow directions easily.

I picked up a Raspberry Pi 3 and created the image (and made the changes to wifi) from a linux laptop. The only thing I plug into the USB ports are the $5 USB webcam from Goodwill and the printer's USB connection. It's magic. There's even a Pebble app (Octowatch, Gullickson Laboratories) that can connect to Octoprint with minimal fuss. Octowatch has some basic functions: time remaining, pause/restart, and my favorite "run again"/stop. Run again is pretty sweet, especially if you're duplicating a previously successful print.

Tips for setting up Octoprint correctly:

  • If you are on ANY system that auto-corrects you, be cautious when you are editing the octopi-network.txt file on your pre-Pi run. Smart quotes suck. Make sure it gets saved as plain text. (Edit: Current Octopi, edit octopi-wpa-supplicant.txt instead, as octopi-network.txt is non-functional.
  • If you are having problems later on, wipe the card and reinstall. Your image can get corrupted, through no fault of your own.
  • Change your password, when you first log in. When I set up my first pi, I thought I needed a keyboard and monitor...no. Maybe if you are going to troubleshoot it, otherwise...just remote into the pi from your existing computer.
  • Use the IP address seen from the router - your router might let you reserve the local IP for your Octopi, this is a benefit from finding it again on a webpage. (For example, Octoprint #1 is 192.168.1.11, while #2 manages a different printer on 192.168.1.12.) If you don't reserve an IP, the router will assign random IPs whenever it is powered back on. If you have octopi.local working 100%, maybe you won't be using IP anyways.
  • Sending files through web browser - that's when Octoprint's Cura set-up matters. If you are just sending it gcode through your Cura desktop application...I don't think settings need to be accurate. Nozzle size, etc...as long as you have it correct where you generate the gcode, you should be fine. (I ran Octoprint with an incorrect nozzle setting, and didn't notice it until I was trying to use Octoprint to measure how much filament was being sent through vs. e-steps. Impossible numbers.)

Useful Linux commands for your Pi:

  • ps -ef | grep oct
This will show any octoprint services running. If you don't have a line with "/home/pi/oprint/bin/python /home/pi/oprint/bin/octoprint serve --host=127.0.0.1 --port=5000" - this means you can't log in through the web browser. 

  • passwd
Changes the password for the user "pi", that you are logged in as. Always change the default from "raspberry".
  • exit

Will log you out.

For future readings, I also plan on looking at this: https://discourse.octoprint.org/t/how-do-i-backup-my-octoprint-settings-on-octopi/1489 - backing up an entire card (in addition to maybe backing up Octoprint settings).

No comments:

Post a Comment