1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Web enabled Robo3d using Raspberry Pi and Octoprint

Discussion in 'Mods and Upgrades' started by sjreggel, Feb 19, 2014.

  1. drandolph

    drandolph Member

    Joined:
    Aug 15, 2014
    Messages:
    35
    Likes Received:
    24
    OK I've been a little busy with octoprint and I wanted to make a simple quick start guide with some add-ons for everyone. I built out my octoprint so it was inside my printer and it controlled powering on and off the printer while still allowing me to control the power if I wanted to control it from my computer instead. So I did a few things. My notes assumes you have already watched Toms guide.

    1. I put a simple 5v power supply inline with the power plug before the switch so that the raspberry pi was always on no matter what the printer was doing.
    2. I put the relay in parallel with the power switch on the printer. That way I could turn the printer on with either the switch on the back or the relay. The only downside is that both have to be off for it to turn off but one one or both have to be on for it to turn on.
    3. I am using the raspberry pi to control the power for the printer.
    4. I am using the raspberry pi camera and a TP-LINK wifi adapter.

    So lets get into the software side of things. All of my notes are for a windows machine.
    1. Lets just format the SD card to be safe using this utility. https://www.sdcard.org/downloads/formatter_4/
    2. Download the disk image for octopi. I'm using the version 10 image and it's just fine. http://docstech.net/OctoPiMirror/
    3. Use windisk imager to image your SD card with the octopi software. http://sourceforge.net/projects/win32diskimager/
    4. Put it in your Raspberry and turn it on and it will bring up the config screen. Run the expand filesystem, enable the camera, set the boot to terminal. Set a password. You could overclock from here but do it at your own peril. If you ever want to get back to this screen type sudo raspi-config
    5. Now lets reboot by typing sudo reboot
    6. When it comes back up login and type ifconfig this will show all of your network interfaces and if you plugged in a wifi dongle it should show up as wlan0. If not you could use the driver install instructions I did for a TP-LINK TL-WN725N wifi dongle. http://www.raspberrypi.org/forums/viewtopic.php?p=462982#p462982
    7. Joining a wifi network. Assuming that your pi sees your dongle you could go and modify your /etc/network/interfaces from terminal but the lazy way would be to run startx from terminal to launch the desktop and just click on wifi setup.
    8. Getting the Pi to turn on and off a relay is pretty simple using wiringpi. I'm using pin 7 for mine since its closest to the 5v power and gnd on the pi B+ From terminal run these commands to install it assuming you have it connected via ethernet during this setup. If you dont then you'll have to download it elsewhere and copy it over to your pi.
    git clone git://git.drogon.net/wiringPi
    cd wiringPi
    ./build

    9. Testing wiringpi
    gpio -v will tell you what version is installed and if its running
    gpio readall will show you all of the pins on your pi and what state they are it
    gpio mode 7 in turns pin 7 off
    gpio mode 7 out turns pin 7 on
    10. Lets ad a button to the octoprint system menu so you can turn the printer on and off from the systems menu.
    cd ~/.octoprint
    nano config.yaml


    Add the following lines under system section of config.yaml
    - action: poweron
    command: gpio mode 7 in
    name: Power On Printer
    - action: poweroff
    command: gpio mode 7 out
    confirm: You are about to the the printer off
    name: Power Off Printer

    Notice how we have a confirm line so you have a chance to cancel turning off the printer in case your finger slips. This is a good thing. I like having it under the system menu because I have access control turned on and you can't do any of the systems commands without logging in.

    Hope this helps some of you.

    IMG_8701.JPG IMG_8702.JPG IMG_8704.JPG
     
  2. Jimmy Husain

    Jimmy Husain Member

    Joined:
    Oct 16, 2015
    Messages:
    109
    Likes Received:
    16
    #42 Jimmy Husain, Jan 23, 2016
    Last edited: Jan 23, 2016
  3. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    I can't assist with that device, but why not get a WiPi? They are cheap and no setup (other than configuring the linux network which they explicitly show you how to do). The drivers are already there. It is what I use on every Pi*.

    http://www.newark.com/element14/wipi/wlan-module-for-the-raspberry/dp/07W8938

    If that is not workable for you someone may have used it and they can chime in, but you should also post this on the OctoPi forums/groups/lists as well.


    *I also use them on RIoTboards since the Android images also natively work with no extra drivers for the WiPi
     
  4. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    The raspberrypi.org site has a big community that could walk you through the steps. But in a nutshell, you need access to the RaspberryPi command line, either directly or through an SSH session. then you need to execute the four commands listed
    Code:
    wget https://dl.dropboxusercontent.com/u/80256631/8188eu-v7-20150212.tar.gz
    tar xzf 8188eu-v7-20150212.tar.gz
    ./install.sh
    reboot
     
    mark tomlinson likes this.
  5. woferry

    woferry Member

    Joined:
    Jan 14, 2016
    Messages:
    42
    Likes Received:
    11
    I picked up a Pi 2 B, the Edimax WiFi module and a cheap HD webcam for my new Robo. Was pretty easy to set up, had to consult the web on how to get the Pi to join a closed WiFi network (the octopi setup wasn't the slightest bit prepared for that, but it only took editing two files to fix) and had a bit of trouble with the no-name camera I bought (turned out it didn't like the default 640x480@10fps setting, but works fine at 1920x1080@15fps). So I have the whole setup running, separately from the printer now. I want to print a bracket to attach the camera to the bed and will probably move the rest inside the R1plus base eventually. But I love OctoPrint and it's so nice to be able to print/control/observe the printer from my couch. :)
     
    Jimmy Husain and mark tomlinson like this.
  6. thebeardedone

    thebeardedone New Member

    Joined:
    Jan 27, 2016
    Messages:
    2
    Likes Received:
    0
    Noob question time. I just received a R1 plus and had a raspberry pi that I wanted to connect to my printer. I removed the bottom cover and didn't find a micro usb connection on the arduino. So how would i connect a raspberry pi without the micro usb connection?
     
  7. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    My raspberry Pi2 is connected via a normal USB printer cable, You will need to use the port that would normally connect your Robo direct to your computer. The Pi replaces your connection to a PC/MAC.
     
  8. Jimmy Husain

    Jimmy Husain Member

    Joined:
    Oct 16, 2015
    Messages:
    109
    Likes Received:
    16
    Finally this whole mod is up & running today. Days of inserting & removing the sd card are things in the past.
     
  9. Jimmy Husain

    Jimmy Husain Member

    Joined:
    Oct 16, 2015
    Messages:
    109
    Likes Received:
    16
    Speaking of which, do I need to make a Printer Profile for my Robo? Or is it not needed?
     
  10. KTMDirtFace

    KTMDirtFace Well-Known Member

    Joined:
    May 18, 2015
    Messages:
    1,247
    Likes Received:
    461
    I haven't yet, I still use auto detect, and i drag my STL files over.

    I imagine if you wanted actual real control you should setup a profile. I haven't done that yet.
     
    Jimmy Husain likes this.
  11. Sean Carson

    Sean Carson Member

    Joined:
    Feb 4, 2016
    Messages:
    155
    Likes Received:
    22
    What advantage does using a printer profile give us?
     
  12. KTMDirtFace

    KTMDirtFace Well-Known Member

    Joined:
    May 18, 2015
    Messages:
    1,247
    Likes Received:
    461
    Since I have not tried it I don't know for sure. But I think you can actually slice on octoprint, so you could drag your 3d STL file over, have it slice and it would have your printer settings and bet size in it. I just slice it first in simplify3d and drag the gcode over.

    I'm not sure I want to even try that but I might make profiles because I have more than one printer...though in that case I will probably just run more than one PI.. so I don't know.
     
  13. Sean Carson

    Sean Carson Member

    Joined:
    Feb 4, 2016
    Messages:
    155
    Likes Received:
    22
    I'm really curious how well that would work. I have my Pi2 and edison sitting here, waiting for a project like this..
     
  14. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,276
    Anyone able to access their Octopi remotely? I have a DUC setup but it doesn't seem to recognize anything on port 5000 even though I unblocked it
     
  15. James Harry

    James Harry Active Member

    Joined:
    Feb 7, 2015
    Messages:
    127
    Likes Received:
    37
    I have my Octopi responding on port 80 because my work's guest wifi doesn't allow 'abnormal' ports, so I had to stick with 80 if I wanted to keep an eye on it at work.
     
  16. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    If you are running the unmodified OctoPi build I think port 80 is the default from outside your network. HAProxy is installed by and running in this build.
     
  17. KTMDirtFace

    KTMDirtFace Well-Known Member

    Joined:
    May 18, 2015
    Messages:
    1,247
    Likes Received:
    461
    Thats one thing I need to do is give my PI a static IP. so i can do that.

    I'll have to google how to give a PI/Linux static IP since I forgot.

    Wouldn't it be whatever port you assign to it in your router?

    I have a home theater pc, that records all my TV..i gave it a static IP and opened some ports on my router for it..which I can't rememember now what that was .
     
  18. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
  19. James Harry

    James Harry Active Member

    Joined:
    Feb 7, 2015
    Messages:
    127
    Likes Received:
    37
    mark tomlinson likes this.
  20. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,276
    I believe comcast blocks Port 80 and refuses to let you forward through it.

    I also unblocked 5000 and pointed it to my octopi. I'll try unblocking port 80 to the pi, but I'm not hopeful.

    IN other topics, has anyone setup the Email Notifier plugin? I'm stuck trying to add the keyring
     

Share This Page