Sunday, March 26, 2017

3D Printing - OctoPi Setup with 7in PiTFT Touchscreen LCD

OctoPrint is a great companion for any 3D printer.  I used it with my Monoprice Mini, and now with the Original Prusa i3 MK2. The web based interface works great, but I wanted a way to monitor the prints both when I am away from the house, and a way to just check on the status on the print in passing. I will show both the physical assembly process and how I set up all the settings within the Pi and OctoPrint to work for me.  Also working on a video walkthrough that I will post at the end of this post when completed. 

I had seen a few examples on of the OctoPrint interface running on a 3.5in TFT display.  I already had one of those screens, so I gave it a try.  


























I got it working, but found the touch display too small to really be of much use, so decided to jump to a larger version.  Went with the official Raspberry Pi 7in TFT display.  Here is an Amazon link


There are plenty of enclosures available for this screen that also allow you to mount the Pi on the back, but I found some 3D printed plans that looked a bit nicer, and the fact that I could make my own with customized colors was a plus!  Here is the link to the one I made, and some pictures of the assembly process. 








Now that everything is put together, here is the step by step guide that I made to get everything up and running. I pieced this together from various sets "how-to" documentation, as they all seemed to not have all the info I needed, or missing some step that was causing the setup to not work for me. 


OctoPi Setup with 7in PiTFT Touchscreen LCD

Part 1: Install & Setup OctoPi
  • Download Image and burn to MicroSD Card using Win32 Disk Imager or Etcher
  • Once image is burnt to card access the following files in the boot directory to modify configuration of the OctoPi
    • octopi-network.txt
      • Remove the "#" from the follwoing 3 lines, and add your network info
      • ## WPA/WPA2 secured
        iface wlan0-octopi inet manual
            wpa-ssid "put SSID here"
            wpa-psk "put password here
    • octopi.txt
      • Modify these settings for your specific webcam. These settings for for the Logitech C615
      • Remove the "#" from the following line and change settings to match your camera
      • camera_usb_options="-r 1280x720 -f 25"
    • config.txt
      • An update has been pushed to Raspbian to flip the screen ( rotate it by 180 degrees ) for a better desktop viewing angle. This makes it upside-down in our stand and the official Pi stand, so you'll need to change a setting to flip it back. To do this, open /boot/config.txt in your favourite editor and add the line:
      • lcd_rotate=2
      • This will rotate both the LCD and the touch coordinates back to the right rotation for our display stand
  • Assemble the Raspberry Pi
    • Insert MicroSD card into Pi, Connect TFT Display, Keyboard, and HDMI Display, then boot up device
    • Once device boots up and launches the Console, enter default user credentials
      • Username: pi
      • Password: raspberry
    • obtain IP address
      • ifconfig

  • Enter the IP address found with ifconfig into your web browser to launch the OctoPrint web Interface
  • Complete Setup Wizard on Web Interface and establish log-in credentials
    • Username: XXXXXXXXX
    • Password: XXXXXXXXX
  • Import CURA slicing profile if desired, for the Prusa i3 MK2 I am using, head here:
  • Install Plugins
    • Settings > Plugin Manager
      • Automatic Shutdown
      • STL Viewer
      • TouchUI
  • Add the Prusa i3 as the Default printer with the following parameters 


    • Settings > Serial Connection
      • Serial Port > Auto (
      • Baudrate > 115200
    • Save Settings
  • Verify WebCam feed is working
    • Go to "Control" tab to verify you see the streaming image from your webcam
    • Go to Settings > Webcam & Timelapse > Stream URL
      • Use the "Test" button to verify everything is working properly
      • Also test the "Snapshot URL" 
      • Save Settings
  • Update the instance of OctoPi if update is available
    • Reboot the system once update is complete


Part 2: Configure PiTFT Touchscreen LCD
  • You may need to provide yourself root access first
    • sudo passwd
    • change root password to something you will remember
    • To gain SuperUser access
    • su
  • From the Command line, update the database of available software
    • sudo apt-get update
      sudo apt-get upgrade
  • Once update is complete, shutdown system
    • sudo shutdown -h now
    • Power on sytem and verify the the Touchscreen is working and the display is the correct orientation
  • If desired, access the Raspberry Pi Configuration screen and change the default password to something more secure
    • sudo raspi-config

Part 3: Setup: Boot to Browser (for OctoPi or Jessie Light)
  • **NOTE** This section will be easier to complete if you access your PI via SSH using Putty
  • From the piTFT screen, enter in user credentials and elevate to SU if needed
    • sudo apt-get update
      sudo apt-get install --no-install-recommends xinit xinput xserver-xorg xserver-xorg-video-fbdev x11-xserver-utils matchbox unclutter chromium-browser
      sudo nano /usr/share/X11/xorg.conf.d/99-fbdev.conf
  • Enter this information into the file if using an offical Pi Touchscreen
    • Section "Device"
       Identifier "touchscreen"
       Driver "fbdev"
       Option "fbdev" "/dev/fb0"
      EndSection
    • If using an HDMI display, chang to "fb1"
  • Save and exit (CTR-O, Enter, and CTR-X)
  • Allow X11 to run as anybody
    • sudo sed -i 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config
      git clone https://github.com/BillyBlaze/OctoPrint-TouchUI-autostart.git ~/TouchUI-autostart/
  • Copy Service File and Register
    • sudo cp ~/TouchUI-autostart/touchui.init /etc/init.d/touchui
      sudo chmod +x /etc/init.d/touchui
      sudo cp ~/TouchUI-autostart/touchui.default /etc/default/touchui
      sudo update-rc.d touchui defaults
  • Test Kernel
    • chromium-browser
  • If browser doesn't launch we need to upgrade the Kernel and the Chromium Install
    • Only Do this if Launching Browser didn't work
    • Update Chromium
      • sudo apt-get update
        wget -qO - http://bintray.com/user/downloadSubjectPublicKey?username=bintray | sudo apt-key add -
        echo "deb http://dl.bintray.com/kusti8/chromium-rpi jessie main" | sudo tee -a /etc/apt/sources.list
        sudo apt-get update

        sudo apt-get install chromium-browser
    • Update Kernel
      • sudo apt-get upgrade
        sudo apt-get install rpi-update
        sudo rpi-update
        sudo reboot
  • You may have to run the steps before updating Chromium and Kernel again for TouchUI to AutoBoot
  • System should now  boot automatically to the TouchUI web interface of OctoPrint


Part 4: Setup Remote Print Access
  • Reserve (These steps are for my ASUS Router, but should be similar for most brands)
    • From Router UI go to LAN > DHCP Server
      • Reserve the desired Local IP address for the Raspberry Pi
        • 192.168.1.123
    • Head to WAN > Virtual Server / Port Forwarding
      • Enable port forwarding for both OctoPrint and SSH
        • Octoprint Port: 80
        • SSH Port: 22
        • Both will use the OctoPi's IP Address


  • No-IP
    • Set up your Dynamic DDNS
      • ZaneXXXXXXXX.ddns.net
      • 97.117.XXX.XXX
    • Open the Console or SSH and type the following
      • mkdir /home/pi/noip
        cd /home/pi/noip
    • AfterAfter creating the folders for the DUC it is time to download the software.
    • Within the Terminal window type the following. After each entry you will press “Enter”.
      • wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
        tar vzxf noip-duc-linux.tar.gz
    • Next navigate to the directory you created to locate the downloaded files.
      • cd noip-2.1.9-1
    • Now install the program
      • sudo make
        sudo make install
    • After typing “sudo make install” you will be prompted to login with your No-IP account username and password.
      • UserName
      • Password
    • After logging into the DUC answer the questions to proceed. When asked how often you want the update to happen you must choose 5 or more. The interval is listed in minutes, if you choose 5 the update interval will be 5 minutes. If you choose 30 the interval will be 30 minutes.
      • sudo /usr/local/bin/noip2
    • To confirm that the service is working properly you can run the following command.
      • sudo noip2 -S
        • Must be a Capital "S"


    • To ensure that it will run on Start Up
      • sudo noip2 -S
      • Add the following below the "fi" line and above "exit 0"
        • /usr/local/bin/noip2

      • Save and exit the file
      • Now check to see if the process is already running or not
        • sudo /usr/local/bin/noip2 -S
      • Upon reboot, it should run the service
  • Setup /  Upkeep
    • Make sure passwords on all devices and routers are secure
    • If you don't want to update the NoIP every month, pay $25 for an annual setup



Here is a video I put together showing the TouchUI in action along with a companion app for Android called "Printoid" that has a nicer UI, but still works off of OctoPrint. 


Friday, March 3, 2017

TekPower TP3016M Switching DC Power Supply Mod & Review

I have been using various DC power supplies for projects on my workbench for some time now, but recently decided I need the flexibility of a true variable supply, vs a wall adapter that has 4-5 voltage choices.  In my search, I found that most workbench power supplies were very large and bulky, which wasn't ideal.  Then I came across this geam, the TekPower TP3016M Switching DC Power Supply.  It is a fairly new product, and can be found on Amazon.

This unit fits my needs perfectly having an output range of 0.3V-12V @ 0-3.75A, and it can even jump up to 30V@ 1.6A.  The other perk was the size, which is about the same as a multi-meter.  The unit is portable, and small enough for me to mount on the wall above the workbench.



I have already used it for a few projects, and it performed flawlessly.  Backlit display is a nice touch, as are the dedicated USB ports for output at 5.1V @ 2.5A.  The only downside to this unit, is that is has no dedicated power button.  To turn it off, you have to remove the power cord.  Not ideal, especially for my plan to wall mount it.  So I set off to MOD the device, to remove this "negative" from the feature list. So I opened the unit up and took a peek inside to see what I could do.



Turns out the is ample room in the upper right of the device for a dedicated power switch.  I found a fairly small rocker switch (pictured below) that could take up to 6A, and began preparations to add it to the power supply. First thing I did was remove the solder from the post on the right of the 2 pin power input/plug.  Once the solder was removed (from only the right post), I bent the post up and away from the circuit board.



With the prep work done, I drilled a starter hole where I decided the switch would go, and then used a small file to shape the opening to fit the switch.



Lowered the switch into place, and then connected it to the power input pin I had previously bent upwards.  The other jumper was then soldered back to the board to complete the connection. It is a pretty tight area to work in, and I also chose to use some heat-shrink tube just in case the contacts got too close.



I plugged the cable back in, and gave it a quick test... WORKS!  Then proceeded to put the unit back together, which was as simple as snapping it back together and screwing in 3 screws.  The unit was then attached to my tool wall, where it is easily accessible to power future projects.



Overall a pretty simple MOD, but made this unit a lot easier to work with.  Here is a video I put together which is more of an overview of the power supply's operation.  Thanks for visiting.









































Friday, February 10, 2017

Raspberry Pi (RetroPie) Old Skool Case LED Mod

As is apparent with my TableTop Arcade build, I really like turning Raspberry Pi micro computers into Retro Gaming systems.  I also have some smaller systems that just plug directly into a TV.  Recently found a case that is a perfect fit for these types of systems.

Old Skool NES case for Raspberry Pi 3



Its a really nice looking case, and fits with the Retro Gaming theme perfectly.  Very simple install, and everything lines up as it should. The only gripe I had,  was there is a small hole next to the fake power buttons, that would typically be a power indicator.  The case has the hole, but no LED. So... time to MOD!


I have a bunch of small Red LEDs, so set to work figuring out how to connect it to the Pi, so it will light up when the system is powered on.  Here is the pin layout of a Pi 3. I decided to tie into the 5v & GND locations to power the LED. 


I first tested on a breadboard to verify which resistor I would need.  The  LED I am using requires input of 1.5-2v so I went with a 100 Ω + 5% resistor to step it down from 5v.  If you want the LED to be less bright, just use a larger resistor. I then used a hot glue gun to secure the LED to the case. 



With that done, powered it up, and it looks Great! Really pleased with how well it turned out.



Here is a quick video showing the boot up process, and the initial "Boot Video" I have setup on my system.





Saturday, January 14, 2017

PC Upgrade - Mounted System Stats Display

I have been running my current Custom PC setup for about 6 months, and for the most part, have been very pleased with everything.  The only issue I have faced, is the small display I mounted to show system stats has very poor viewing angles, making it hard to see from where I sit/stand.



I also have received more questions about that particular part of my system than any other post both on this blog and my YouTube channel. So I decided to upgrade that particular component, and archive the entire process.  In addition to the info on this post, I will also make an overview video and posts it at the bottom.

The previous display was a 9in LCD panel. The new one, is a Toguard 10.1 Inch IPS display.  Here is the Amazon Link.  It is almost twice the cost of the 9in one, but the panel quality is a LOT better, so worth it in my opinion.



Here is a picture from the back.  The 9in was a bit easier to mount as it had a camera/tripod mounting hole, that I secured it to the GPU bracket with.  This new display has no such mount, but does have 4 mounting holes on the back of the display.




From the bottom you can see the various connectors.  All I am concerned with are the 12V DC power port, and the HDMI input.




The front plastic made to look like brushed aluminum. I probably would have left it as is, if it weren't for the TOGUARD logo. So I covered just the front bezel with my Carbon Fiber Vinyl wrap.




I gave it a quick test before making the mounting bracket just to verify everything would work the way I needed it to.  Here we are showing connections from the PC to the Display.  Note the 12V DC  plug is coming directly from a 4pin Molex connection that I wired specifically to power this display.



The initial tests passed with flying colors.  Not yet mounted, but running CAM perfectly.  On to the mounting bracket construction.



To make the bracket, I grabbed some sheet metal that I had left over from another project.  I measured both the exterior dimensions and the location of the mounting screw holes.




Once I had everything marked, cut out the piece, drilled the holes, and used my bench vise to make a nice 90 degree bend to accommodate mounting the display under the GPU bracket.



To secure the display to the mounting bracket, I am using M4-7 socket cap screws, and a few washers.  The length was a bit too long, as the mounting holes were not very deep, so I used some nuts to shorten the length of the screws.



After everything was drilled, cut, and bent, added a few passes of black spray paint to match the color theme of the PC build.  Also shown here is the 6mm screw I used to secure the mounting plate to the GPU bracket.



Here is the hole I drilled in the GPU bracket.



And here is where the 6mm screw will go.




With the mounting plate secured the the GPU bracket, we can now attache the display.



Here is a shot from the back to show how the screws are securing the display to the case.



And a final shot from the front to show the new upgraded display installed and running CAM.



I will show in the video more detail on how to get the NZXT CAM Monitoring software up and running, but just for reference, here is what my displays look like, with this new on set up as the 4th monitor of my system. Desktop Screen Capture of all 4 monitor.



Here is the video.  If you have any questions be sure to hit me up in the comments. Thanks!