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).

Blender Things I Did Not Know (Part 1)

Blender has a lot of techniques, for doing the same thing. It's great, in some ways - multiple paths to find a solution. There are faster techniques, there are more accurate techniques. If you're like me, you watch tutorials on YouTube when you're considering a problem.

At two years into Blender, I know some things. It means that tutorials will typically cover 95% of what I already know, and...I have to watch the whole thing to squeeze out 5% of the value.

This starts sharing my reading list of things that I didn't know.

Joining, Merging, and Filling Holes:

Repairing a Mesh

I've used his first two methods. "(F)ill" has always been "(f)ace" in my head. His second method, he chose a single edge to make a face from. I usually (f)ace from two opposing edges, or the 4 vertices. A single edge? Well, saves me small amounts of time.

His third method, eek. I didn't know the "alt"-when selecting an edge helps with edge loops. (Saves me button clicks of Select>Edge Loops.) And I didn't use J to join to vertices to make an edge within a plane...I've been using the Knife Tool. The Knife tool has some cool benefits to it, but J is fast.

Jimmer's 4th method, not covered...I would have extruded a vertex along a x/y/z axis to get a corner, and get the x/y/z axis correct by inputing the numbers in (make sure you are in Global, not Local). Create edges to the other axis vertices (f). Subdivide the edge a correct number of times, make faces. You only need to get coordinates right for that corner, and subdividing is a fast Ctrl-E away...you can add more than one cut as needed.

Reading the YouTube comments, there was some slightly more complex things to get vertices lined correctly, using the third method. Change the Pivot to Active Element (this is found on the bottom bar), grab the vertices you want to line up, and the final one is what you want them to align with. Then (s) for scale, (y) for the y-axis, (0) to zero them. Interesting and fast.

Normals

A friend asked me how to fix normals when importing things in from Maya. I wasn't familiar with it, so I basically just pointed to Mesh>Normals as the solution. Sometimes when working in Blender, I've noticed off-color faces...I had to delete faces, rebuild them...I now understand what those faces mean. And what the Shading/UVs tab in the upper right gets you....and you can Flip Direction on a single face. A much faster and cleaner response to the occasional "Blender doesn't know what you're doing" trigger.