Close



Page 1 of 24 12311 ... LastLast
Results 1 to 10 of 232
  1. #1
    Technologist dacb's Avatar
    Join Date
    Aug 2014
    Location
    Edmonds, WA
    Posts
    139

    Lightbulb 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
    Once the Pi rebooted, I was able to ssh in as root and setup the WiFi client:

    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
    
    I also took a moment to have my router assign the Pi's WiFi MAC address a single IP via DHCP. I do this so that I will always know the address of the Pi on the network. I also forced the router to assign the octopi hostname to the Pi. You may or not be able to do this with your router.

    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
    Now, go to http://octopi (or whatever IP you used) and you will see the basic OctoPi interface. On the first connect, it will ask you to setup a username/password and to turn on security. I did this to keep my kids from canceling prints so I can make more star wars stuff. Then you will need to select the FTDI serial port and set the baud (250000). Click save settings and then connect.

    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 #14
    Last 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

  2. #2
    Technologist dacb's Avatar
    Join Date
    Aug 2014
    Location
    Edmonds, WA
    Posts
    139
    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!

  3. #3
    Staff Engineer printbus's Avatar
    Join Date
    May 2014
    Location
    Highlands Ranch, Colorado USA
    Posts
    1,437
    Add printbus on Thingiverse
    Thanks for compiling the useful info. It'll give me something to experiment with as the winter weather sets in...

  4. #4
    Technologist dacb's Avatar
    Join Date
    Aug 2014
    Location
    Edmonds, WA
    Posts
    139
    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.

  5. #5
    Engineer-in-Training gmay3's Avatar
    Join Date
    Mar 2014
    Location
    USA
    Posts
    388
    Add gmay3 on Thingiverse
    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:438960
    Last edited by gmay3; 09-19-2014 at 09:49 AM.

  6. #6
    Technician
    Join Date
    Aug 2014
    Location
    Richmond, Virginia
    Posts
    64
    Add Zulfe on Thingiverse
    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.

  7. #7
    Engineer
    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.
    Attached Images Attached Images

  8. #8
    Technologist dacb's Avatar
    Join Date
    Aug 2014
    Location
    Edmonds, WA
    Posts
    139
    Quote Originally Posted by gmay3 View Post
    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:438960
    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...

    Quote Originally Posted by AbuMaia View Post
    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.
    You know, I've never noticed those holes before! They could be useful for mounting all kinds of stuff!

  9. #9
    Engineer-in-Training gmay3's Avatar
    Join Date
    Mar 2014
    Location
    USA
    Posts
    388
    Add gmay3 on Thingiverse
    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

  10. #10
    Technologist dacb's Avatar
    Join Date
    Aug 2014
    Location
    Edmonds, WA
    Posts
    139
    Outstanding!

Page 1 of 24 12311 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •