Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

OpenAmbientIoT/wiliot-mqtt-demo-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample App to demonstrate working of MQTT Connection for Wiliot

Github Repo

https://github.com/vyshakhbabji/wiliot-developer-docs/tree/master/demos/wiliot-demo-mqtt-nodejs

Overview

This sample app demonstrates how to use Wiliot MQTT connection to receive events from Wiliot Cloud Platform.

Prerequisites

Setup

  1. Clone this repository to your local machine.

  2. Change directory to demos/wiliot-demo-mqtt-nodejs

$ cd demos/wiliot-demo-mqtt-nodejs
  1. Run the following command to install the dependencies:
$ npm install
  1. Configure .env file with your HiveMQ MQTT configuration credentials. Please follow the guide hiveForMQTTUrl.md
4. Run the following command to start the app:

```bash
$ npm start
  1. When you test the MQTT on Wiliot's management portal, you should see the events as output in the terminal:
vyshakhbabji@Vyshakhs-Mini wiliot-demo-mqtt-nodejs % npm start

> node-mqtt@1.0.0 start
> node index.js

Connected
Received message: 7B022D35-7373-489D-8503-C4266BFA7E32 {"eventName":"connectivity","value":"0","startTime":"1676000191728","endTime":"0","ownerId":"607737204301","createdOn":"1676000191986","assetId":"7B022D35-7373-489D-8503-C4266BFA7E32","categoryID":"12","confidence":"1.00","keySet":"[(key:connectivity,value:0)]"}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published