Code Monkey home page Code Monkey logo

Comments (6)

sandeepmistry avatar sandeepmistry commented on July 1, 2024

Hi @jhnet,

I've created pull request #100 do this, please try it out, and provide your feedback.

With it WiFi.end() should have the behaviour you expect.

from wifi101.

sandeepmistry avatar sandeepmistry commented on July 1, 2024

Closed via #100.

from wifi101.

jhnet avatar jhnet commented on July 1, 2024

Hi @sandeepmistry ,

sorry for the late reply, I had no time to test that until now. The problem is, that the power consumption does not fall after using WiFi.end(). I used this small test sketch:

#include <SPI.h>
#include <WiFi101.h>

char ssid[] = "ssid";     //  your network SSID (name)
char pass[] = "pass";  // your network password
int status = WL_IDLE_STATUS;     // the Wifi radio's status

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
}
int incoming = 0;
void loop() {
  if (Serial.available() > 0) {
    incoming = Serial.read();
    if (incoming == '1') {
      Serial.println("WLAN ON");
      status = WiFi.begin(ssid, pass);
      delay(10000);
      Serial.println(status);
      Serial.flush();
    }
    else if (incoming == '0') {
      Serial.println("WLAN OFF");
      WiFi.end();
      delay(10000);
      status = WiFi.status();
      Serial.println(status);
      Serial.flush();
    }
  }
}

After reset the MKR1000 draws about 10-12mA. When I enable the WiFi by sending a 1 it goes up to ~95-100mA. Disabling the WiFi by sending a 0 lower the power consumption a bit, but only down to ~60mA.

from wifi101.

sandeepmistry avatar sandeepmistry commented on July 1, 2024

@jhnet can you try the version of the code from Github master, I believe it fixes this issue.

from wifi101.

jhnet avatar jhnet commented on July 1, 2024

Hey, I just did a quick test with the same sketch as above. Power consumption drops down to ~12mA for a short while. After a few seconds (around 10s) it rises again and stays at ~27-30mA until you switch WiFi On and Off again.

from wifi101.

sandeepmistry avatar sandeepmistry commented on July 1, 2024

@jhnet can you please try are removing the call to status = WiFi.status(); in the sketch?

Calling this will actually re-initialize the WINC1500.

from wifi101.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.