Amazon Echo just bought paper towels for me?

This am, true story:

Me: “Alexa, I need to buy paper towels”

Alexa: “sparkle 24 giant rolls, white, your order total is $27.  Should I place the order?”

Me, puzzled at this unexpected response: “um, yes?” 

Alexa: “Ok, order placed.  Your order will arrive on Tuesday, May 26th

Me: oh crap, I still have ~24 rolls from my last order!

My cat broke the internet

Note to self – the next time the internet stops working for several days and rebooting the router repeatedly doesn’t work and AT&T can’t figure out what’s wrong remotely and the self-described ‘outside guy’ AT&T technician changes some stuff up on the telephone pole but the internet still doesn’t work…..

…. check to see if the cat chewed through the cable.

Again.

Just in case.

How to send events from a Raspberry Pi to Microsoft Azure Event Hubs

Sending data from a Raspberry Pi to a Microsoft Azure Event Hub is remarkably easy.  Here are the steps:

1) Configure your Event Hub in Azure

This article on MSDN shows the steps to set up an Event Hub.  It’s very easy and takes just a minute.  But when you get to the part about how to send messages, come see #2 and #3 below!

2) Install the Azure SDK on your Pi

This should be pretty easy, but I had a little bit of trouble getting pip 3.2 running on my Raspberry Pi 2 B.  Once I did get pip-3.2 installed (because Python 3.2 is what comes on the Raspberry Pi), it’s easy:

pip-3.2 install azure

3) Write a little code

Once the Azure SDK is installed, you can write your “Hello Event Hub” program.  Here’s what mine looked like:

azure poc

You can download this sample on github: https://github.com/brentonc/IoTSmoker/blob/master/samples/azurepoc.py

Note, this sample is largely based on this article in the Azure SDK documentation.

The only things that weren’t immediately obvious to me from the official SDK documentation was what the shared_access_key_name,shared_access_key_value, service namespace, and hub names were.  Here are a couple screenshots to help you visually map the data points:

Namespace and Event Hub names:

Namespace and Event Hub Names

Shared Access:

Shared Access

4) Glory! 🙂

Once you get this set up, you’re ready to event!  The Azure portal gives you a handy dashboard to see the rate a which messages are coming through (but, there’s a bit of a delay, so don’t worry if there is a delay between when you start sending messages and there is something to see in the dashboard):

Event Hub Dashboard

Getting Robogaia Raspberry Pi Temperature Controller to work

I recently got a Robogaia Raspberry Pi Temperature Controller and tried to fire it up.  Their website has the configuration steps as well as sample code.

However, after running through the install steps and attempting to run the samples, I received the following error:

Traceback (most recent call last):
File "test.py", line 9, in
bus = smbus.SMBus(0)
IOError: [Errno 2] No such file or directory

Thankfully, the answer was found on the raspberry pi forums, though about a different device. you simply need to enable i2c via raspi-config -> Advanced

After a reboot, it works great!

Thanks to the Robogaia guys for saving me some work with their handy plate!

New DIY/IoT/Raspberry Pi Project: Smoker Temperature Controller, or “My Smoker is an Internet of Things Thing”

For my next project I am going to build a wifi enabled, Raspberry Pi controlled temperature controller for my Weber Smokey Mountain (WSM) smoker.

The temperature of a charcoal smoker is controlled by the flow of oxygen.  More oxygen, more heat.  This is usually done by checking the temperature of the smoker every now and then and adjusting the vents – more open to get it hotter, and less open to make it cooler.

The idea is simple – thermometer connected to a Raspberry Pi, a fan/blower plugged into the WSM, and a small python program that tells the blower to blow if the temp gets too low.  It’ll be interesting to see what other adjustments need to be made once the base solution is in place.  And once it’s going it becomes simple software to push the temperature readings and other data to my phone or other devices.

The WSM actually keeps its temperature quite well, and doesn’t require much babysitting most of the time, so this project is very much in the ‘because I can’ column. But, with something like this it will be much more feasible to smoke overnight, for example (om nom brisket!).

Also – yes, I know I can buy something that is ready made for not a lot of money.  But what fun would that be?

Standing Desk Accessories – Anti-fatigue mat

I’ve been using my DIY motorized standing desk for a couple weeks now, and am really enjoying it.  I’ve been standing more than I thought I would, but when I get tired the flexibility to lower to a sitting height is really nice.

One thing I’ve noticed that at the end of the day my legs are quite tired, and my feet bothering me a little.  Thankfully my anti-fatigue mat arrived last night.  After one day using it, I can already feel a big difference.  My feet feel much better, and while my legs are still a little tired, it seems to be a little less so than the other days.

The mat is pretty heavy duty and looks like it will last a while.  Standing on it feels soft and firm at the same time, and almost like it molds to the feet.  I’ve used it barefoot thus far, but will likely see what the experience with shoes is soon.

This is just the first day’s impression, but thus far it seems like a good investment.

By the way – I’m glad that my desk gives me fine grained control on the height so I can get the adjustment perfect with the various mat/shoes/etc arrangements I’ve been exploring!

Using Amazon Echo to add stuff to Trello

At my wife’s request I have integrated my Amazon Echo with Trello.  We have a shared “Home” board in Trello that we use for grocery lists, things we need to get done, etc.  Now, she can say “Alexa, we need to buy milk” and voila, a new card with “Milk” appears on our “Things to buy” Trello list!

The source code is in github: https://github.com/brentonc/echo2trello

Thanks to greencoder for his project at https://github.com/greencoder/amazon-echo-cheddar which gave me a start on the Amazon side of things!

DIY Motorized Desk Powered by Raspberry Pi is Operational!

It’s alive!

This has been a long time in the making, and I’ve posted a number of times during the process:

This has been an incredibly fun project.  It definitely would have been faster and probably more cost effective to just buy a desk or table lift, but the journey was well worth it.

DIY Motorized Standing Desk Part V: Test with 3 actuators controlled from Raspberry Pi

Edit: here is the final operational desk, utilizing the 3 actuators

I have the control board for my DIY motorized standing desk wired up, and ran a test of the board controlling 3 linear actuators at the same time.  I knew the wiring and software worked for 1 actuator, but this was the first time that I connected more than one actuator up.  The desk will be lifted by 3 actuators so I needed to be sure this worked.

Here it is, worked on the first try and nothing caught on fire!

One thing of note – I had initially planned to control each actuator independently from the Raspberry Pi, with each relay signaled from a different GPIO pin.

However, in the midst of wiring the control board up I realized that it was possible that a software bug, crash, or other unforeseen scenario on the Pi could theoretically result in actuators moving in different directions, and that would be a Very Bad Thing (images of broken desks, shattered monitors, and crushed babies come to mind).

So they are all wired now on 2 GPIO pins (one for the “A” relays, and one for the “B” relays).

So now the leg apparatus’ are built, and the control board is working.  Next step: put it all together!