Hello!
I'm trying to run mqtt client on my espruino. And have errors all the time. I tried to do it with options:
function mqttRun(){
var server = 'my_broker';
var options = {
keep_alive: 60,
port: my_port,
clean_session: my_port,
username: "my_user",
password: "my_pass",
protocol_name: "MQTT",
protocol_level: 4,
};
var mqtt = require("MQTT").create(server);
mqtt.connect(options);
mqtt.on('connected', function() {
mqtt.subscribe("test");
});
}
and as result got:
Client connected
Uncaught Error: Function "write" not found! at line 1 col 35 ....log("Client connected");a.write(b.mqttConnect(b.client_id))...
^ in function "e" called from line 3 col 353 ..."close")});b.client=a};a?e():a=require("net").connect({host:...
^ in function "connect" called from line 27 col 23 mqtt.connect(options);
^ in function "mqttRun" called from line 1 col 9 mqttRun()
Without options I tried to connect with eclipse sandbox, and it works different:
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hello!
I'm trying to run mqtt client on my espruino. And have errors all the time. I tried to do it with options:
and as result got:
Without options I tried to connect with eclipse sandbox, and it works different:
Could I fix it somehow?