This project includes Live Objects Client code samples for the MQTT protocol, written in JavaScript for node.js
Clone this repository from GitHub:
$ git clone https://github.com/Orange-OpenSource/LiveObjects-samples-nodejs.git
- Install NodeJs (https://nodejs.org/en/download/)
- Install samples dependencies (from package.json, example, https://github.com/mqttjs/MQTT.js)
npm install
In order to retrieve data, a valid LoRa device must be provisioned on your account. You should have a valid API-KEY with at least LPWA_USER role.
Open the mqtt-client.js
- Replace the apiKey with yours
- Configure your mqttTopic depending on your needs, subscriptions for all devices PubSub, one specific device PubSub or FIFO
- Run the mqtt-client.js:
node mqtt-client.js
- Run the mqtt-deviceMode.js:
node mqtt-deviceMode.js mqtt://liveobjects.orange-business.com:1883 YourApiKeyValueHere SampleLODemo
- type 'h' to see device help menu or 'q' to disconnect.
Copyright (c) 2015 — 2018 Orange
This code is released under the BSD3 license. See the LICENSE
file for more information.
- Homepage: liveobjects.orange-business.com