OctoPrint-TFT on a Raspberry Pi

OctoPrint-TFT on a Raspberry Pi

So I have been seeing the new kid on the block pop up a lot recently, no not that shitty fucking band. This is a new “plugin” for the famous and awesome OctoPrint, OctoPi actually – OctoPrint-TFT. I have seen the screenshots and it is looking slick I must say. A while back I tried to use the OctoPrint TouchUI plugin and didn’t have much luck with it, in the end as the Pi I had at the time was a lower model and I just found the responsiveness just too slow. Plus this gives it a nice TFT feel like it was stock and meant to be. Le’s try it. I am gonna use the same waveshare 3.5″ LCD screen I had before but this time a newer Raspberry Pi 3B+. So I wont need a WiFi dongle this time either cause its built-in.

 

Parts used

  • Raspberry Pi 3 B+
  • Waveshare 3.5″ LCD TFT screen
  • A micro SD card of course
  • Power supply and cord for the Pi
  • USB cable to connect the Pi to the printer
  • A 3D printer lol
  • A computer with some sort of SSH program or a screen and keyboard/mouse to work directly off the Pi (might work I am not sure, I used a terminal on my mac and SSH’d into the Pi).

 

Let’s Party

Let’s follow the directions from the Github page and see what happens?

After installing a fresh copy of OctoPi v0.16 I started the Github directions.

 

The file is actually “/etc/octoprint-tft-environment” not the location.

sudo nano /etc/octoprint-tft-environment
(this tidbit copied form the github page)

The basic configuration is handled via environment variables, if you are using the .deb package you can configure it at /etc/octoprint-tft-environment.

  • OCTOPRINT_CONFIG_FILE – Location of the OctoPrint’s config.yaml file. If empty the file will be searched at the pi home folder or the current user. Only used for locally installed OctoPrint servers.
  • OCTOPRINT_HOST – OctoPrint HTTP address, example http://localhost:5000, if OctoPrint is locally installed will be read from the config file.
  • OCTOPRINT_APIKEY – OctoPrint-TFT expects an API key to be supplied. This API key can be either the globally configured one or a user specific one if “Access Control”. if OctoPrint is locally installed will be read from the config file.
  • OCTOPRINT_TFT_STYLE_PATH – Several themes are supported, and style configurations can be done through CSS. This variable defines the location of the application theme.
  • OCTOPRINT_TFT_RESOLUTION – Resolution of the application, should be configured to the resolution of your screen, for example 800x480. By default 480x320.

So go to the browser on your working machine that you use and go to the Pies IP address and go thru the OctoPrint setup fun. Once done grab an API key from the config menu on OctoPrint and lets edit that config file for the OctoPrint-TFT.

Do a find -name "config.yaml" on your Pi and you will find the location of yours. Add that to the config. Host should be http://localhost . The API you grabbed from the config menu slap that where it needs to go. I left the last two alone.

It has come a long way since the last time I tried to get this screen to work. This time its is really freaking easy!

This should install with the screen to boot with the bottom being the power plug, if you want it the other way do this instead

Reboot your Raspberry Pi and make sure you get video on your LCD.

If your screen is not rotated correctly with the above command still, do the following.

And change the line for your display to add :rotate=270 as shown below

The Pi rebooted after downloading some files and holy shit! The screen is working, well it showed the boot up sequence and a login prompt. Let’s get touch working and the desktop.

sudo reboot

Let’s see?

Boot up sequence and…login prompt. Ugh. sudo raspi-config to desktop? That loads and wants lightdm, so no. TFT wants xserver, so its gonna get xserver. Lets Google and I mead Reddit. Google didn’t have shit, too new still. Found it.

Let’s try this.

He has an extras step after installing OctoPrint-TFT.

Lastly we need to remove the 99-fbturbo.conf file from our Xorg directory he says.

Now on reboot OctoPrint-TFT should load and start attempting to connect says he?

Fucken eh right it did! If you see the Octoprint image but the error says

Unexpected error: Get /api/connection: unsupported protocol scheme

As mentioned earlier I found out on the Github issues page it was mentioned there to add “http://” to the config file instead of just localhost. So make sure you did that.

If you see the “Connecting to OctoPrint” and it never goes away, don’t wait too long! It simply means it has no connection to a 3D printer at that moment. You MUST plug it in for the TFT to do its job and actually work. Incredibly confusing I know. Hopefully they’ll fix that soon, and change the message soon.

After playing with it for a few minutes (no actual printing done) I find it pretty neat, and may possibly use it in the future if my LCD screen ever loses functionality for some reason. I could disable the control boxes screen lets say and enable more features in Marlin, after I did upgrade my firmware. But I am not too sure. Requiring the tethered connection to the Pi is a drawback for me, thats way more plugs sticking out of a screen than I would like. If I had the 7″ screen to hide the goop maybe, but this wasn’t designed for those. It was perfect size on the 480×320 I ave.

Or if I do some crazy new board installed over the Melzi and I don’t have a screen. I could use this. I wanted to try Klipper out and that loses the screen but I don’t think there is support for it just yet. I am not willing to try it out at this point in time.

But that was my trick to get OctoPrint-TFT to work on my Waveshare 3.5″ TFT screen and Raspberry Pi 3 B+. Hope it helps.

 

The perfect Raspberry Pi enclosure

The perfect Raspberry Pi enclosure

There are many and I mean many Raspberry Pi cases out there. Fucking tons. There are a few great ones and a lot of mediocre ones. I came across a pretty good one. It is a great case and not just because it looks cool. It’s actually function-able. The case is designed to fit a VESA monitor mount. So if you have a TV or monitor on a stand you could bolt this to the rear and bam!. The holes are also great for general purpose mounting. The case is designed slightly different than all the others out there. There is NO CUTOUT for the micro USB power plug. We don’t use it here. This case has room for a DC-DC buck converter. Available on Amazon, eBay and all over. Standard part.

We take a nice big fat power source like 12v DC 3A and knock it down to 5.1v DC for the Pi. Then we wire that output directly to the Pies GPIO pins for 5v and GND. This works great, a nice fat stable power source. And the bricks are far easier to get a hold of then a 3A 5v USB plug. I have tons of them lying around.

DC-DC Buck Converter

 

We take the barrel plug and solder in a diode to the source side of the DC-DC buck converter. We take the output and apply that to the power GPIO pins for 5v and GND. Then we take a LED and wire in a 330ohm resistor and connect that to GND and GPIO 14 (UART TXD). Heres the trick to get the GPIO pin to follow the Pies power up and power down cycle. So the LED will turn off when the Pi is safe to unplug.

Edit your /boot/config.txt file and add the following line:

enable_uart=1

Thats it, now the LED will light when powered on and it will shutoff when it is safe to unplug the Pi. If you wish to use a different pin other than 14 you can follow this guide over here.

The case

Heres the thingy for my modified version of the case. The original calls for brass inserts for the screws, which is awesome I just don’t use them. So I remixed the files to use standard M3 screws. No more brass inserts. I also increased the depth of the lid. My jumper wires were hitting the top of the  lid and preventing me from closing it. No I have plenty of room fire wires and jumpers.

My Remixed Case

https://www.thingiverse.com/thing:2956874

Original Version

https://www.thingiverse.com/thing:2286741

 

Creating a mini NES with a Raspberry Pi

Creating a mini NES with a Raspberry Pi
Mini NES RetroPie
Mini NES RetroPie

It all started with the Nintendo Classic craze. I had a friend that was rambling about one the other day. I mentioned that I could totally make him one but better because it would emulate more than just Nintendo. Enter RetroPie. I was looking at putting the bill of materials together and thinking of cases for the mini NES, then I realized why not just print one! So BAM and BAM.

 

https://www.thingiverse.com/thing:1887826 
then this https://www.thingiverse.com/thing:2011955 

Then this for giggles
https://www.thingiverse.com/thing:1710104

 

Here’s what we are doing

  1. Flashing RetroPie to an SD card for a Raspberry Pi
  2. Soldering header pins to the RUN pin holes on the RPi
  3. Soldering wires to some push buttons
  4. Soldering some wires to an LED
  5. 3D Printing a mini NES case for the RPi
  6. 3D Printing a bracket for the NES case
  7. Glueing push buttons, LED and bracket into the printed case
  8. Wiring the LED and buttons to the RPi
  9. Testing it all

 

Here’s what you need

  1. Raspberry Pi (save yourself a headache, get a RPi 3!)
  2. RPi power supply MINIMUM of 2.5A!
  3. SD card 8gb+ class 10
  4. HDMI cable
  5. USB keyboard
  6. Network cable (even though the RPi 3 has wifi you will at least need to do the initial wifi setup with a LAN connection)
  7. A 3D Printer to print the case and the bracket
  8. (2) push buttons
  9. (2) male header pins
  10. Super glue and hot glue
  11. (1) red LED
  12. (1) 100 ohm resistor
  13. (6) pieces of jumper wire with connections (you can cut some in half if long enough)

 

Whats Up

I will assume you have a network connection (non wifi) a USB keyboard a TV or Monitor or tv with an HDMI connection and that you have active internet. You will need to know how to solder, and be somewhat comfortable with a terminal and hopefully the Linux environment. I also assume you have and know how to use a 3D printer. I will also assume that you know and are comfortable with Raspberry Pies. Lots of ASSumptions.

This post is not designed as a how to install RetroPie but more of a how to get RetroPie installed and create the scripts for shutdown the Pi and lighting the LED, then you can follow the first install guide by RetroPie to get you going with the actual RetroPie software.

View Post

I am not responsible for any damage that may happen to you, your computer, or your Raspberry Pi etc. Take this adventure at your own risk.

My 3d Printer Toughts: Revisited

My 3d Printer Toughts: Revisited

Updated: October 5th, 2017

I have a 3D printer, a Monoprice Maker Select v2.1. I have had this thing for a few months now and feel like I have gotten a pretty good hang of it. I can get some pretty nice looking prints out of this thing. So here are my rambling thoughts on 3D printers so far:

Get something entry level your first time around. Don’t go spending thousands of dollars on it, you won’t know what you are doing. You wont know the basics. I nabbed a Monoprice (Wanhao/Cocoon Create clone) Maker Select v2.1. It’s a great entry level printer and for a great price. Once you’ve got it all setup and tweaked it will produce great prints. But it did print pretty decent right out of the box. If I had to choose again I would have gotten the Creality CR-10, but purely for its build size. I have found that I would very much like to produce larger objects. Bigger than the build plate of the Maker Select can handle. The MS is 8″ x 8″ x 7″. The CR-10 is 12″ x 12″ x 15″!! But I have no regrets on getting the Maker Select.

Being that it is an entry level printer and a cheap one from China, it needs some help in the safety “I won’t burn your house down” department. Remember those stupid “hover” boards and the fires? Yeah. So buy a $10 MOSFET to offload the heatbed amperage from the printer board to the more powerful MOSFET. The traces on the printer board cannot handle the amps the bed requires and will eventually burn out. Some people have tried just swapping the plugs for a higher rated plug but thats just bypassing the issue, not fixing it. Don’t do the XT plug mod, it won’t solve the problem.

  • Wire up the and install the MOSFET immediately, there are tons of tutorials and YouTube videos for it, its pretty simple. Order the MOSFET and printer at the same time.
  • Level that bed, then level that bed. Then level the bed. Then level the bed. Seriously. This is THE most important step out of everything minus the MOSFET. If you are not level you WILL have issues of some kind.

Level the bed again! This WILL be the hardest thing you have to do. There are many methods to do this, find one that works for you. For me I use a single piece of paper. With a cold bed and a cold nozzle I will slide the paper between the nozzle and bed and loosen the bed screws until its a snug fit but still moves. Then when I heat up and print (I use a 0.2mm first layer) everything is rockin.

  • Make sure you’ve squared your printer. It did NOT come that way. https://www.youtube.com/watch?v=XaroNfMVE4M
  • Make sure all the scews are tight
  • Print some Z-axis levelers, and make sure they are level to the bed.
  • I would order at least (2) 5150 radial fans to replace the 40mm stock fans. They suck and are loud, prone to failure. Or upgrade to noctua ($$) fans as people suggest.
  • A lot of people replace the electronics box fan with a 120mm for air flow and noise.
  • Print some Z braces. AzzA’s Z-brace is pretty nice, thats what I went with. But now there are rear Z-brace kits. I’d rock one of those if I had to do it again. Check out “Z-brace yourself” on Thingiverse.
  • Get a glass bed. This is next on my list of upgrades as well as… I want those glass smooth first layer surfaces.
  • Ditch the thumbwheels on the build plate and print some new ones, use M3 nylon nuts. The stock ones vibrate lose over time and don’t hold.
  • Print a razor blade part scraper (and this), the default putty knife can damage the buildtak surface.
  • Print the cable chain relocation bracket and cable shroud for the extruder head.
  • Upgrade and install the MicroSwiss all metal hotend. No more PTFE tubes and I hear it prints so much better. This is next on my list of things to-do.
  • Get a few rolls of filament in different colors. Stock up. Its nice to have that perfect color needed for something whenever it pops up. Or when you feel like a certain color. Its nice. I use Inland and Hatchbox.
  • Get some good superglue for glueing prints together. I use Gorilla Glue Super Glue 10 second bond. Good stuff.
  • Get a Raspberry Pi 3 and run OctoPrint (OctoPi) on it for ease of use. No fucking with an SD card, and you get to monitor and control the printer from a browser or cellphone/tablet (TouchUI).
  • Get a camera for the RPi to take timelapses or see progress. I use a raspberry pi camera and this mount.
  • Use an app. I use Printoid (for Android) to monitor and control the printer from my phone and tablet. It is much better and way more responsive than using the TouchUI.
  • Have a ton of things lined up that you want to print, and they better not be fucking fidget spinners! You are gonna have the urge to keep that machine printing 24/7.
  • Build an enclosure for it. It prints so much better when enclosed. No air drafts from doors or vents to fudge up your print. Having it enclosed also greatly reduces the amount of dust that will build up on the printer.
  • Have some shit on hand for maintenance. Oil and lubes, heh. Got to lube them rods! I use oil on the rods and lithium grease on the screw rods (z axis).
  • Print belt tensioners. Ditch the springs and tension the belts. They are probably too loose already, think guitar string. Some people just use zip ties like stock, I like the tensioners.
  • Lower your jerk and acceleration settings, as well as your speed. Jerk and acceleration settings you can play with. Most people seem to cut them in half of the default. Setting accel to 800 and jerk to 8 or lower. Speed, I did drop to 40mm/s. I print slow. I find anything over 50mm/s causes visible problems in your prints. My first layer speed I always run 8-15mm/s. Depending on how intricate the design is. This speed gets me screw hole circles perfectly. Over 15mm/s and the filament doesn’t stick for small circles and such, maybe better luck with glass?
  • Print a bed cable relief.
  • Print some brackets to hold the printer in one spot.
  • Print a filament runout sensor.
  • I print PLA with a heated bed. Nozzle at 200-215C and the bed at 60-70C. I print directly on the Buildtak (black mat surface) and have zero adhesion issues (most of the time). I don’t use glue or hairspray or anything of the sort. Too fucking messy, and I find it unneeded. YMMV. But I do have issues here and there with edges curling on large prints.
  • Get some lighting for your printer. You are going to want some LED lights in your enclosure, or at least on the printer pointing at your print. Because I guarantee you are going to sit there and watch it print. Plus you need the light for the camera (either just to watch or for time lapses).
  • Print test cubes and heat temperature towers for every new roll of filament that you get. Every roll is different. I guess you should also measure the filament with some calipers to make sure its 1.75mm (adjust in your slicer if not).
  • Get yourself some good fucking calipers!! You WILL need these. To check measurements on test cubes and such to make sure your printer is calibrated correctly. And to help you out when designing and making your own prints (the fun stuff!!).
  • Hot glue doesn’t stick well to printed parts, it does and doesn’t.

I’m sure there is more but thats what I have noticed so far.

I got a 3D printer!!

YES! I finally got one (about a month or two ago), been wanting one for a long time. I did a gig and got some extra funds (mainly, I was able to finally talk the wife into it). So yes, I got a 3D printer!! I did about three days of research and Googling. I had thought I found one and I was about to buy it, then of course, I found another one that caught my eye, it happened to be on sale, so I ended up doing research on that one too. It turned out to be a lot better. Metal body not acrylic. So I ended up with that one. It is a Monoprice Maker Select V2.1, a rebrand of the Wanhao Duplicator i3. A great machine, and very popular which was a factor in my decision. Great community support. Worked great right out of the box, only took about six screws or so to assemble. I did order the MOSFET board to offload the heat bed amperage. Since the board has cheap skinny Chinese traces it is prone to overheat and melt down. I would like to avoid that. The MOSFET does this.

First thing printed…a liver hahah due to my transplant. Then a replacement knob for our Kitchen Aid Mixer. I have tried to print useful things and not dumb trinkets. I don’t want to fill my desk and shelves with plastic knick-knacks. After I printed a few pieces I went straight into printing printer upgrades. The Z-braces were the first thing I printed and it is the best upgrade I have done so far. It shows immediate improvement on your printed items. Of course, now there is a rear Z-brace kit, which I would have done but I do not want to reprint everything and redo the printer. It is solid so as is, so I am leaving it as is.

So far the printer is awesome. I have many plans for it. I  can now print prototypes for my projects and custom boxes for my electronics, this is perfect! I have already started to dabble in creating my own custom “things”.