Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smacken/node-prehubclient
PreHub client for node
https://github.com/smacken/node-prehubclient
iot mqtt mqtt-client
Last synced: 16 days ago
JSON representation
PreHub client for node
- Host: GitHub
- URL: https://github.com/smacken/node-prehubclient
- Owner: smacken
- Created: 2020-04-18T00:14:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-02T17:15:17.000Z (over 3 years ago)
- Last Synced: 2024-10-19T02:38:12.044Z (20 days ago)
- Topics: iot, mqtt, mqtt-client
- Language: TypeScript
- Size: 183 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mqtt Prehub Client
> Mqtt Prehub javascript/node clientConnect to a mqtt broker with a prehub operating for device provisioning.
```typescript
const builder = new PreHubClientBuilder().host('localhost').port(1833);
const device: IDevice = {
id: Guid.newGuid(),
name: 'Barcode scanner #1',
activity: Activity.Scan
};
const prehub = new PreHubClient(builder, device);
prehub.connect();
prehub.register();
```## Installation
```shell
npm install node-prehubclient
```## Setup
1. Connect to Mqtt Broker with the Prehub operating.
```typescript
const builder = new PreHubClientBuilder().host('localhost').port(1833);
```
2. Configure the device the client is running as.
```typescript
const device: IDevice = {
id: Guid.newGuid(),
name: 'Barcode scanner #1',
activity: Activity.Scan
};
```
3. Connect to the Mqtt broker through the Prehub client.
4. Register the device with the Prehub for provisioning.
Once registered, the device will be configured from the prehub. This will include activation/deactivation,
any configuration of the device/payload, Device metadata etc.