Setting up OctoPrint

OctoPiThis post will be a continual scratchpad of info as I use Octoprint…

I’ve toyed around with OctoPrint in the past:  Before I built the C-Bot I was seriously considering buying a Type A Machines Series 1 printer:  They use OctoPrint, so I’d installed it on a spare Raspberry Pi and played around with it and my Replicator 1.

With the C-Bot, based on its large build size, I want a way to be able to remotely track & control my prints:  If I’m not around I can check up on them, pause\stop them if needed in case of failure.  OctoPrint is perfect for this.  So I decided to finally get it installed and configured on my Raspberry Pi.

Below are the rough steps I went though to make this happen.  It’s still not quite ready yet for primetime:  I need a way to get the Raspberry Pi & it’s camera to correctly point at the build plate, and a slick case\mount to stick the RPi to the printer (see the next post).  But technically I have everything up and running now.

Update:  Note that all the trouble I had at any step with the install stemmed in some way from trying to configure wifi successfully:  I later switched over to ethernet, and all my problems went away.

My Tech Specs:

Setup Process:

  • Install OctoPi disk image.
    • GitHub : Download & install docs I followed.  See “Problems Encountered” below….
  • If you plan on accessing OctoPrint via the web, make sure that “Access Control” is on (which it is by default with any modern install of OctoPi), and you have a valid login.  See here.  First line of defense keeping people from taking control of your printer remotely.
  • In your router, give the RPi a static IP.  This allows you to log in consistently (locally or remotely), without worrying that your router can dynamically change the IP at some point.
    • While it was connected to my router (provided via Comcast), via the router’s control panel, I found and stored it’s MAC address.
    • Next I had to make my router “forget” the RPi:  For me, I had to first turn off the RPi, then in the router “block” it, then “delete it”.
    • With the RPi unconnected, using its MAC address I was able to add it it with a staticIP (My static range was 10.0.0.253+), rather than DHCP.
  • To allow for remote (web-based) control, in the router control panel, setup port forwarding based on that static IP, for port 80.
  • To view OctoPrint locally, I can browse directly to the static IP I assigned.  Note I was never able to go to hoctopi.local/ either over ethernet of wifi:  I get a constant “webpage not available”.
  • To view Octoprint over the web, I use a search like “what’s my ipv4” to find my homes IPv4 address.  Plugging that back into the browser takes me directly to the Octoprint control panel (presuming it’s on).
  • I have yet to setup a Dynamic DNS service for my IP.
  • Yet to mess with any of the Haproxy stuff.

Configuring the PiCam:

The defaults for the RaspberyPi Cam appear to be 640×480, I’m not sure of the framerate.  That’s a good base starting point, but it can be better.

  • I edited/boot/octopi.txt to set the res to 1280×720 (720p) at 30fps:  The camera tech-specs claim it can do this at 60fps, but I think that’s unnecessary for 3d printing.
  • In Octoprint, in Settings, under Webcam:
    • Set the ‘Timelapse bitrate’ to 10000k, to improve the timelapse movie quality after conversion.
    • Set ‘FFMPEG threads’ to 4 (since I have a RPi 2B, that is quad-core) : This will make the timelapse movie creation faster.
  • Next, I need to get a pair of +2 reading glasses to help bring the focal distance in.  Right now it seems to focus best at the rear of my printbed.

Problems Encountered:

  • I had decided to update my OctoPi image to current since the last install I had done was a good ten months ago:
    • After following all the install instructions, I was unable to get wifi working.
    • Based on the install instructions (here, under “How To Use It”), they have you modifying the octopi-network.txt file on the SD card:  I’m on a Mac, and used TextEdit to do this.
    • After three hours of being unable to connect over wifi, I finally dug out my spare monitor and keyboard, so I could log into the RPi directly.
    • I used nano to edit octopi-network.txt:  To my surprise, the password and ssid values, that should have been surrounded in quotes “”, were instead surrounded by solid white squares:  Some weird special character:  Changing these to “real quote characters” and rebooting fixed the connection issues.  Thanks a lot Apple…
  • I get terrible camera refresh when connected over wifi:  Maybe 1 new frame every… 30 seconds?  Unusable.  I pay for a smoking hot internet connection, so something is amiss.  My google ping is around 900 ms.  If I switch over to ethernet the cam us up to 1-5fps (just guessing) and my google ping is 10-20ms:  Actually usable.  In either case however, the machine control panel is responsive:  I’m able to remote control it without much lag.  At any rate, I ordered a new wifi adaptor (the one listed above), and I immediately got acceptable refresh:  A 1-2 second lag with 5-10fps.  Which wifi dongle you get really matters…
    • Update:  After two days, my new wifi dongle started behaving the exact same:  Super slow refresh.  I had to drop my capture rate to 3fps, at 640×480 for it to behave.  Any faster capture rate would cause increasingly bad lag in the view.  So I went out, got a 50′ cat5 cable, switched to ethernet, and problem solved.  Super speedy camera refresh.  Ethernet FTW.
  • On a number of occasions the PiCam wouldn’t turn on.  Long story short:  The 3d printed bracket it fits into was causing the small connector on the front of the cam to actually disconnect from the cam’s PCB.
  • For the longest time I couldn’t get OctoPrint to shutdown via its ‘System’ menu.  All the other buttons worked except those.  Long story short:  It appaered that having Chrome auto-log me in was causing this:  Logging out & logging back in (without ‘remember me’ checked) seems to have fixed it.

Links:

FAQ Topics:

Building the C-Bot 3D printer: Part 30 : Switching from Bowden to Direct Drive

Jump to C-Bot blog index to see all the posts.


The original design for the C-Bot by Carl Feniak had the printer setup with a Bowden extruder: The stepper pushing the filament to the hotend sat off to the side of the printer, thus removing mass from the XY/hotend gantry:  The idea is that if there is less moving mass, you can print faster with fewer artifacts (like “ringing” or “ghosting”).  For comparison, my Makerbot Replicator1 (or say, an Ultimaker) is ‘direct-drive’: Its extruder sits directly on the XY gantry pulling filament into the hotend.  This is what I had experience with when I started building the C-Bot, but the idea of learning something new (the Bowden setup) was interesting to me, so I went with it.

Fast-forward to now:  Not a fan of the Bowden setup, at least when used within the specs of my printer design:  I have a E3D-v6 Volcano nozzle (I’ve used .6mm & 1.0mm nozzles) on my bot, and that coupled with the Bowden design have had some quality issues I’ve been unable to overcome despite hours (days…) of test printing.  Specifically “blobs\zits” & stringing.  My guess is, simply too much pressure builds up in the (long) Bowden tube during an extrude move, so when the print goes to do a retraction, a blob still shoots out and gums-up the print, or strings out during movement.  Have not been happy with this behavior, and have been unable to remove it entirely.  Have greatly reduced it, but it’s always there… lurking…

And during this tuning process I came to the realization that a Bowden doesn’t really help things when you’re using a Volcano nozzle:  The benefit of the Bowden, again, is that it removes moving mass from the hotend, allowing you to print at faster speeds.  But with a Volcano, you actually end up printing at much lower speeds, just a greatly increased volume\flowrate.  Here’s some maths:

  • My Replicator1, with a .4mm nozzle, printing at 200 microns (‘medium res’ for that nozzle), at 120mm/sec, has a flowrate of 9.6 mm3/sec (mm cubed/sec).
  • The C-Bot, with a 1mm Volcano nozzle, printing at 500 microns (‘medium res’ for that nozzle) at 45mm/sec has a flowrate of 22.5 mm3/sec.

The C-bot printing at a little over 1/3 the speed of the Rep1, but over 2x faster print times overall (based on the flowrate).  And when you’re printing that slow, I personally don’t feel the moving mass has such a big effect.

On the flipside, if you’re building one of these bots and running a .4mm nozzle, the Bowden is probably ok:  Smaller nozzle, less pressure, less blobs & stringing.  But since I’ve never actually used one on my bot, this is only a guess.

Time goes by…

After some discussion on the Forms (starting on this page, where you can also find the files for download, and my detailed comments on its design), Carl created a new “beta” direct-drive system.  Which is just amazing of him to do, so again, many thanks Carl!  I printed them out on my rep1, spent an afternoon installing them, and what a difference!

The firs pic shows off the new direct-drive design, and a calibration print of two cylinders:  Zero stringing between them.  With the Bowden, it would look like a spider could live in there.

The 2nd print is of a 3dBenchy, with no cleanup: Almost no stringing or blobs.  Both prints used the .6mm Volcano nozzle.

For both of these, I’m using the same Simplify3D profiles as before, I just dropped the retraction from the 5ish-mm to 1mm.  So much more accurate!  Currently in the process of tuning them even more.

I also modified the rear-plate to accept the 40mm fan mount & duct as designed by trublu832 on OpenBuilds, and you can find his files here on Thingiverse:  No more dual fans, just one ducted one.

As of this post, Carl has released a new version of the parts I have yet to print, but I plan to soon.

But overall, if you plan to build one of these printers and use an Volcano nozzle, I’d highly recommend using this new hotend design.


Jump to C-Bot blog index to see all the posts.

Building the C-Bot 3D printer: Part 29 : Rearranging the Leadscrews

Jump to C-Bot blog index to see all the posts.


The C-Bot build instructions have you create a cantilevered build platform, with two rear leadscrews to drive it up and down.  Other designs have modified this to have a triple-leadscrew system where two screws are in the back, and one in the front:  This provides for better stability for the cantilevered build platform.  I’ve noticed on my larger prints a bit of “bounce/vibration” that happens on the platform as it drops over the lifetime of the print.  It would make sense that attaching the front to something would reduce this.

I seriously contemplated going to a triple-leadscrew system, but this would involve buying more hardware, cutting another leadscrew, etc.  Not the end of the world, but I’d like to work with what I already have.  I got to thinking:  Why not just take one of the rear leadscrews and put it in the front?

That’s what I did this afternoon, and so far, it’s worked out really well:  I had a long enough 20×40 cutoff I was able to put across the front of the build platform, and some spare printed corner-brackets to mount it in-place. From there, I took the right-rear leadscrew and moved it to the center.  Then I took the left-rear leadscrew and moved it to the new front location.

leadscrew_rearranged

Things noticed so far:

  • Build platform is much more rigid.
  • It’s easy to raise\lower the front\back for bed leveling by just twisting the leadscrews.

Jump to C-Bot blog index to see all the posts.

New 3D Print : Life-Sized Pirate Head

I was recently approached by one of my co-workers, Diego Teran, if I could 3d print a zbrush sculpt he’d done of a pirate head.  Looking at it, I realized it’d be a perfect candidate to print life-sized on the C-Bot.  I’ve done a number of large format prints now (most recent), and am getting comfortable with letting the C-Bot run for extended periods of time.

To start, I did a number of 100mm high versions of the head, and had a back and forth dialog with Diego having him adjust the pose on the head from straight-on to “chin slightly lifted”, so that the only support needed was under the ear-lobes.  Happy with the tiny version, I fired off the “big head print” Friday night. On Sunday morning, it had finished:

Print Stats:

  • 280mm / 11″ tall
  • 683g of “Royal Pruple” Gizmodorks PLA, extruded at 225 degs on a woodglue-slurry-coated glass build plate (unheated).  Works out to be $17 in material.
  • 31 hours, 32 minutes total print time (lol, the print estimate was 24 hours).
  • Sliced in Simplify3D, the .gcode came to 69.6 megs.
  • 2 shells, 5% ‘fast hexagon’ infill, no raft, supports under the ears only.
  • 90mm/sec print speed.
  • .6 mm E3d-v6 Volcano nozzle with 150 micron layer heights.

Overall I’m really happy with the results!

Howto: Pause Marlin for filament reload at a specific layer number

I’ve had fun in the past printing maps with water (SF Bay, Oahu) : Using my Replicator 1 & it’s Sailfish firmware, it was easy via the LCD to set a specific layer number to pause at:  Doing this, I’d calculate which layer the print transitioned from water to land, pause it there, and swap filament.

Marlin firmware (which is on my C-Bot) gives you no such feature via the LCD :  Which means you have to monitor the print, and when it appears land is printing, you quickly pause the bot, go through the manual steps (via the LCD) to lower the bed, possibly move the hotend out the the way, and do the reload.  Afterwards (via the LCD) you have to get everything back into position. Awkward.  I am aware that the latest cut of Marlin allows for filament reload via the LCD:  I’ve been unable to get it to work.  And even if it did work, it’s still not accurate enough since I’m guessing at the layer to pause at.  There must be a better way!

There is:  You can directly edit the .gcode to insert a chunk that will do exactly what you need:  Lets say you want to pause just before layer 2 starts:  You’d find the line starting with the layer change comment…

; Layer 2

in your .gcode file, and then paste this right above it (I’ve included the layer change comment in the below code, plus comments for what the commands are doing):

G91                  ; Put in relative mode
G1 Z10               ; Lower bed by 10mm
G90                  ; Put back in absolute mode
G1 X0 Y0             ; Zero (home) the X & Y
M0 Click To Restart  ; Pause and wait for the user
G91                  ; Put in relative mode
G1 Z-10              ; Raise the bed back up 10mm
G90                  ; Put back in absolute mode
; layer 2, Z = 0.45

Works like a charm :)

If your slicing software supports post-processing of the gcode, it’s possible you can do this work directly in the slicer.  I slice using Simplify3D:  In a given process, it has a section in its ‘Scripts’ tab, at the bottom, called ‘Additional terminal commands for post processing’.  This allows you to enter in script to do a text-replace in your file, to edit it for you.  I learned about it on a forum post here.

To do the above using that system, you’d need to enter this text into that field:

{STRIP ";   postProcessing,"}
{REPLACE "; layer 2," "G91 \nG1 Z10 \nG90 \nG1 X0 Y0 \nM0 Click To Restart \nG91 \nG1Z-10 \nG90 \n; layer 2,"}

Some really important things to note:

  • The fist line that says ‘STRIP’ is super important:  If you don’t do this, Simplify3D will embed a copy of the REPLACE line in the header of the gcode, but won’t properly comment it out, basically ruining the gcode.
  • In the STRIP line, there needs to be exactly three spaces between the semicolon ‘;’ and the ‘postProcessing text.  Any more or less will screw up the strip.  If you copy-paste this code, make sure there are three spaces in there.
  • As you can see, you need to insert newline characters (\n) into the string you’re building for it to show up properly in the gcode later.

Other notes:

  • Handy-dandy gcode reference.
  • If you don’t enter in some text after the M0, it’ll never un-pause (at least for me).
  • I got most of the code on my own, but was able to finish it off based on the help from this thread.
  • My printer starts off in absolute mode by default:  I know this because up at the top of the gcode, I can see a G90 command.
  • The S3D forum post here (under “Additional Terminal Commands For Post Processing”) list other post-processing commands you can use.