How to use the Particle Photon with the Microsoft Azure IoT Hub

How to use the Particle Photon with the Microsoft Azure IoT Hub

I use the Particle Photon devices a lot in prototype project. It’s a small WiFi board (like the ESP 8X series).

photon_vector2_600

I used several libraries on the particle cloud to use the Azure IoT hub. These libraries were build based on the Azure IoT SDK. But since several weeks Particle released an Azure IoT Connector on the Particle cloud. It’s still a beta function. But as a user you can send the data from the Particle Photon to the Particle Cloud. When the data has a specific name, the Particle Cloud will sent this data to the Azure IoT Hub.

Take the following steps to get this working.

1. Login to the Particle Cloud

2. Click on the integration button (the latest button) and select ‘New Integration’

particlecloudazureiothub.png

3. Select the Azure IoT Hub

selectazureiothub

4. Configure the settings of your hub

saveandonctinuazureiothub.png

5. Save and continu and the Particle Cloud is connected to the Microsoft Azure IoT Hub. Now you can create your code on the Particle Photon to sent data to the Azure IoT Hub.

Below the example you can add in your Particle Photon device.

      
void loop() {
  // Get some data
  String data = String(10);
  // Trigger the integration
  Particle.publish("datafield", data, PRIVATE);
  // Wait 60 seconds
  delay(60000);
}

Run the code and the messages will flow from the Particle Cloud:

dataflow

and then to the Microsoft Azure IoT Hub! How simple is this!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s