Particle Azure Integration

I have successfully integrated my sensor data from Particle cloud to Azure IoT Hub via Stream Analytics Job. When Analytic job is running, data is transferred to a SqlServer without any problems. Here are my questions:
1- When I publish sensor data, why particle.publish returns true even when I stop the Azure Analytic job? What is the remedy for it? I need to know this so I can temporarily queue messages for resend.

2- How can I send Azure-to-Device messages? This is needed to respond to a device alarms in almost real-time.

Because the publish only checks if it made it to the Particle Cloud. Whatever you do with it next is up to you. As far as the publish is concerned, it delivered the message.

1 Like

Just use MQTT in the Azure IoT hub: Use MQTT to communicate with Azure IoT Hub - Azure IoT Hub | Microsoft Learn. You can learn from this tutorial if you've not used MQTT before MQTT Publish-Subscribe Using RPi, ESP and Photon - Hackster.io but just keep in mind that Azure IoT hub is your Broker?

The return value of Particle.publish() does not even do that (if not called with the WITH_ACK flag).
A true only means that the publish request was handed to the radio module successfully, but not whether it has made it into the cloud or not.

1 Like