Installing nodejs and npm on Ubuntu

Ubuntu’s apt-get has outdated versions of nodejs.. The right way to to intall nodejs on Ubuntu is to use the repo maintained by nodesource. Update apt-get with this repo and then install..

curl -sL | sudo -E bash -
sudo apt-get install -y nodejs

Look in the nodesource repo above to get the right version you need.

Complete/Reject/Abandon – Part 2 of MKR1000 Azure IoT Hub Interface Using HTTP

In the earlier post MKR1000 Azure IoT Hub Interface using HTTP, I wrote about how to get the MKR1000 ready for Azure IoT Hub and start receiving data from Azure IoT. You might have noticed the following when running the sketch in the earlier post: After using the Device Explorer to send a single message, the MKR1000 would have blinked its LED after the first receive. If you continue to let the sketch run with out sending any new message, after about 60 seconds you will notice that MKR1000 receiving the same message and blinking again. This is due to the way a message’s life cycle works on the Azure IoT Hub. In this post I will address how the devices should send any one of Complete/Reject/Abandon message back to the Azure IoT Hub so that the message is not replayed again. This is essential if you are to interface with Azure IoT Hub correctly with HTTP.

Continue reading “Complete/Reject/Abandon – Part 2 of MKR1000 Azure IoT Hub Interface Using HTTP”

MKR1000 Windows Remote Arduino with Firmata WiFi

This MKR1000 Windows Remote Arduino with Firmata WiFi guide lays out how I got my new MKR1000 working with Windows Remote Arduino. This guide will walk through:

  1. Setting up the latest Firmata Version with the WiFi support
  2. Verifying with the Windows Remote Arduino Experience App
  3. Controlling MKR1000 with Universal Windows App

Continue reading “MKR1000 Windows Remote Arduino with Firmata WiFi”

MKR1000 Azure IoT Hub Interface Using HTTP

After getting my hands on the pre-release version of the MKR1000 as part of the Worlds Largest Arduino Maker Challenge yesterday, I was trying to get it running with the Azure IoT Hub. This guide lays out some of the things that I learned that might help out others out there trying to get their projects running with Azure IoT.

This guide doesn’t use AMQP or MQTT. This uses the simple HTTP interfaces available for Azure IoT Hub.  This assumes that you have already signed up for the Azure IoT Hub and created it. This guide will walk you through the following steps to get you going.

Continue reading “MKR1000 Azure IoT Hub Interface Using HTTP”

Adafruit IO IoT LED Candle

Ever since I saw these LED Candles I wanted to pick them up and connect them to a WiFi enabled micro controller to make an IoT LED Candle. Recently while browsing through the local Walmart I noticed one of these with the “Try Me” button. I had no choice but to pick it up and get my IoT itch over with. In the end it was pretty straight forward with the help of the awesome Adafruit IO.

LED Candle with Try Me button
LED Candle with Try Me button
Continue reading “Adafruit IO IoT LED Candle”

NodeMCU ESP8266 with Arduino IDE

I wanted to be able to program the ESP8266 based NodeMCU board with the Arduino IDE. This is how I setup the environment and had the NodeMCU blinking.

NodeMCU Blink Arduino IDE
NodeMCU Blink Arduino IDE
Installing NodeMCU Board
  1. Install latest version of Arduino IDE
  2. Add the Esp8266 board manager. Here is a list of all the unofficial board managers that can be used with Arduino IDE.
    1. Start Arduino and open Preferences
    2. Look for “Additional Board Managers” field and enter <code></code>
    3. Open Tools>Boards>Board Manager
    4. Choose “esp8266 by Esp8266 Community” and install. Its about 160 MB install.
ESP8266 Arduino Board Manager Install
ESP8266 Arduino Board Manager Install

After Installation these are the boards I could see in Boards menu under ESP8266:

ESP8266 modules in Arduino IDE
ESP8266 modules in Arduino IDE

You should now be able to connect your NodeMCU to the PC and verify. Be aware of two things:

a) You might have to install the Silicon Labs CP210x Serial Driver if you can not see any COM Port listed on the Ardunio> Tools> Ports menu

b) It might a silly thing. But make sure you use the right USB cable. There are too many USB cables in my toolbox. Once in my ignorance about USB cables I used a power only USB charging cable (one that has only the two wires for power connected and no data wires) and struggled a while on COM port not appearing.

 NodeMCU Blink

Once the Port appears in the Arduino IDE menu, choose the right board. In my case its NodeMCU 0.9 board.

Choose File>Examples>ESP8266>Blink sketch. Press Upload. The blue led on the ESP8266 should blink rapidly indicating communication status. Once sketch is successfully uploaded I could see the on board red LED connected to GPIO 16 blink  (D0 on the board).. Pin out below.

NodeMCU Pinout
NodeMCU Pinout

Now that my Arduino IDE is setup to be used for NodeMCU programming, time to explore further.

Amqp protocol is not supported on Universal Windows App

I was surprised to learn that AMQP protocol is not supported on Universal Windows Platform with Azure Devices Client libraries.I was getting this message “Amqp protocol is not supported” when trying to connect to the Microsoft Azure IoT Hub through the UWA app. This applies to MQTT as well. Only thing that’s supported right now is HTTP.

The nuget package Microsoft.Azure.Devices.Client lists both AMQP and MQTT libraries as dependencies. But its not supported on the Universal Windows platform. Weird.


This threw “Amqp protocol is not supported” :

__thisClient = DeviceClient.Create(__azureIoTHubHostname, 
                       new DeviceAuthenticationWithRegistrySymmetricKey(__azureIoTHubDeviceId, __azureIoTHubDeviceKey));

Had to update the line to include the TransportType.HTTP1 parameter:

__thisClient = DeviceClient.Create(__azureIoTHubHostname, 
                       new DeviceAuthenticationWithRegistrySymmetricKey(__azureIoTHubDeviceId, __azureIoTHubDeviceKey),

devcon – let the force be with you

While trying to make a XBox 360 driver work with Raspberry pi, I ended up installing a wrong driver with devcon. When trying to remove the driver, kept getting the message that the driver is in use even though the usb device was unplugged. So had to force remove by using -f switch.

​devcon -f dp_delete oem0.inf

MPR121 Driver for Windows IoT Core/Raspberry Pi 2

I had a MPR121 in my tool box. After getting my Raspberry Pi 2 installed with Windows IoT Core, I wanted to get this MPR121 Capacitive touch break out board working with it. While Adafruit had a library for Arduino, there wasn’t an MPR121 Driver for Windows IoT Core readily available. So I wrote this Windows.IoT.Core.HWInterfaces.MPR121 library in C# that can be used with the Raspberry Pi. In addition to the sample app available in the Github repo,  I also  created a Touch sensitive Christmas tree using this library. This post describes a few things about the MPR121 library.

Continue reading “MPR121 Driver for Windows IoT Core/Raspberry Pi 2”

Windows IoT Core and the Raspberry Pi 2

Had a load of fun getting my Raspberry PI 2 set up with Windows IoT core and the whole development environment that’s needed for it.

Windows 10 and Visual Studio

Can’t develop for Windows IoT core without Windows 10.  So had to set up Windows 10 on Mid 2011 Mac. The problem was my Mac already had Debian Linux running on a separate partition. I used the wonderful rEFInd boot manager from Rod Smith earlier to do the partitioning and it came in handy to add the third partition for windows 10. Had some quirky troubles with the Apple Wireless mouse and keyboard but i have a wired keyboard/mouse connected to the Mac just in case. So now my mac has two keyboards and two mouse.. 🙂  One day i need to get around to fixing the problem permanently. After getting Windows 10 on the Mac, installing VS 2015  was a breeze.

Continue reading “Windows IoT Core and the Raspberry Pi 2”