azure-iot-device-amqp-ws
Communicate with Azure IoT Hub from any device using AMQP over WebSockets.
Install
npm install -g azure-iot-device-amqp-ws@latest
to get the latest (pre-release) version.
Getting Started
Create a device client:
var clientFromConnectionString = clientFromConnectionString;var Message = Message; var connectionString = '[IoT Hub device connection string]'; var client = ;
Create a callback that sends a message and receives messages. When it receives a message it sends an acknowledgement receipt to the server:
var { if err console; else console; var message = 'some data from my device'; client; client; };
Open the connection and invoke the callback:
client;