• What do you mean by 'stand alone mode'? You mean that you have saved the code?

    Your problem could be that commands that you issue on the console (like connect()) are done when you enter them - not when Espruino powers up. To fix that, you need to put the code you need to run at startup in a function called onInit:

    var http = require("http");
    var wlan;
    
    function onInit() {
      console.log("START!!!");
      LED3.write(true);
      wlan = require("CC3000").connect();
      var h = wlan.connect( "xxxxxx", "yyyyyyy", function (s) { 
        if (s=="dhcp") {
          require("http").get("http://192.168.100.100:3000/sample_requests", function(res) {
            LED2.write(true);
            res.on('data', function(data) {
              console.log(">" + data);
            });
         });
         }
      });
    }
    
    onInit();
    

    Now, when you save, the next time Espruino starts onInit is called and the CC3000 connects.

    One other thing that could be an issue is that if you have Espruino powered from a computer, the computer connects to it via USB but stops reading data after a few characters have been sent. This means that if you're using print/console.log then after a while Espruino will stop working as it's waiting for the computer to read the data it's printing. If you either run a terminal app, or connect Espruino to a USB power supply, it'll be fine though.

About

Avatar for Gordon @Gordon started