Hi, am struggling to get MQTT working on ESP8266. I have numerous actual Espruinos (eg Espruino Wifi), and this code runs fine:
const mqtt = require("tinyMQTT").create('.... url of local hivemq server ...'); mqtt.on('error', function(err){console.log(err)}) mqtt.on('connected', function(){console.log('connected')}) var wifi = require("Wifi"); wifi.connect("...", {password:"...."}, function(){ console.log("wifi connected"); mqtt.connect(); }); wifi.stopAP();
Am able to connect to the MQTT server fine with a real Espruino, but with ESP8266 I get nothing, not even an error.
This happens with the official MQTT library and tinyMQTT - work fine on Espruino WiFi, fails on ESP8266.
Question: how to debug this and figure out what's wrong?
David
@DavidM 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.
Hi, am struggling to get MQTT working on ESP8266.
I have numerous actual Espruinos (eg Espruino Wifi), and this code runs fine:
Am able to connect to the MQTT server fine with a real Espruino, but with ESP8266 I get nothing, not even an error.
This happens with the official MQTT library and tinyMQTT - work fine on Espruino WiFi, fails on ESP8266.
Question: how to debug this and figure out what's wrong?
David