[RPi] OctoPi | Bryan Zhu

(still in the process of writing everything up to post it)

Contents

  1. Overview
  2. Setup
  3. Slicing Profiles
  4. Mounting the OctoPi on the Printer
  5. Timelapse Creation

Overview

By default, the Anet A8 has no networking capabilities. The only ways to print something out on it are to physically insert a microSD card loaded with your sliced files into the printer's motherboard, or connect that motherboard to your computer via USB. This proves inconvenient and inflicts unnecessary stress onto the microSD card slot that can lead to issues in the future, while busy computers can sometimes affect the delicate timings involved with sending Gcode and cause printing errors when under heavy load. As OctoPi added official support for the Raspberry Pi Zero W with the release of version 0.14.0 on July 5th, I became interested in connecting a spare I had lying around to the motherboard and loading it with OctoPi so that I could send files over my local network to the printer without leaving my computer.

OctoPi also allows me to monitor my printer in realtime via webcam, something I had always been interested in implementing. Heated beds on 3D printers can get as hot as most stovetops, so attention to safety is always important when running one. It's also recommended to never leave an active printer unattended because of this, so I've been running my A8 in the same room to keep an eye on it. Even with the polymer bearings I swapped in however, it still produced a sizable amount of noise that was hard to ignore. Having a webcam aimed at the printer would allow me to check up on my prints whenever I wanted to no matter where I was in my house. Being able to place the device in another room would also enable me to give it better ventilation, making ABS prints a somewhat more viable option for me (ABS filament smells pretty bad when heated up).

↿ Back to top ↾

Setup

Thanks to the efforts of Gina Häußge and Guy Sheffer (creators of OctoPrint and OctoPi respectively), setup was pretty painless. I downloaded the most recent OctoPi image from their website (version 0.14.0 at the time of writing) and used Etcher to burn it to my microSD card. Once it finished burning, I opened it up and edited octopi-network.txt, adding my home network's SSID and PSK so that the device could connect to my local network upon startup.

Once completed, I inserted the microSD card into the Pi, logged into it, and started up raspi-config to change its default password (for obvious security reasons), and various network settings such as hostname (from "octopi" to "octopi-aneta8" for more clarity), and locale (from en_GB to en_US). I also set Boot Options to Console Autologin to make setting up the printer again after moving it or after power failure easier (otherwise the web interface is only accessible via its local IP address). After that, all existing packages were updated, and fail2ban and ufw were configured and enabled to help defend against malicious intrusions (for the latter, ports 22, 80, and 443 were allowed for SSH, HTTP, and HTTPS access respectively).

I then installed Bonjour (Apple's Zero Configuration Networking standard, or Zeroconf) on my Windows workstation using the latest installer extracted from Apple's iTunes installer. By doing so, I would be able to enter the hostname.domain for my OctoPi installation (in this case, octopi-aneta8.local) into my browser rather than my Pi's local IP address, which will change over time since I did not set a static address for it. Since the OctoPi's SSL certificate is self-signed, I can also connect via https as needed, though exceptions need to be created in browsers to recognize the certificate during the first visit.

After a webcam is hooked up to the Pi, via either ribbon cable (which lets the GPU handle stream processing) or USB (which will put lots of load on the CPU, not recommended for an RPi Zero W on WiFi), direct streaming becomes available at both /webcam/?action=stream and its configured port (default 8080) at :8080/?action=stream. You'll generally want to do a check to see if the webcam is compatible with Linux operating systems, but nowadays this isn't as big of an issue since the more common drivers are supported and preinstalled. This was the webcam I used with my Pi, and it worked out of the box with no issues whatsoever.

↿ Back to top ↾
Slicing Profiles

↿ Back to top ↾
Mounting the OctoPi on the Printer

Rather than leaving the OctoPi dangling off the side of the desk, I wanted to fix it and all relevant wiring to the printer itself. To do so, I created separate mounts for both the OctoPi and the webcam and printed them out.

I wanted to fix both the OctoPi and its OTG USB port hub to the printer together, and this case was the result of that.

In order to create a more aesthetically pleasing video stream, I wanted to make the webcam stationary relative to the printer's build plate rather than the printer itself. That way, layers would be seen building up naturally as the print progressed.

↿ Back to top ↾
Timelapse Creation