Use the New MQTT Service from ThingSpeak for Real-time CheerLights Updates

It’s that time again. That time when people all across the world synchronize their lights together with CheerLights! People have built amazing CheerLights displays. I have seen everything from color-changing shoes to snowmen… and trees.

 

CheerLights Introduction

Here’s a quick introduction to the CheerLights project for those who are new to the project. Imagine 1000’s of multicolored lights all around the world synchronized to one color. When one of the lights turns red, they all turn red. To control CheerLights, send a tweet to @cheerlights or include “cheerlights” somewhere in your message with the name of a color. This will cause a chain reaction and all of the CheerLights displays and apps will change their color to red.

 

ThingSpeak MQTT Service

CheersLights is powered by ThingSpeak IoT. And, this year, I am happy to introduce real-time CheerLights updates using ThingSpeak’s new MQTT service. Using the MQTT service by ThingSpeak, your CheerLights change instantly. ThingSpeak has posted an example that gets a Particle Photon connected to CheerLights using MQTT. The Subscribe to Channel Updates Using Particle Photon Client example shows you how to use a Particle Photon Wi-Fi board to subscribe to channel updates from the CheerLights channel. The program displays the color read from the channel on the built-in LED on the Photon board. You can subscribe to the channel feed or directly to the color field on the CheerLights channel.

Once you learn how to use the MQTT service from ThingSpeak, you can easily adapt it to your IoT project. This is a great way to have real-time control of a device or real-time monitoring of sensors.

If you want to follow the project and see what others are building, visit CheerLights.com or follow on Twitter.

Measure Wi-Fi Signal Levels with the ESP8266 and ThingSpeak

Oh, my. I am sure you have been hearing about the Internet of Things… The IoT! You might be wondering how to get started with i(o)t. There are many places to start. You might be interested in the data that devices collect and analyzing it or you might be interested in how to deploy thousands of sensors around a factory floor to better understand how efficient things are. You might just want to tinker. Be the cool person at the party talking about Arduino, Raspberry Pi, and Maroon 5. If you want to try out a “thing” – a small, connected device – that can measure data, I will help you get started with a quick tutorial using the ESP8266 “thing”.

Parts

First, you need to go by a thing on Amazon. I recommend for this project an ESP8266 compatible device like the NodeMCU. Don’t be scared. Add it to your Amazon shopping list or ask Alexa to buy you one. It’s $8.

ESP8266 NodeMCU

Other parts that you will need:

  • Laptop
  • Micro USB cable

ThingSpeak

While you are waiting for your Amazon stuff to arrive, you can learn about ThingSpeak.

ThingSpeak IoT Platform

ThingSpeak is where we are going to store the data collected by our thing and where we can see the data that we collected. Visit ThingSpeak.com and Sign Up for an account. This will just take a minute and user accounts are free. Once you have a user account, you need to create a channel. ThingSpeak channels are where data gets stored. Create a new channel by selecting Channels, My Channels, and then New Channel. Name the channel, “ESP8266 Signal Strength” and name Field 1, “RSSI”. Click “Save Channel” at the bottom to finish the process.

Channel_Settings

Setup

Once the ESP8266 comes in the mail in a couple of days you need to gather a few more things to be able to program this thing. You will need a laptop and a micro USB cable (like the one that you charge a phone with). On the laptop, we need to install some software to be able to program the ESP8266. Visit Arduino.cc and install the Arduino IDE.

Arduino IDE

Once the Arduino IDE is installed, open the program so we can do a couple of setup steps to get it ready to program ESP8266 devices. Under File, Preferences, and Additional Boards Manager URLs, add this link: http://arduino.esp8266.com/stable/package_esp8266com_index.json – this will allow the Arduino IDE to manage ESP8266 compatiable boards.

Arduino Preferences for ESP8266 programming

The thing that you bought from Amazon uses the CP2102 USB driver. You might have to install a USB driver from Silicon Labs for this to work with your computer. Connect the ESP8266 to your laptop with the micro USB cable.

USB Driver for the ESP8266 CP2102

Back on the Arduino IDE, under tools, configure the following settings:
Arduino Board Settings for NodeMCU

Whew. We got through the setup. Now we can program this device or any ESP8266 compatible device and shouldn’t have to do that again.

Programming

The code that the Arduino IDE uses is called a “sketch” – this is just a short program that the device runs over and over. In our project, we are going to have the code measure the signal strength of the Wi-Fi connection and upload the data to ThingSpeak, wait, and repeat. Over time we can see the signal strength of our Wi-Fi connection. Copy the example code to your Arduino IDE and change some of the defaults to match your Wi-Fi network and ThingSpeak settings.

Once everything is set, click Sketch and then Upload. This will take the code and program the ESP8266 with it. It takes a minute so be patient. If anything goes wrong, make sure that you have the right board settings and that your “Port” matches what your laptop thinks the port is.

Back on ThingSpeak, you should see data start to come in. You are looking for the Private View of your channel and a chart that is updating. As new dsata comes in, the chart shows the latest value. If you carry the ESP8266 around the house, you might notice the signal strength changing.

ThingSpeak_Channel

Next Steps

To take the project further, you can use MATLAB on ThingSpeak to do some data analysis. I will post about IoT data analytics on another day. The ESP8266 source code for sending data to ThingSpeak is available on GitHub.

Welcome to the Internet of Things. Let me know if you try this out and let me know if you take this project further and build something cool.

Are Open Source IoT Platforms Ready for Primetime?

Bruce Sinclair of IoT-Inc. recently asked me to be a guest on his Internet of Things podcast, the IoT Business Show. I have been a faithful listener to the podcast since it started so I was honored to be a part of his show. Bruce asks very interesting questions and has his audience at heart. His questions help answer questions that the audience might be wrestling with when making a decision about getting into IoT (or not).

In his latest episode, Bruce asks, “Are Open Source IoT Platforms Ready for Primetime?” My open source IoT project is ThingSpeak. I created ThingSpeak back in 2010 as an ioBridge project and it has really taken off. The source code for the ThingSpeak API is available on GitHub and is being worked on by over 100,000 developers from around the world.

Open Source IoT Platforms Podcast

To listen to the IoT Business Show podcast, check out iTunes or the IoT-Inc. website.

In this episode of the IoT Business Show, I speak with Hans Scharler about where open source platforms are today, and when it makes most sense to use them.

Bruce Sinclair

 

Send Your Windows Server’s Disk Free Space to ThingSpeak Using PowerShell

I manage a lot of servers. One of the things that I am always curious about is how much disk space is left on my servers. I know there are a lot of ways to track this, but almost always it seems the service that I am using changes on me or breaks over time.

My super simple solution for tracking server disk space is to use Windows PowerShell and ThingSpeak. I went to the trouble to release the code to GitHub, so that you can try this out for yourself. This can be used on any Windows Server as long as you have the ability to execute PowerShell scripts. ThingSpeak gives you a place to store data from anything. In this case, I am sending my disk free space to ThingSpeak once per day by scheduling a Windows Task.

Check out the open source code on GitHub!

Internet of Things Pittsburgh Kicks Off on the Global Internet of Things Day April 9th

I have started a new Meetup — Internet of Things Pittsburgh (#iotpgh) — this meetup is open to all steel city innovators looks to explore the emerging  Internet of Things. Join me as your host on the first meetup on April 9th at 6pm at the TechShop Pittsburgh.

IoT Pittsburgh

In each meetup we will feature the following:

  • Current state of IoT
  • Privacy and Security
  • Technology trends
  • Business cases
  • Open discussion
  • IoT project demos
  • Industry presentations

Follow us on Twitter using the hashtag: #iotpgh and join us on Meetup.com.

CheerLights is Back for the Holidays

For the third holiday season in a row, the CheerLights project is gearing up. The idea behind CheerLights is to show that we are all connected by synchronizing the color of lights around the world. Christmas lights are a staple around the holidays and with Internet-connected lights, the color of your lights matches the color of everyone else’s lights.

It has been a real treat watching this project evolve as more and more people add lights… and other things. Things like Android and iPhone apps that check the latest color of CheerLights, an old Commodore 64, and Christmas trees.

To control the lights around the world, send a Tweet mentioning @CheerLights and a color. The command is processed by ThingSpeak platform and distributed to all of the lights listening to the CheerLights API.

@CheerLights I am dreaming of a White Christmas

Another powerful aspect of the CheerLights project is that is shows off what is possible with the emerging Internet of Things. With a single message sent via a social network like Twitter, 1000’s of objects around the world are in sync with each other. Lights are connected by many types of controllers, such as Arduino, ioBridge, Philips, and the Raspberry Pi. This project is only possible through the Internet and the coordination of developers around the world.

Learn how to join the project at CheerLights.com.

We are all connected…

CheerLights: my lights are linked to everyone else’s

If you have been following my projects for the last 12 years, you probably figured out that I must have a master plan. And this plan involves connecting things to the Internet that may or may not turn against us in the future. Way back in 2001, my partners and I released FuzzBox – this technology allowed for artificial intelligence to be distributed to devices via the Web. Our thoughts were if the decision making could be made on the Internet the devices themselves could focus on their task vs. trying to be a super device on their own. This was way early on and the ideas were premature, but it started a series of events and failures that led to even more projects involving devices linked together over the web. I guess this is now called, “The Internet of Things”.

Something that has emerged over the years is social networking. I have been fascinated by the idea of collective intelligence. It’s fun to follow a football game on Twitter or on Facebook’s live stream. You get to see the take other’s have on the same event that you are experiencing. If the Steelers score, you can feel it reverberate through social networks. These networks only work if there is lots of participation by many people. I have heard that people have predicted STD outbreaks from Twitter status updates, food poisoning sources, and even where earthquakes have taken place. This is fascinating to me.

The results are two-fold: you can learn from this data and that we are all connected. Enter in, CheerLights – CheerLights is my combination of distributed devices with social networking. This project that involves connecting multicolored lights to other people’s lights and allow Twitter keywords control them all. If someone tweets, “@cheerlights let’s go green” – every light connected to the project would change to green. To me this is a physical representation of a social network trending topic. It’s a way to share a moment in that moment. Just like with social networking, CheerLights requires scale to be very interesting.  If you check out CheerLights.com, you will see how to build a set of lights that are linked together with other people’s lights via Twitter. I have examples using things from ioBridge, Arduino, and Digi. Please let me know if you decide to build something and connect it to CheerLights.

We are all connected. That’s my purpose for building all of this technology. Nothing else matters.