Easier ways to add devices into IoT Hub

Image from http://www.edntaiwan.com/news/article/20160523TA01-IoT-SoC


Azure IoT team has a plan to add device management features in Azure portal, but we have to wait a little more time before we can manage devices in Azure portal. You can now add devices in Azure portal!

Although we cannot add devices into IoT Hub in Azure portal directly in the recent time, we still have many chooses to do that.

For Windows users, there’s a tool called Device Explorer. You can add devices by some clicks simply.

For Node developers, there’s a tool called IoT Hub Explorer, you can install it by running npm install -g iothub-explorer.

For Python developers, there’s a tool called Azure CLI, and you can install it by running curl -L https://aka.ms/InstallAzureCli | bash on MacOS and Linux, or pip install --user azure-cli on Windows.

Both IoT Hub Explorer and Azure CLI are cross-platform cause they depend on Node and Python runtime.

The above three tools are great and powerful, however, is there an easier way if I just want to add a new device into IoT Hub? What if I wouldn’t like to install anything on my machine?

The answer is Yes.

For MacOS and Linux users, you can use a tool simple called IoT Device I wrote in shell script. The script has only one dependency, OpenSSL, which is pre installed in MacOS and most Linux. That is to say, you download the script, run chmod +x iot-device.sh to make it executable, then call .\iot-device.sh <add/del> <device-id> <iothub account name> <iothubowner primary key>. That’s enough. And when you don’t need it anymore, just delete the script, the script doesn’t leave anything on your machine.

Shell script

For Windows users, or you would better like to use a GUI tool, I also wrote a Chrome extension. Open chrome://extensions/ in your Chrome browser, switch developer mode on (there’s a checkbox on the top right corner of the page), and then click Load unpacked extension button, select the folder you just download.

Chrome developer mode

After the extension is loaded, you can see an Azure IoT icon beside address bar, click it, and a new page should be open.

Chrome extension

After the new device is added into IoT Hub, you can send Device-to-Cloud message or receive Cloud-to-Device message without a real device, a web-based tool is already released, and you can use it in your browser without downloading or installing anything. You can learn more about that tool from my last post, Web-based Azure IoT Hub Developer Tool.

Comments (0)

Skip to main content