matrix json
This commit is contained in:
10
src/index.js
10
src/index.js
@@ -5,7 +5,7 @@ const SocketIO = require("socket.io");
|
||||
var mqtt = require('mqtt')
|
||||
var client = mqtt.connect('mqtt://192.168.1.105',{username:'mdchaparror',password:'un80187452'})
|
||||
|
||||
app.set("port", 6000);
|
||||
app.set("port", 3000);
|
||||
app.use(express.static(path.join(__dirname, "public")));
|
||||
console.log(__dirname);
|
||||
|
||||
@@ -23,5 +23,13 @@ io.on("connection", (socket) => {
|
||||
client.publish('matrix/rgb',mensaje.color_rgb);
|
||||
console.log("mensaje MQTT =>",mensaje)
|
||||
});
|
||||
|
||||
socket.on("mensaje2", (mensaje) => {
|
||||
client.publish('matrix/full',mensaje);
|
||||
console.log("mensaje2 MQTT =>",mensaje)
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user