Avatar for marcotglb

marcotglb

Member since Dec 2016 • Last active Mar 2017
  • 3 conversations
  • 4 comments

Most recent activity

  • in General
    Avatar for marcotglb

    Hi friends.
    I'm trying to get confidence with Espruino-wifi.

    Here is a very simple program that just HPPT.get to a we server, on every 20 secs.
    I've measured the current adsorbed and it is never below 20mA.
    Of course it peaks to about 90mA when transmitting, but this is not the problem.

    When measuring the board is not connected to USB.
    Power (5V) is supplied on pins GND and VBA.

    I was expecting less that 1 mA when deepSleeping, but, as far as I understand, I'm not able to convince the board to sleep deep enought :-).

    So thanks for your help.
    Marco

    Here is my code.

    function manage() {
      
      //USB.setConsole();
      
      var WIFI_NAME = "tzaziki";
      var WIFI_OPTIONS = {
        password: ""
      };
    
      var wifi = require("EspruinoWiFi");
      var HTTP = require ("http");
     
      setDeepSleep(1);
      wifiConnected = false;
    
      // Need to connect before setIntervan (..) because it will produce a timeout
      wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) {
          if (err) {
            console.log("Connection error: " + err);
          } else {
            console.log("Connected!");
            wifiConnected = true;
          }
        });
      
      
      setInterval(function() {
        console.log ("new cycle ...");
        if (wifiConnected === false)
          {
            console.log ("reconecting to wifi...");
            wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) {
            if (err) {
              console.log("Connection error: " + err);
            } else {
              console.log("Connected!");
              wifiConnected = true;
            } 
          });
        }
    
        HTTP.get("http://192.168.1.121:1880/esprĀ­uino?Temp=24", function(res) {
          res.on('data', function(data) {
            console.log(data);
          });
          res.on('close', function(data) {
            console.log("HTTP got close.");
          });
          res.on('error', function(data) {  // timeout not trapped 
            console.log("HTTP error.");
            wifiConnected = false;
          });
        });
     
        }, 20000);
      
      console.log("deepSleep enabled.");
      setDeepSleep(1);
    }
    
    function onInit() {
      manage();
    }
    save();
    
  • in General
    Avatar for marcotglb

    Hi.
    I'm struggling on trying to find some simple way to connect Espruino-Wifi to other devices (sensors, relays) without (too much) soldering.
    Unfortunately it seems there is no adapter for Arduino or other ecosystems.

    So any suggestion is welcome.
    Thanks
    Marco

    • 6 comments
    • 918 views
  • in Interfacing
    Avatar for marcotglb

    Thanks everybody for you answers.
    Seems that Espruino has a vital community, and sure I'm convinced this is a great project.
    So thanks so much Gordon, I'll try to support.
    About the Espruino-wifi I've just put an order to test it.

    About the docs, well, yes the CC3000 is mentioned quite often in the docs, so I got the impression that it would be to option of choice for 'serious' implementations.

    I'm looking for wifi or 6lowpan solution that could run fed by a battery for at least one year.
    So this is the reason I'm looking for the lowest power hungy wifi chip, that can be easlily put at deep_sleeping.

    Thanks indeed.
    Marco

  • in Interfacing
    Avatar for marcotglb

    Dear Espruino creators.
    TI says that CC3000 is not raccmanded for new design.
    Adafruit is selling ATWINC1500 breakout board as a replacement of the CC3000.
    It seems to be more feature rich and less power hungry (which is crucial for battery operated sensors).

    So is there a chanche to use ATWINC1500 in place of CC3000 breakout board with Espruino ?

    Thanks
    Marco

Actions