Ah Crap

my Monday

WTFMYMONDAY

My site hosting provider account was expiring, I knew this. I had some plans, then my home server died on me. Well shit, there goes the backup plan. Cut to the point, I had to go to the hospital again for another few days last week. Just in time to get out with one day left on my hosting.  Throw in some other bullshit and you get a 90% backup of the site. It’s up, it’s running (thanks to some friends) but in the whole shenanigans of the all I forgot to backup all the god damn media (I swear I always do this). I may have some images still on my hard drive and I may update it over time but as for now, all of the images are gone. Sorry about that. I am probably more pissed off about it than you are.

If you do get to a post that has a broken image and it feels important to you, shoot me a comment on the page and I will see what I can do for you. Also, if you see anything else broken let me know as well.

Update: I was able to jam back into the master ftp account. The domain had been moved already, but there was still some others left on the account leaving the ftp up. Fucking SAWEEET!! All images should be restored.

My OctoPrint (nightmare) Setup

octoPrint

While I was digging around for 3D printer stuff I came across OctoPrint (and OctoPi). OctoPrint acts as a print server for your printer. So you don’t have to do the SD card shuffle anymore, or waste a power hungry x86 for the task. My printer is not in the same room as my computers so this works a treat. Also, it allows you to monitor the entire process. It also supports a camera to watch the build. Perfect, I have a RPi camera available. I also found a tutorial to allow OctoPrint to support turning relays off and on to control other stuff (lights, the printer itself, etc…).

(Stay with me, this post is a little erratic)

I followed this and it helped me a lot: http://www.joemiketerranella.com/post/158553998358/octoprint4

If you have a cheap eBay Raspberry Pi LCD module you will most likely need to go here http://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)

For my 3.5″ Inch “RPi LCD” I needed this: wget http://www.waveshare.com/w/upload/7/74/LCD-show-170309.tar.gz sudo apt-get update sudo apt-get upgrade  (needed to get 109mb)

Install the driver and it toggles the mode to LCD display: Note: The Raspberry Pi must be connected to the network, or else the touch won’t work properly for some reason.

Your screen should pop on to show the command line, I also got booted from my SSH session, closed by remote host – as the Pi rebooted.

The OctoPi images runs off Jessie Lite, so there is no GUI which fucking sucks, so we need to install one.

Install lightdm (needed 222mb in downloads)

sudo apt-get install lightdm sudo raspi-config

Boot Options > boot go desktop and login as ‘pi’.

Fuck didn’t work.

https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=133691

sudo apt-get install --no-install-recommends xserver-xorg sudo apt-get install --no-install-recommends xinit sudo apt-get install raspberrypi-ui-mods  (needed to get 140mb, 315mb used…Jesus…)

try again to…

sudo apt-get install lightdm

startx without lightdm

no go… Fuck.

https://raspberrypi.stackexchange.com/questions/43847/startx-command-not-found

[/crayon] startx……ok? tossed errors. Lets reboot. pixman.

./scripts/install-desktop  …. didn’t work either.

Black screen and cursor… ugh damn it all. Nothing but fucking grief… Damn you Jessie Lite, and damn you for removing the GUI guts, and while I’m at it damn you OctoPrint for not having the GUI shit either…

https://github.com/foosel/OctoPrint/wiki/Setup-on-a-Raspberry-Pi-running-Raspbian

Use the image that works with the screen, that i still have or ? Well the image is Wheezy so shit, nope. Lets try a new install of Raspbian on a SD card, then add the video driver. Will we get a desktop?

So Jessie (full) and lets try the newest drivers for the screen this time?

I finally got it fucking working, and I am not happy that it took this long, and I am not happy with the unit as a whole. Most likely because I m using an RPiB2 maybe? I have also tried a RPiB and that was soooo fucking slow… to the point it was unusable with a touch screen. Might have been ok for just the OctoPrint server but I didn’t even try it I switched back to the B2 immediately.

So… load the OctoPi image (Jessie lite bastards) and once that is done, do the LCD show bullshit… it should reboot and give you a desktop…

Now the god damn camera wont work…I tried the B no go, tried the B2 no go. Tried the B2 again wtf? Oh maybe I should enable the camera via raspi-config?….wtf no where does it mention that, not anywhere… after i found a forum post saying to enable the camera it finally fucking worked…wtf guys.

Now another fucking problem… the browser. Chromium wont load, requires a kernel upgrade or some bullshit… dude wtf, I just downloaded your “complete” image. Complete my ass, I have to do extra shit then it ain’t fucking complete. Epiphany works but no supports for kiosk mode. Jesus…

Is this fucking worth it??

On top of that I hear transferring files via wifi to the SD card is horribly slow. Most people seem to just stick to using the SD card and use the screen on the printer… all for touch control and a camera…gah.

Three fucking days….solid days so far… trying to get this bullshit working.

So to get chromium to work I had to upgrade the kernel, rpi update….

Which broke the fucking LCD screen….fuck this shit. I give up. I’m going back to square one. reflashing the SD card with OctoPi (Jessie lite) enabling the camera and leaving it as is..no touch screen.

I feel depressed now, and lost three days of my life. Dont make the same mistake… or buy an official RPi screen and a new RPi 3. I would actually recommend a 7″, as the 3.5 is way too small. It doesn’t even fill the whole screen.

 

(Update: this shit was a pain in my ass. I turned out just flashing a straight copy of OctoPi to the card and running it as is. And to correct my mi-information, OctoPrint allows you to transfer files to the Pi or the printer SD card. Going to the Pi is fast, the printers SD card is where it takes FOREVER. Just don’t do it.)

 

OctoPrint and Email Notifier woes

Email Notifier Woes

Update 3-22-19: It appears that the plugin is broken, dead, and abandoned by its creator. I currently know of no other way to send notifications besides Twilio or IFTTT.

I have OctoPrint (via OctoPi) setup and I wanted a way to be notified when my print was done without constantly walking into the garage. So I searched the plugins one day and found the Email Notifier.

After I installed it I could not get it to work for the life of me. I followed the instructions of adding my username and password to the keyring but it always produced an error NameError: global name ‘keyring’ is not defined”. Tried some fixes here and there but nothing had worked. So I bailed.

I tried to install the SMS Notifier (Twilio) instead, and that seems to have broken my plugin installation manager. Great. Now whenever I try to install a plugin after I tried to install the SMS Notifier I get the error message about pip not understanding the output or some shit. Great. I have flashed an SD card 2x and tried this twice, it always causes this issue. Damn you SMS Notifier. I have not looked at their Github for a fix yet, so… (Update: it did not break my plugin manager, that was another issue.)

I went back to the Email Notifier, and this time I got it working. I spent some more time digging on the net and found the solution to the issue I had of the keyring not defined. Then… I ran into a different error of yagmail not wanting to send mail via Google because of some reason (it didn’t say exactly) just gave me the generic error code of “send-mail: Authorization failed 534 5.7.14”. Looking that up had no help. But… I did find the answers to my problems and now my Email Notifier is up and running!

I get the error message of there being a new pip version but I have ignored this so far. These are the steps I took to get it working, YMMV.

First make sure that your Google account is setup to allow less secure sign-ins.
https://support.google.com/accounts/answer/6010255

Then SSH into your OctoPrint and update yagmail then install keyring.

Install yagmail (its probably already installed but hey)
/home/pi/oprint/bin/pip install yagmail[all] --upgrade /home/pi/oprint/bin/pip install keyring --no-deps

Start OctoPrint Python
/home/pi/oprint/bin/python

then

(control+z to exit)

Reboot the Raspberry Pi for all the changes to take effect. I tried just restarting OctoPrint but that didn’t work. After the reboot I ran into another issue (of course).

“sending failed. Reason :: send() got an unexpected keyword argument “validate_email”

Modify the file init.py (__init.py__ is how it showed on my system with ls ) found in /home/pi/oprint/lib/python2.7/site-packages/octoprint_emailnotifier and change the line:
mailer.send(to=emails, subject=subject, contents=body, validate_email=False)

to
mailer.send(to=emails, subject=subject, contents=body)

(here is the fix https://github.com/anoved/OctoPrint-EmailNotifier/issues/41#issuecomment-315799836)

Places I found my answers:

https://github.com/anoved/OctoPrint-EmailNotifier/issues/8#issuecomment-187017056
https://github.com/anoved/OctoPrint-EmailNotifier/issues/27#issuecomment-295525220
https://github.com/anoved/OctoPrint-EmailNotifier/issues/27#issuecomment-302890618

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”.

Using Amazon Polly with Node-Red

Polly Diagram

Amazon Polly and Node-Red. This was far easier to get going than any Alexa skill I tried to do. I just came across this the other day on Scargill’s Tech blog.

Amazon Polly is a service that turns text into lifelike speech. … With Amazon Polly, you only pay for the number of characters you convert to speech, and you can save and replay Amazon Polly’s generated speech.”

Basically you feed Polly SSML text and it returns it in spoken form as an MP3 (or other format). Sweet, I can give my server/Node-Red a voice! Not sure my wife will like this but it will actually server a valid purpose. I was admitted to the hospital (again) for a short three-day stay recently and while I was admitted (and loaded up on drugs) my server closet reached my maximum set temperature… and issued the text alert 187 times. Now I can have the server annunciate that the closet needs to be opened. I could add my wife’s number to the SMS list but that will fail, lol. Simply saving the MP3 on the server and having it be played back works just great.

I am sure you can tap into the API many other ways, and use Polly many other ways, but the simplest way was my path. I just logged into the Amazon Polly Developer console and slapped some text in the input box. It spit out an MP3 and I saved it. The catch here is that the free tier of the Polly program only lasts 12 months, then you get charged. Its super cheap though, $4 per 1 million characters. The free tier is 4 million per month (for 12 months). From what I have read Polly will search the cloud to see if the file already exists. If it does it pulls it down, if it doesn’t it creates it (and counts agains the character limit) and pulls it down. Is this for “the cloud” or your account? Dunno. Still pretty cheap.

I have circumvented the whole thing (for now). I don’t really plan on (or have the need to) generating Polly files on the fly. What works for me is as I said, just slapping a ton of phrases I think I’ll need into Polly and saving the files for later. I’m cool with that.

But, there is a node for NR that will generate Polly files for you on the fly, and/or pull down the ones already generated. I mentioned I found Polly on Scargill’s blog, he also used NR to play with Polly. He had to do it the hard way. Three days ago the node was made. Definitely check out his blog even if you just use the node. Its all good info.

Install node-red-contrib-polly-tts

https://flows.nodered.org/node/node-red-contrib-polly-tts
https://www.npmjs.com/package/node-red-contrib-polly-tts

npm install node-red-contrib-polly-tts

The node looks pretty simply to use (I have not used it). You need to add your Amazon Polly API credentials to the node. The input gets TTS’d and the file saved. If the text has already been converted no Polly call is made and just the file served. So it looks like it stores all the Polly MP3s for you locally. Sweet.