Using OctoPi with USB Camera

OctoPrint is an amazing little app with a simple web interface that controls your 3D printer. It has the ability to manage your gcode files or even take STL files and “slice” them into gcode files (which I’d never use since I like to visualize the layering in a tool first). OctoPi is a Raspberry Pi distribution of the tool that runs on the Pi. I had an older Raspberry Pi B that was perfect to throw at my need to remote control/monitor my longer 3D prints.

FullSizeRender 17

View of interface on iPhone

Disclaimer: I know the Raspberry Pi camera using the camera interface is “the way to go”. But an older camera you have (or $5 Playstation Eye camera) is worth a try right? No way, CPU will be too high, you won’t have enough USB ports, system will run too hot, will cause printing to pause … or will it?

The way OctoPrint integrates with a camera is by pulling into its page a video stream from mjpg_streamer (a web server running on a different port). This tool takes content from your web camera and creates a web video stream.  This software is distributed with the OctoPi build, no extra install required. Building the stream is a much more efficient if your camera is newer and has support for MJPG – otherwise you’re using YUYV encoding and the Pi has to do a lot of extra work. Nevertheless you can make this work. I use the following options to run the streamer:

./mjpg_streamer -i "input_uvc.so -f 1 -q 50 -y -r 640x480" -o "output_http.so -w ./www"

The important parameters above is the “-f 1” which says do one frame per second (I’m not looking for high quality video – I just want to see if print has lifted and get a feel of progress). The “-q 50″ controls quality of the result compression.

You can update settings in /boot/octopi.txt so these are used by default. This can be done by ssh to your machine or shut the machine down and edit the file on your computer after putting in the SD card.

camera_usb_options=”-f 1 -q 75 -y”

The advantage of changing the settings in the boot config file is every time you unplug the camera the process dies, and when it starts it will use this setting (there is a background process called “webcam” that handles this).

I tried changing the resolution and surprisingly  didn’t find a change in CPU usage so opted to keep it. As far as CPU, the system is running high at 85% and most of that usage is from the mjpg_streamer process.

Command to check temperature:
vcgencmd measure_temp

So yes, it runs the CPU pretty high (80%+) and the temperatures run a few degrees higher (but at 54’C well below limits), and the initial OctoPrint interface loads a bit slower. If you don’t want to spend money on a $30 Pi camera or a more expensive USB camera I think you can make it work.

Useful Documentation Page on Settings per Camera

Monoprice Select Mini 3D Printer Experience

IMG_0578I’ll admit, when I bought the Monoprice Mini Select 3D printer, I knew almost nothing about 3D printing. That won’t get you very far after you unbox the printer. There are some basics you need to learn to get good prints.

Once you have a 3D model in a print file format like STL you still need to put it in a program to tweak for your printer settings that has a slicer that creates a file usable by your printer. Beyond that, many prints require extra work to determine the thickness of walls that will look nice, supports for prints that have large overhangs, and more. It’s not rocket science; you just need to learn how the process works.

Thankfully, this printer has a lot of online help from owners on G+, Facebook, and especially YouTube.

Here’s a print session for a Pi Zero W case I found on thingiverse.com.

Tuning PID for Better Temp Control

Apparently, the out of the box temperatures for printing for this printer can fluctuate a lot. Most control systems use a PID controller to constantly measure the target values and use specific values for this (specified by the letters PID in the acronym). The good news is that you can tweak this printer’s values to get better results. I did this before my first print. Resources below:

While you can probably put these commands in a.gcode file and print them, I used this software to set the values. http://www.pronterface.com/

Printing Hints I’ve Discovered

  • Skip using the SD card and printing from the printer menu. Sometimes prints hang if you don’t upgrade the firmware (wanted to stay out of the box initially). Print from a computer with Pronterface (above) or even better, use Octopi (what I do now). Don’t use Cura on Mac to print; it just pauses every 10 seconds.
  • Use a good “slicer” application to create your print files. I do like Cura, and it’s available on Mac and Windows. If longer items can fit sideways, they’ll print faster. Have an item too large for the bed? You might be able to rotate it slightly to fit diagonally.
  • Print the first layer SLOW-half speed-on anything long or with quick angle changes.
  • Watch the printer. It can go bad. Octopi supports a camera!
  • Prints don’t stick without some help. Use a “raft” with your print if it doesn’t cover much surface area, and generally always use a light layer of glue stick on the tape on the bed.

The Octopi interface is great and works from any device anywhere. Why be tethered when you can watch remotely?

My Impressions

While I got some great prints with a little tweaking, I’m a bit concerned that this printer could be a black hole of my time doing mods. Apparently, Monoprice has a new model coming out in a few weeks that has many of these community mods built in, and most importantly, a replaceable hotend. I can already tell I’ll need to reroute the cables under the print bed (not attached correctly), install a stabilizer, and a couple other items. I may take advantage of Monoprice’s 30 day satisfaction guarantee and wait for the upgraded version to save me some time (and money in the long run).

Good luck!

My Nashville Visit

My wife and I had a few days to getaway and decided to checkout Nashville. I put together a few notes of what was great for us in case you are considering a visit Nashville is fun even if you aren’t a hard core country music fan (we aren’t), however if you detest country music that may lessen some of the fun I’ll recommend.
photo 1Where to Stay…
If you don’t mind dumping $200 a night the Opryland Hotel is very nice, has beautiful indoor gardens (but overpriced food).  If you plan (and you should) on visiting the Opryland theater it’s practically in walking distance (they have buses or you can drive). The hotel even with conferences going on and the CMA music festival starting didn’t feel overwhelming – probably due to the size. It is the largest non-casino hotel in the Continental United States outside of Las Vegas.  Rooms were immaculate and nice, service great. It was nice to get away from the city and have a place to hang out – if you prefer to spend most your hangout time in a honkeytonk bar stay downtown Nashville for sure. If we went back we’d probably stay downtown or at a B&B near the city (but we liked Opryland).

Coffee…
If you like coffee you must visit Barista’s Parlor. It’s in an area outside downtown in an old commercial garage. Don’t let the location or lack of signage from the road deter you – it’s one of the few coffee shops I’ve ever visited where all the employees were passionate about coffee and I’ve never witnessed such meticulous preparation (even in my own kitchen). The espressos are sweet and flowery and the coffees are not dark and full bodied but I think anyone would enjoy them. The strawberry waffles were quite good (both times!). I tried to visit Crema but they were closed … looks like a must-try. photo 4

What to See…
I’d start my trip to Nashville with a tour, and I’d HIGHLY recommend the …. Walkin’ Nashville Tour I’d facebook message Bill after you sign up and ask him for any great local shows going on – he knows the best (and sometimes free) unique shows. There is a segway tour also but a lot more pricey and probably not as colorful as Bill’s tour. If you have time get a tour of the famous Rayman auditorium – it’s a corner piece of the town and country music (Bill takes you there but not IN on his tour). The replica of the Parthenon in Millennium Park is worth checking out. It’s $6 to go inside but well worth it IMHO. A wide angle lens would be nice for the inside. We saw the famous “Grand Ole Opry” show and it was quite a fun experience. Go ahead and bring your flash camera and check StubHub for tickets if sold out.

Food….
I’d try Puckett’s and go about 7ish so you can catch live music that starts at 7:30. We hoped to try Loveless Cafe (outside city) but was too far and heard of long waits – maybe next time. We had a lunch at Jack’s BBQ which was a local “dive” which was just “ok”. It can be hard to get into places that are popular so I’d recommend not flying it by the seat of the pants (which we did). Try for reservations and ask when live music starts.
photo 3
It seems a lot of things have activity Tuesday, Fri, Sat night. Many places in Nashville seemed closed Monday. I probably wouldn’t do a Wed/Thursday visit personally. We did a Mon-Wed visit and it was good we had Tuesday!

Why I had Chick-Fil-A for Lunch

My LunchMostly I was hungry, and they have yummy chicken. I might have another reason though…

Let’s review some fast food politics.

  • Chick-fil-A gives money to non-profits that patronize their business which also support the Defense of Marriage Act. This act signed into law by Bill Clinton all but disallows same-sex marriage by making it not recognized by the federal government and allowing states to not honor other states same-sex marriage. A company leader recently stated that not having same-sex marriage was his personal religious belief.
  • Starbucks supports organizations that support changing marriage to include same-sex marriages. In addition the company officially supports this political agenda (not just an opinion of a business leader). Starbucks would be on the opposite political spectrum of Chick-Fil-A.

So we have two fast food companies on different sides of a single political issue. One is defending current law and the status-quo, one wants to change it.

When Starbucks made their public move to actively support changing policies on gay-marriage people announced they’d boycott Starbucks. Fair enough – people do that all the time. It’s a valid way to try and get companies with products you like to “see things your way”. Sometimes it actually works.

When a Chick-Fil-A leader made a public statement about his personal opinions on running his private business some people decided to boycott them, fair enough. Other than the company not having an official stance on the issue there are a lot of similarities to Starbucks – but there is a new twist to the Chick-Fil-A story.

Multiple government officials have stated they would discourage or disallow a private company to operate due to its political views. San Francisco stated, “The closest Chick-Fil-A to San Francisco is 40 miles away & I strongly recommend that they not try to come any closer”. The Boston mayor stated Chick-Fil-A wouldn’t get business licenses until they change their politics. Chicago Alderman Joe Moreno stated: “I will now be denying Chick-fil-A’s permit to open a restaurant in the 1st Ward.” Apparently these towns have plenty of jobs already and political issues are a litmus test for doing business.

My personal opinion is that no matter how ugly an elected official finds a company’s political views they shouldn’t penalize companies because of them. All businesses following the law should have equal rights to practice commerce. What’s ironic about this case is that the three Democrat mayors making comments about Chick-Fil-A not doing business in their town likely voted for Clinton (who signed the Defense of Marriage act) and Obama (who supported it as a candidate, but no longer does). One of the mayors, Rahm Emmanuel (Chicago), even served with a president that supported the policy. Apparently for some people who you get your fast-food lunch from is more important than who runs your nation.

Are you surprised how this energized the “right” to eat more chicken? If so, I’d suggest we get a few bone-headed conservative mayors to not allow Starbucks in their towns. The reaction would be amazing and I’d bet would even attract presidential comment. Whether you are right, left, or middle I hope you agree letting elected officials prevent or discourage companies from doing commerce solely based on their political party or political views is a bad idea. I think Supreme Court cases involving what’s known as the doctrine of “unconstitutional conditions” would likely disallow such ideological actions.

So, In support of not letting Fascist-like mayors dictate what politics companies and their leaders must have in order to do business maybe I’ll top off my Chick-Fil-A salad later with a Starbucks latte!