Thank you, Gordon. do you mean put it in order like this?
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.on('connected', function() { mqtt.subscribe("test"); }); mqtt.connect(options); }
I tried now - same error
>mqttRun() Client connected Uncaught Error: Function "write" not found!
What I'm doing wrong? UPD. I saw this subject - http://forum.espruino.com/conversations/293870 example in post #5 and mine shoud do the same, but they don't
@Ickis started
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.
Thank you, Gordon.
do you mean put it in order like this?
I tried now - same error
What I'm doing wrong?
UPD. I saw this subject - http://forum.espruino.com/conversations/293870
example in post #5 and mine shoud do the same, but they don't