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
// Requires node.js and mqtt library installed. | |
var mqtt = require('mqtt'); | |
var os = require("os"); | |
const thingsboardHost = "SERVERNAME"; | |
// Reads the access token from arguments | |
const accessToken = 'ACCESS_TOKEN'; | |
// Default topics. See http://thingsboard.io/docs/reference/mqtt-api/ for more details. | |
const attributesTopic = 'v1/devices/me/attributes'; |
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
<VirtualHost *:443> | |
ServerAdmin "EMAIL ADMIN" | |
DocumentRoot /var/www/html | |
ServerName "SERVERNAME" | |
ProxyRequests off | |
ProxyPreserveHost On | |
#Redireccion de wss a ws | |
RewriteEngine on | |
RewriteCond %{HTTP:Upgrade} websocket [NC] |
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
uint8_t rgb2H(uint8_t red, uint8_t green, uint8_t blue){ | |
float r = red/255. , g=green/255. , b=blue/255.; | |
float cMax = max(max(r, g), b); | |
float cMin = min(min(r, g), b); | |
float delta = cMax - cMin; | |
float h = 0; | |
if(delta > 0) { | |
if(cMax == r) { | |
h = 60 * (fmod(((g - b) / delta), 6)); |