• This is my code:

    var server = "m14.cloudmqtt.com";
     var options = {
        client_id : "random",
        keep_alive: 60,
        port: 35577,
        clean_session: true,
        username: "ciugi**",
        password: "eYV1i*****",
        protocol_name: "MQTT",
        protocol_level: 4,
      };
      var mqtt = require("MQTT").create(server, options);
      mqtt.on('connected', function() {
        mqtt.subscribe("test");
      });
      mqtt.on('publish', function (pub) {
        console.log("topic: "+pub.topic);
        console.log("message: "+pub.message);
      });
    var wifi = require("Wifi");
    function onInit() {
       wifi.stopAP();
       wifi.connect("INGRIFAB", {password: "B73vFeX6se2"}, function(err) {
            if(err)console.log(err);else console.log("connected!");
            console.log(wifi.getIP().ip);
            });
    }
    var server = "m14.cloudmqtt.com";
     var options = {
        client_id : "random",
        keep_alive: 60,
        port: 35577,
        clean_session: true,
        username: "ciugi**",
        password: "eYV1i*****",
        protocol_name: "MQTT",
        protocol_level: 4,
      };
      var mqtt = require("MQTT").create(server, options);
      mqtt.on('connected', function() {
        mqtt.subscribe("test");
      });
      mqtt.on('publish', function (pub) {
        console.log("topic: "+pub.topic);
        console.log("message: "+pub.message);
      });
    var wifi = require("Wifi");
    function onInit() {
       wifi.stopAP();
       wifi.connect("INGRIFAB", {password: "B73vFeX6se2"}, function(err) {
            if(err)console.log(err);else console.log("connected!");
            console.log(wifi.getIP().ip);
            });
    }
    wifi.save();
    save();
    
About

Avatar for Alexander @Alexander started