Avatar for Planer

Planer

Member since Feb 2017 • Last active Apr 2017
  • 1 conversations
  • 3 comments

Most recent activity

  • in ESP8266
    Avatar for Planer

    Hi to masters! I have trouble whith esp8266 12F FW1.91 espruino.
    I send code to espruino. Code working well without errors. But if i do save(), i got error:
    Too big to save to flash (13624 vs 12284 bytes)
    Delete command history and try again...

    (While: process.memory() = {"free": 908, "usage": 792, "total": 1700, "history": 441})
    Enabled minification in ide setup is not helpful.

    I use simple mqtt client sample from original documentation espruino.com/MQTT

    What i do invalid? Why is not free space? How to resolve this problem?
    Help please!

    My code:

    var server = "m13.cloudmqtt.com";
    var options = {
        client_id : "test_machine",
        keep_alive: 60,
        port: 12345,
        clean_session: true,
        username: "user",
        password: "pass",
        protocol_name: "MQTT",
        protocol_level: 4,
      };
    var mqtt = require("MQTT").create(server, options /*optional*/);
    mqtt.connect();
    mqtt.on('connected', function() {
      mqtt.subscribe("test");
    });
    mqtt.on('publish', function (pub) {
      console.log("topic: "+pub.topic);
      console.log("message: "+pub.message);
    });
    var topic = "test";
    var message = 1;
    setInterval('mqtt.publish(topic, message++);', 2000);
    
  • in ESP8266
    Avatar for Planer

    Hi to everyone! I have trouble whith esp8266 12F FW1.91 espruino.
    I send code to espruino. Code working well without errors. But if i do save(), i got error:
    Too big to save to flash (13624 vs 12284 bytes)
    Delete command history and try again...

    (While: process.memory() = {"free": 908, "usage": 792, "total": 1700, "history": 441})
    Enabled minification in ide setup is not helpful.

    I use simple mqtt client sample from original documentation espruino.com/MQTT

    What i do invalid? Why is not free space? How to resolve this problem?
    Help please!

    My code:

    var server = "m13.cloudmqtt.com";
    var options = {
        client_id : "test_machine",
        keep_alive: 60,
        port: 12345,
        clean_session: true,
        username: "user",
        password: "pass",
        protocol_name: "MQTT",
        protocol_level: 4,
      };
    var mqtt = require("MQTT").create(server, options /*optional*/);
    
    mqtt.connect();
    
    mqtt.on('connected', function() {
      mqtt.subscribe("test");
    });
    
    mqtt.on('publish', function (pub) {
      console.log("topic: "+pub.topic);
      console.log("message: "+pub.message);
    });
    
    var topic = "test";
    var message = 1;
    setInterval('mqtt.publish(topic, message++);', 2000);
    
  • in ESP8266
    Avatar for Planer

    HI Everyone. Realy working code after save() and power restart ESP8266-12F FW1.91, 1.6 boot.

    function onPageRequest(req, res) {
     res.writeHead(200, {'Content-Type':'text/html'});
     res.write('Hello Bro');
     res.end('');
    }
    
    var wifi = require("Wifi");
    
    function startServer(){
       console.log("server started");
       require("http").createServer(onPageReque­st).listen(8080);
       console.log("APIp="+wifi.getAPIP().ip);
       console.log("StationIP="+wifi.getIP().ip­);
    }
    
     wifi.on('connected', startServer);
    
    
Actions