What follows is a collection of notes I compiled for setting up my current (as of 2019) 3D printer. Table of contents for major sections as follows:

1. Costs
2. Subtractive modifications
3. Printable mods
4. Octoprint
5. `mjpg-streamer` tweaks
6. Raspbian tweaks
7. G-Code tweaks

1. Costs

1 x Ender 3: £176

  • 50% cheaper vs previous 3D printer (Wanhao Duplicator i3 plus): £339

1 x Raspberry Pi Zero W: £18

  • remote monitoring and print control

1 x Pimoroni Scroll pHAT HD £10

  • enables night-time printer monitoring via webcam

2 x buck DC-DC step-down converters £2

  • for powering the silent fans

2 x Noctua 12V 40x40x10mm fans £23

  • reduces operating noise

1 x Gelid Silent 6 Case Fan 60x60x15mm 12V fan £8

  • quieter power supply fan
  • power supply original was 12V, no buck converter needed

5 x Small heat sink 13x20mm on top of SOC £2.27

  • Conductive thermal adhesive (2 rolls for £4.92)

2 x NEMA17 stepper motor dampener (X, Y only) £4.30 for 3

2. Subtractive modifications

  • Removed LCD control panel (since using OctoPrint fully instead)
  • Taped off pin 1 from the USB OTG to mini-USB plug, this is the VCC pin, which feeds unnecessary additional power to the printer board (!) Without it, the board fan buck converter blew up during start-up phase of the printer (board fan full blast for 3 seconds then speed 0 for this fan)
  • Running camera, wifi and OctoPrint on RP0W, current draw is OK https://discourse.octoprint.org/t/rpi-zero-w-and-cameras/1620/12

3. Printable mods

4. Octoprint

Octoprint is a 3D printer control service that has a web interface. You can use it to directly command your 3D printer over WiFi.

These are basic changes to Octoprint I have ended up with:

  • Installed OctoPrint plugins:

  • Disabled OctoPrint plugins:

    • Announcement Plugin
    • CuraEngine Plugin
    • Discovery
    • Software Update
    • Virtual Printer
  • Disabled API

  • Disabled GCodeViewer

  • Disabled Feature “SD support”

Octoprint install

  • Enable cam module first > Interfacing options
sudo raspi-config
  • Use rpi cam module
  • Settings from https://www.raspberrypi.org/forums/viewtopic.php?t=192467
./mjpg-streamer/mjpg-streamer-experimental/mjpg_streamer -i "./mjpg-streamer/mjpg-streamer-experimental/input_raspicam.so -fps 20 -x 1024 -y 768 -q 10" -o "./mjpg-streamer/mjpg-streamer-experimental/output_http.so -w ./www" &

Stream available at http://raspberrypi.local:8080/?action=stream

  • Run OctoPrint
./stable/run serve --basedir ~/.octoprint/stable &

5. mjpg-streamer tweaks


SD = socket descriptor

  • Change MAX_SD_LEN value to 2 (1 x stream socket, 1 x snapshot socket; I’m the only one using it in my house)


Change these to 1 each, since we’re only using raspicam and http

2 new scripts: 

  • faster compilation and run test script
  • optimal framerate-vs-CPU balanced settings startup

CPU load comparison

  • Baseline CPU usage ~3% (raspbian without mjpg-streamer running)

  • mjpg-streamer usage with 1 streaming clients ~29%

  • mjpg-streamer usage with 4 streaming clients ~50%

  • mjpg-streamer usage with 6 streaming clients ~65% (max 6 simultaneous connections)

  • Modded mjpg-streamer usage ~40% with 2 streaming clients (capped at 2 clients)

6. Raspbian tweaks

Octoprint is running on a Raspberry Pi Zero W, which is lower spec than recommended. Here are some of the things I did to make its operation more reliable.

Give it a static IP on your home network (so we can disable some services later)

sudo vim /etc/network/interfaces

Add these lines to the file:

iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static

Bring the wifi interface down and back up to get your new static IP

sudo ifdown wlan0 ; sudo ifup wlan0

Check to see if the static IP has stuck


Add wifi startup to /etc/rc.local

ifup wlan0

Disable DHCPCD

sudo systemctl disable dhcpcd

You can then add an alias for the static IP to your hosts file on your main machine by editing the /etc/hosts file.

sudo vim /etc/hosts

Remove unused services

# Disable Bluetooth driver loading 
# (add these lines to /etc/modprobe.d/raspi-blacklist.conf)
	blacklist btbcm
	blacklist hci_uart

# Disable Bluetooth service
	sudo systemctl disable bluetooth
	sudo systemctl stop bluetooth

# Disable timesyncd (NTP service)
	sudo systemctl stop systemd-timesyncd
	sudo systemctl disable systemd-timesyncd

# Disable multi-cast DNS support
	sudo systemctl disable avahi-daemon
	sudo systemctl stop avahi-daemon

# Disable triggerhappy (power button support)
	sudo systemctl disable triggerhappy
	sudo systemctl stop triggerhappy

# Disable WiFi power management
	sudo iwconfig wlan0 power off

7. G-Code tweaks

G-Code is the 3D printer firmware’s native language: these are lowest level commands that tell each stepper motor how and when to move. These tweaks help ensure the execution of the print start and finish correctly.

Start of Print GCode tweaks

; Default Cura 3.4 start script
G21 ;metric values
G90 ;absolute positioning
M82 ;set extruder to absolute mode
M107 ;start with the fan off
G28 X0 Y0 ;move X/Y to min endstops
G28 Z0 ;move Z to min endstops
;not needed (jsyang)
;G1 Z15.0 F9000 ;move the platform down 15mm
G92 E0 ;zero the extruded length
G1 F200 E3 ;extrude 3mm of feed stock
G92 E0 ;zero the extruded length again
G1 F9000

; taken from https://www.youtube.com/watch?v=6csbJ5965Bk
; Prime and wipe nozzle - tweaks for magnetic bed
G1 Y30.0 F500.0 ; move out of print volume
G1 X60.0 E9 F500.0 ; start purge
G1 X100 E12.5 F500.0 ; finish purge line

End of Print GCode tweaks

; End with bed forward instead of backwards
M106 S0 ;cooling fan off
M104 S0 ;extruder heater off
M140 S0 ;heated bed heater off (if you have it)
G91 ;relative positioning
G1 E-1 F300  ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more
G90 ;absolute positioning
G1 X0 Y0 ;home x and y
G0 Y200 ;move bed forward
M84 ;steppers off
G90 ;absolute positioning