Down the Rabbit Hole of IoT Part II, or, how an innocent hobby leads to creating an IoT Robo Laser Octoblu Smoke Breathing Kitty on Splunk !

 

If you are reading this, then you have read Part I and taken the BluOctoPill- welcome down into the Rabbit Hole of IOT!

 

Go with the Flow

The heart of this demo is the Octoblu framework, an amazing mesh network which is a powerful IoT Gateway between generators and consumers of data. Running in a highly resilient cloud framework, it supports multiple protocols, programming languages and platforms. The basic unit of operation is a “Flow” which is an instance of Octoblu that can do whatever you tell it to and can be created and managed in a drag and drop, web based interface. In the simplest case, you might do something like create a flow which says “When I post ‘#bluelight’ on my Twitter account, change my lights to blue”. What is happening there would be the Octoblu flow scanning Twitter for a post by you. When it sees the data “#bluelight”, it triggers the preset action you described of changing your lights to blue. How did it do that? You are running an instance of the gateway on some device of your own and connected it to your wifi based light. Now any condition, input, data, etc. that you define can control your lights via the Internet.

You can run an instance of gateway on a many different devices such as PC, Mac, Android, IOS, Arduino, etc. Based on the ambitious I/O requirements of this project, we chose to use a Raspberry Pi based on it’s processing capabilities and number of GPIOs (General Purpose Input/Output Pins) for controlling the various devices.

 

IMG_0432

Moheeb Zara building the Raspberry Pi image running Gateblu

Here is screenshot of the Flow we used in Octoblu to operate this demo. You can see that it is a drag and drop type of “flowchart’ interface.

 

OctoBlu-Flowclick to expand and open in a new window

Any pre-defined objects can simply be dropped into the flow and connected with the mouse. Bringing up the properties of any object lets you set the value of it, i’e’ “blue” for the light. The big button is a simple trigger which allows you to start the actions that are linked to it manually. In the light example, clicking on the trigger in the Octoblu web page would turn the light in your room to the color Blue.

In our demo, this trigger was used for testing while during the demo the real trigger data was coming from Splunk monitoring the Datacenter. This is explained beautifully in Jason Conger’s blog on how to trigger an Octoblu Flow from Splunk.

The monitoring of our Citrix Datacenter had 4 basic states and outputs defined as follows:

Green– Everything is normal and running great

Yellow– System is experiencing some issues

Red– Something is really wrong!

Defcon5– Crashed!

Lets take a look at a simple component to make it clear how this works- the SMS message sender. When everything was good and Splunk was providing data indicating the GREEN state, it triggers the SMS node as follows:


SMSRED

So, when the system was normal, I received a text that said “System State GREEN Everything is Good!”. I just had to define the phone number to send to and message payload, that’s it, Octoblu took care of the rest! Now, when the system went into DEFCON5, I received a very different message “STATUS: RESUME GENERATING EVENT – RESUME POSTED TO MONSTER.COM”!

SMSDEFCON5

So, taking this simple example, we extended this to all the things that make up the IoT Workspace as follows:

Raspberry Pi B+ with the Pi image running Gateblu with Wifi and Bluetooth adapters

A LIFX wifi lightbulb in the desklamp

FadeCandy controller board running the NeoPixel LEDs

A Phillips Hue Bulb lighting the glass plaques

Two servo motors mounted inside the Lucky Cat to turn the body left/right and the arm up/down

A relay controlling the laser projector mounted in the Kitty’s chest

A relay controlling vibration motors placed inside the mini file cabinet and mounted inside the foam rubber robot figure

A Punch Through Light Blue Bean hacked to be my keychain

An iPad acting as a digital photo frame showing pictures that reflect the system state

All of these devices were defined as nodes and connected through the Octoblu Gateway running on the Raspberry Pi. The difficulty ranged from the SMS example above (drag and drop) to hand coding  custom nodes such as one for the servo control using the Johnny5 machine control library (thanks to MoheebChris Matthieu and the whole Octoblu team for their help on this!).

In addition to the software, I worked out all the power supply requirements, logic/power/grounding cabling, relay control, board layout, etc. This included drilling holes in the cat for LEDs in the eyes and repackaging the circuit boards of a mini laser show projector in the body so it would project through a hold drilled in the chest. I learned all kinds of cool new tools in the process like ceramic drill bits, glue guns and soldering tiny things with magnifying lenses! Perhaps the single biggest challenge was somehow getting all this stuff across country to Orlando intact, figuring out how to get it mounted to the desk and actually working by show time!

I dont know what else to include here so please feel free to reach out to me @stevegreenberg to let me know if there is any other info that would be useful. We are also planning to hold a webinar in August to cover this info in an interactive format. In the meantime, enjoy some pictures below of the project and Geek Speak Tonight!

(Click on images to expand them to see more detail)
IMG_0617

IMG_0651

IMG_0597

IMG_0751

Desk4

Desk1

desk2
Desk5

Desk7 storage

DougBrown

IMG_0839

Virtual Twins
kitty laser cool

laser1



Splunk ICA round trip

Splunk Metrics

Virtual Twins

If you made it this far you are a hero, please let me know and I will buy you the beverage of your choice at our next industry meetup!

SG

Down the Rabbit Hole of IoT Part I, or, how an innocent hobby leads to creating an IoT Robo Laser Octoblu Smoke Breathing Kitty on Splunk !

When I left off on the last blog, my son and I were working on our Laser Kitty. I am happy to report that the project was successful! We completed our laser kitty by experimenting and learning all we needed to program an Arduino, servo motors and a laser and then shrink into a small package to fit inside a plastic Lucky Cat we bought at a local Chinese gift shop. You place the kitty on the edge of a table, or counter top, and it fires the laser against the ground, drawing a pattern of light for kitties to play with- here is what is looks like before final assembly:

 

IMG_0192

 

 

and in action:

(the flipped and distorted image happened by accident but it’s perfect because it looks a bad old kung fu moving opening sequence! how cool is that?!?)

Mission #1 Accomplished and the story would have ended here, except we then slipped far down into the Rabbit Hole of IoT! Immediately after, and very rapidly, a number of things happened that poured jet fuel all over this and ignited a massive flame of two months of manic late night hacking:

– I totally freakin’ love IoT and everything about the Maker culture

 @JoeShonk volunteered us to plan, execute and emcee Geek Speak Tonight! at Synergy 2015 , and, the theme was to be all about IoT. This was to include an opening comedy script for @Hal_Lange and I to perform which was not to be revealed to us until two days before!

– He set the bar for this to be a “Legendary” event

– People at Citrix, as usual and understandably, started to worry about this band of ridiculous geeks taking charge of a featured event at their annual worldwide conference (makes sense!). The main question coming at us “What is the practical business application of this stuff?”

– I love to rise to such challenges!

To satisfy all of the above conditions I came up with the IoT Workspace. The idea is that the Internet of Things is about stuff in our environment generating and receiving data. People tend to think of fitness trackers, internet connected refrigerators, or turning on and off your lights from your smartphone. Those are example applications, but the implications are much greater than that. I thought to myself, hey self, yes you: “What is the real core of Citrix? What do we implementers and Citrix users care most about? What would be simply awesome and make it all better?”

Well, the core of Citrix is delivering Applications and Desktops to anyone, on any device, anywhere, over any type of connection to any type of device. What we care about is how well that is running! Make it fast, make it “just work”. If something goes wrong, how do I find out? How do I isolate the problem? How can I act on it? While we know how to do these things, it always ends requiring someone to actively monitor stuff, logging into various consoles and systems and combing through data and indicators. If the Internet of Things is about connected devices, why can’t I make my own familiar environment work for me? Why can’t all the stuff on my desk be active consumers of IoT data? Why not have the things around me monitor the data center for me? Instead of logging in and looking around, why dont they proactively get my attention and tell me exactly what is going on in my Data Center? (and yes, laziness is often the real mother of invention!)

Like most big ideas, if I actually knew what it would take I never would have started. But in my naivety I knew I could control motors and microcontrollers and use Octoblu to consume data and talk to devices. So I ought to be able to create this, right? What I didn’t have was a ready way to get real world data out of a real Citrix Enterprise environment to trigger these devices.

Desk4

When you need help it always a good idea to turn to the best, so I reached out to my friend and fellow CTP  @JasonConger. Jason has a long history of mastering data access and code development around Citrix enterprise systems.

IMG_0761

 Jason pondering the IoT Workspace data flow…..

Let’s start with the end result, here is the video from Geek Speak Tonight! of the IoT Workspace. Note that the lamp, the glow of lights around the desktop, the pen set and glass desk plaque, the cat statue, picture frame, key chain, file cabinet and, um, ‘atmospheric conditions’, and, SMS messages to my iPhone are all receiving monitoring data coming from a system composed of XenApp, XenDesktop, Hyper-V and XenServer, Cisco UCS hardware and a storage array from a major enterprise manufacturer (name withheld because we knowingly allowed it fail and do not want to unfairly reflect negatively upon on the product!). Also, to understand some of the comments made in the video, you should be aware that in the previous two days a number of high profile demos had failed during keynote and presentations, especially in trying to demo the Citrix X1 Mouse in large wifi/radio saturated rooms. The same thing was happening to us as wifi was not working due to interference and the preceeding demos had not gone to well as a result…..

 

Be sure to read Jason’s blog on the same demo for more detail on the how he got the data from Splunk to interact with Octoblu and trigger the flows I created to control the devices.

Now you can take the RedOctoPill and end here having enjoyed the demo. Or, you can take the BluOctoPill and jump further down the rabbit hole of IOT with us in in Part II….