Results 1 to 10 of 232
-
09-18-2014, 06:06 PM #1
Using a Raspberry Pi + Octopi to manage your printer
It didn't take me long to get tired of uploading files to the SD card via sneaker net. Moreover, I really wanted to be able to control the printer more easily than the LCD/knob interface and some control options were not available via the LCD/knob. Finally, I really wanted to be a be able to check out prints when I wasn't in the same physical location as the printer and to be able to record prints so that when something goes wrong, I have a way to get some visualization around the time of the problem.
I happen to have a Raspberry Pi B from another project that was severely underutilized. The current models come in two flavors: B & B+. I would recommend the B+ for someone who might be purchasing one new for this project. It has more USB ports so it is possible to plug in a WiFi USB dongle, the Arduino/RAMPS, and a USB web cam (more on all that later). The Pi is cheap, ubiquitous and there is a lot of support for it on the web. There are alternatives such as the newly introduced Intel Galileo, but again, there are so many Pis out there that support is great and the community is vibrant.
The above needs and the fact that I happen to have a Pi led me to try out a few different solutions, including Repetier-Server (RS), Printrun (pronterface), and Octoprint in the form of OctoPi.
For RS & Printrun, I used a fresh install of Raspbian on a 32GB SD card setup with Apple Pi Baker. I used to prep SD cards for the Pi with dd, etc. but tools like APB are just easier. UNetbootin also works well and seems to work on Windows and Linux, too. To setup Printrun, check out a site like this one. Printrun's pronterface works as it does everywhere. Unfortunately, it ran like a dog on the Pi. To use it, I had to ssh -Y into the Pi and display the interface using X-windows. If that sounds like greek to you, probably should skip Printrun. To setup RS, download the Pi tarball from their site and follow the directions. In my hands, however, RS never really worked properly. It would disconnect or not connect at all. The web interface (in my opinion) was ugly and the functionality not intuitive.
To setup OctoPi, on the other hand, all I had to do was download the SD card image, load on to SD card with APB and plug it all in. It came preconfigured with the web server all setup and the web cam service ready to go once a cam was plugged in.
For RS, Printrun and OctoPi, before plugging the Pi into my printer, I had to enable the WiFi dongle. I was too lazy to plug my Pi into an HDMI monitor and find a USB keyboard so I just plugged the Pi into my router via ethernet, found the DHCP assigned IP and configured the WiFi, and did it via ssh (see below). You could just as easily do it with an HDMI monitor/TV & USB keyboard - just leave out the ssh commands below.
Code:# first, ssh in and setup passwords and root ssh ssh pi@192.168.X.Y password: raspberry # setup pi password (change from raspberry) passwd # setup root password for root ssh sudo passwd # configure the installation sudo raspi-config # Select: 1. Expand File System (Fill SD card) sudo reboot
Code:# ssh in as root ssh root@192.168.X.Y # always useful to have vim! sudo apt-get install vim Y # now populate the SSID information for the Pi's WIFI client: cat << EOF >> /etc/wpa_supplicant/wpa_supplicant.conf network={ ssid="yourSSID" psk="your_passwd” key_mgmt=WPA-PSK } EOF sudo reboot
As I mentioned, I'm using a web cam. I happened to have had an old (maybe 8 years?) web cam: Logitech QuickCam Pro 9000. I didn't expect it to work given its age and the possibility of no drivers for the Pi, but it fired right up. I am also exposing a port on my router that will redirect to the web cam on the Pi so that I can watch the printer when I'm away from home. The OctoPi distribution ships with a preconfigured mjpg-streamer that just works. It does, however, expose a web interface that allows the camera settings to be modified. I didn't like this so made the default page that mjpg-streamer serves a simple stream on white background page (see below). In addition, I also copied back the stream.html that OctoPi wants to find for the embedded stream:
Code:ssh pi@octopi cd mjpg-streamer mv www www.back mkdir www cp www.back/stream_simple.html www/index.html cp www.back/stream.html www/stream.html sudo /sbin/shutdown -r now
Finally, I wanted to update to the latest OctoPi (at this time 0.10.0) which has some new features. Here are some directions and my commands:
Code:ssh pi@octopi cd ~/OctoPrint git pull ~/oprint/bin/python setup.py install sudo service octoprint restart
When I installed Cura it broke everything. It requires a gcc upgrade that causes OS updates to compile but fail to run correctly, bricking the SD. Why should I slice on the Pi anyway?
The web interface works with every device I've thrown at it, including an iPad, iPhone, Windows Phone, Chrome, Firefox, Safari, IE. The mjpg-streamer works on all of the browsers except the Windows Phone.
I'm sure I've missed stuff here so I will edit this page to add anything - it is basically just a dump of my notes from a Google Doc. Please ask questions because it will help make this more useful. If people want, I can throw up some screenshots.
Edit: It is also nice to be able to add firmware remotely: see post #14Last edited by dacb; 09-23-2014 at 10:59 PM. Reason: Changed SSID to be generic; added no Cura tip; added link to post with uploading firmware info
-
09-18-2014, 06:14 PM #2
You can get a Pi from a lot of places, including Amazon, Element14, Ebay... I'd probably buy a B+ for a new install because it has more USB ports so you can plug in a web cam, the Arduino and a WiPi without a need for an external powered hub. One option is to buy a Pi kit that includes a power supply, formatted SD card, the Pi itself and maybe a case. Don't bother with a case (you will be printing one soon, right?). I didn't go this route, so here is more info on my particular config.
I power my Raspberry Pi with a 2A charger for USB devices. There are 'special' power supplies for the Pi, but usually these boil down to a relabeled higher output USB charger.
For a WiFi dongle, I use the WiPi from Element14, but there are a lot of compatible dongles.
You will also need an SD card. I used a 32GB card so that there is plenty of space for Gcode and the MJPG movies of the prints that are created.
Finally, I used a web cam I had hanging around. A list of compatible web cams is here.Last edited by dacb; 09-18-2014 at 06:17 PM. Reason: More info is good!
-
09-18-2014, 07:07 PM #3
Thanks for compiling the useful info. It'll give me something to experiment with as the winter weather sets in...
-
09-18-2014, 08:19 PM #4
Here is an example video from a print: https://drive.google.com/file/d/0B74...it?usp=sharing
It took a frame at every Z-change. I think I like doing it at 10 second intervals better. The options in OctoPi for image capture into time-lapse movies are on Z-change or timed.
It looks like my LED lights in the extruder carriage fell down during the print!
This is a print of this skull shrunk down to ~25% IIRC.Last edited by dacb; 09-18-2014 at 08:54 PM.
-
09-19-2014, 07:27 AM #5
dacb, this is awesome! Thanks for all the great info, I feel safe buying a raspberry pi knowing that you have this expertise if something goes wrong! Consider my raspberry pi ordered.
That's cool that you can use a USB webcam because I have a supported one lying around already! Do you think there is any reason to buy and use the raspberry pi dedicated camera instead?
I'm gonna slam dunk that alley-oop you tossed me about your LED's falling in to your print with this!
http://www.thingiverse.com/thing:438960Last edited by gmay3; 09-19-2014 at 09:49 AM.
-
09-19-2014, 09:30 AM #6
Great guide! I was already looking into setting up OctoPi and creating a guide, but you've accomplished more than I would have, especially with the static IP and forwarded ports to use the webcam from anywhere. I can't wait to set this up!
Thanks for the guide, can't wait to see what else you post.
-
09-19-2014, 11:18 AM #7
- Join Date
- Jul 2014
- Location
- Eastern Colorado
- Posts
- 536
I just use two zip ties to keep my lights from falling off. Luckily the i3v X carriage backplate has two unused holes at the bottom which I used for this purpose.
-
09-19-2014, 04:48 PM #8
Glad it is useful! No reason to buy anything extra. Use what you've got!
I like your light fixture. I've thought about it a lot. I am running an auto bed leveling setup which looks like it would interfere with one side...
You know, I've never noticed those holes before! They could be useful for mounting all kinds of stuff!
-
09-22-2014, 08:56 AM #9
Got my Raspberry Pi B+, power supply, and USB Wi-Fi Module yesterday! I plan on trying out all of this today, maybe even while printing an enclosure
Here's what I ordered, just for reference. I'll report back on how well everything works and will post any issues I have along the way! (Not mentioned below is a Micro SD card and a Logitech C615 HD Webcam that I had on hand)
Raspberry Pi B+
http://www.amazon.com/gp/product/B00...?ie=UTF8&psc=1
2A Micro-USB Power Supply
http://www.amazon.com/gp/product/B00...?ie=UTF8&psc=1
USB Wi-Fi Module
http://www.amazon.com/gp/product/B00...?ie=UTF8&psc=1
-
09-23-2014, 01:48 AM #10
Ender 3v2 poor printing quality
10-28-2024, 09:08 AM in Tips, Tricks and Tech Help