How to subscribe to a MQTT topic #5910
Replies: 1 comment
-
Posted at 2017-11-20 by Alexander This is a subscription to the topic :) Learn English!:) Posted at 2017-11-20 by @gfwilliams
Also, I've tended to put a leading slash on all the topics I use (eg If you want anything beginning with Posted at 2017-11-20 by Alexander Is it possible to make a secure connection SSL or TLS? Posted at 2017-11-20 by @gfwilliams Yes - if you buy an Espruino WiFi board, or potentially an ESP32. It isn't possible with the ESP8266 since it doesn't have enough RAM to handle TLS as well as Espruino |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-11-20 by Alexander
How to subscribe to a MQTT topic?
ESP sends messages, but does not accept.
code:
var server = "m14.cloudmqtt.com";
var options = {
client_id : "random",
keep_alive: 60,
clean_session: true,
port: 15577,
username: "ciugiy**",
password: "eYV1ivUWk***",
protocol_name: "MQTT",
protocol_level: 4,
};
var mqtt = require("MQTT").create(server, options);
var wifi = require("Wifi");
function onInit() {
wifi.stopAP();
wifi.connect("INGRI", {password: "3hotswf3"}, function(err) { // 192.168.83.196//
//wifi.connect("AndroidAP", {password: "tssu7350"}, function(err) { // 192.168.83.196//
if(err)console.log(err);else console.log("connected!");
console.log(wifi.getIP().ip);
}
wifi.save();
save();
Beta Was this translation helpful? Give feedback.
All reactions