Code Monkey home page Code Monkey logo

Comments (6)

sandeepmistry avatar sandeepmistry commented on July 19, 2024

Hi @zeesh1979,

Thanks for bringing this up. In AP mode WiFi.status() currently always returns WL_CONNECTED. I think we need to add another state to the wl_status_t enum. Let me think about this and come back with a proposal.

from wifi101.

zeesh1979 avatar zeesh1979 commented on July 19, 2024

Thanks dear. I also checked in client mode where mkr1000 is connecting as client to my android phone which is acting as hotspot. I get same behavior

Get Outlook for Android

On Tue, Jul 26, 2016 at 3:54 PM +0300, "Sandeep Mistry" [email protected] wrote:

Hi @zeesh1979,

Thanks for bringing this up. In AP mode WiFi.status() currently always returns WL_CONNECTED. I think we need to add another state to the wl_status_t enum. Let me think about this and come back with a proposal.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#82 (comment)

from wifi101.

zeesh1979 avatar zeesh1979 commented on July 19, 2024

since yesterday i was working on this and tried some way out. just now i solved my problem and thought to share with you and public.
Accidentally, I noticed that RSSI value changes with WiFi status. if wifi is connected then RSSI is around -100dbm and in connected state it is -40dbm. so i put a threshold of -60dbm for testing purpose and it solved 1st issue :)
for 2nd issue, it is solved too and i am able to detect client connectivity as well :)
below is the code. this may help you enhance the wifi101 library as well.

void loop() {
WiFiClient client = server.available();
if (WiFi.RSSI() >= -60){ //WiFi is connected or within range
if (client) { //server ready
if (client.connected()) { //client connected
if (client.available()) { //client sent data
Serial.print("data: ");
Serial.println(client.read());
delay(1000);
}
}
}
else if (!client){ //server not ready
Serial.println("waiting for client...");
client.stop();
}
}
else if (WiFi.RSSI() <= -60){ //WiFi is disconnected or out of range
Serial.println("waiting for WiFi...");
client.stop();
server.begin();
}
}

from wifi101.

sandeepmistry avatar sandeepmistry commented on July 19, 2024

Hi @zeesh1979,

I've submitted pull request #85 for a nicer way to use WiFi.status() to determine if a device is connected or disconnected to the AP. The new return values are:

  • WL_AP_LISTENING: AP is listening, no devices connected
  • WL_AP_CONNECTED: a device is connected to the AP

Please see the following sketch for a full example of sketch of intended usage: https://github.com/sandeepmistry/WiFi101/blob/ap-status/examples/AP_SimpleWebServer/AP_SimpleWebServer.ino

from wifi101.

zeesh1979 avatar zeesh1979 commented on July 19, 2024

good job dude :)
i will check and share if any issues

from wifi101.

zeesh1979 avatar zeesh1979 commented on July 19, 2024

Hi,I replaced my complete folder of wifi101 with your updated one. when i run the AP example, it says : Not used: C:\Program Files (x86)\Arduino\libraries\WiFi101exit status 1'WL_AP_LISTENING' was not declared in this scope
i checked my .cpp and .h files and definitions are ok. i thought there is conflict with another library WIFI which i deleted but still same issue (restarted IDE many times)
Date: Wed, 27 Jul 2016 09:31:58 -0700
From: [email protected]
To: [email protected]
CC: [email protected]; [email protected]
Subject: Re: [arduino-libraries/WiFi101] MKR1000 wifi.status() not updating in AP mode (#82)

Hi @zeesh1979,

I've submitted pull request #85 for a nicer way to use WiFi.status() to determine if a device is connected or disconnected to the AP. The new return values are:

WL_AP_LISTENING: AP is listening, no devices connected

WL_AP_CONNECTED: a device is connected to the AP

Please see the following sketch for a full example of sketch of intended usage: https://github.com/sandeepmistry/WiFi101/blob/ap-status/examples/AP_SimpleWebServer/AP_SimpleWebServer.ino


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

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.