esp8266 Save() mqtt problem

Posted on
  • Hey everyone.

    Having some issues with my nodemcu development board. Im afraid it could be a hardware issue (the esp8266 gets really hot).

    Everything works when its freshly sent to the device but as soon as i reconnect the mqtt connection bugs out.


    Compacting Flash...
    Calculating Size...
    CRunning onInit()...
    Connecting to WiFi
    connected? err= null info= {
      "ip": "",
      "netmask": "",
      "gw": "",
      "mac": "ec:fa:bc:07:d5:27"
    MQTT connected

    After reboot

    connected? err= null info= {
      "ip": "",
      "netmask": "",
      "gw": "",
      "mac": "ec:fa:bc:07:d5:27"
    MQTT connected
    MQTT disconnected... reconnecting.
    MQTT connected
    MQTT disconnected... reconnecting.

    Sometimes there is an Memoy error:

    Execution Interrupted during event processing.
    New interpreter error: MEMORY

    Le codes:

    var WIFI_NAME = "Girl Scout Cookies 2,4Ghz";
    var WIFI_KEY = "";
    var MQTT_HOST = "";
    var PATH = "/garden/";
    var DEVICE = "roland";
    var mqtt;
    var wifi;
    // Mqtt Connection 
    function mqttConnect() {
      mqtt = require("MQTT").connect({
        host: MQTT_HOST,
      mqtt.on('connected', function() {
        console.log("MQTT connected");
        // subscribe to wildcard for our name
      mqtt.on('publish', mqttMessage);
      mqtt.on('disconnected', function() {
        console.log("MQTT disconnected... reconnecting.");
        setTimeout(function() {
        }, 1000);
    function mqttMessage(pub) {
      console.log("MQTT=> ",pub.topic,pub.message);
    function onInit(){
    console.log("Connecting to WiFi");
    wifi = require("Wifi");
    wifi.connect(WIFI_NAME, {password:WIFI_KEY}, function(err){
      console.log("connected? err=", err, "info=", wifi.getIP());

    I have tried different firmwares both 1.95 and 1.96
    No diff.

    Any thoughts?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

esp8266 Save() mqtt problem

Posted by Avatar for Gustav @Gustav