This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var mqtt = require('mqtt'); | |
| // Don't forget to update accessToken constant with your device access token | |
| const thingsboardHost = "demo.thingsboard.io"; | |
| const accessToken = "YOUR_DEVICE_ACCESS_TOKEN"; | |
| const minTemperature = 17.5, maxTemperature = 30, minHumidity = 12, maxHumidity = 90; | |
| // Initialization of temperature and humidity data with random values | |
| var data = { | |
| temperature: minTemperature + (maxTemperature - minTemperature) * Math.random() , |
NewerOlder