Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boly38/lo-mqtt-nodejs
Live Objects NodeJS MQTT client
https://github.com/boly38/lo-mqtt-nodejs
command config data-messages firmware-update geolocation liveobjects mqtt test
Last synced: 23 days ago
JSON representation
Live Objects NodeJS MQTT client
- Host: GitHub
- URL: https://github.com/boly38/lo-mqtt-nodejs
- Owner: boly38
- Created: 2024-03-08T14:21:01.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-08T19:09:30.000Z (2 months ago)
- Last Synced: 2024-10-05T06:31:23.496Z (about 1 month ago)
- Topics: command, config, data-messages, firmware-update, geolocation, liveobjects, mqtt, test
- Language: JavaScript
- Homepage:
- Size: 140 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
Awesome Lists containing this project
README
# lo-mqtt-nodejs - Live Objects MQTT Client
[![scheduled npm audit](https://github.com/boly38/lo-mqtt-nodejs/actions/workflows/audit.yml/badge.svg)](https://github.com/boly38/lo-mqtt-nodejs/actions/workflows/audit.yml)This project includes **Live Objects Client code samples for the MQTT protocol**.
- LiveObjects [official help](https://liveobjects.orange-business.com/#/cms/documentation-faq) includes [a dev. guide mqtt section](https://liveobjects.orange-business.com/doc/html/lo_manual_v2.html#MQTT_API)
- Samples are written in JavaScript for node.js.
- Samples require minimal common environment described in "Quick start" below.## Quick start
### Download
Clone this repository from GitHub:
````bash
$ git clone https://github.com/boly38/lo-mqtt-nodejs.git
````### Prerequisites
1. Install NodeJs (https://nodejs.org/en/download/)
2. Install samples dependencies (from package.json, example, https://github.com/mqttjs/MQTT.js)
````bash
npm install
````### Setup your own private environment
- copy the template in a private file
````bash
cp .env.template .env.dontpush.myEnv1
cp .env.template .env.dontpush.myEnv2
````
- edit `.env.dontpush.myEnv1`
- application rely on `.env` file
````bash
cp .env.dontpush.myEnv1 .env
````
### Start lo-device
[lo-device](./src/device-mode/lo-device.js) - a mqtt client using `device mode`.
This client is able to :
- connect, disconnect, forceReconnect.
and via features:
- receive and handle command, process firmware updates, process config update.
- publish current config/resource, send data messages.The client "controller" asks to the user the order via terminal and input.
Controller features:
- geolocation: generates X devices from given square : ex. `europe`, `france`, `lyon`.To start the client:
```bash
node ./src/device-mode/lo-device.js
```Then use `h` to display help.