Comments (6)
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.
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.
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.
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 connectedWL_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.
good job dude :)
i will check and share if any issues
from wifi101.
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)
- bitwise and operator used on sequential enum values HOT 3
- Green LED does not light when connecting using static IP on board rev b
- Compiler warning about buffer overflow in firmwareVersion() HOT 1
- 'if' statement at WifiClient.cpp:149 is useless HOT 1
- Wifi101 doesn't work once add the freeRTOS library HOT 3
- AP mode with WPA
- Modernize CI system
- HTTPS to sites using LetsEncrypt certificates with MKR1000 fails HOT 1
- Progressively slower transmission and potential buffer handling issue. HOT 5
- AP SSID goes back to default wifi101-xxxx after re-entering provision mode
- Add GitHub Actions workflow to synchronise with shared repository labels
- WiFi.ping(ip) freezes mkr1000 if WiFiUdp.h included
- Infinite stall on WiFiWebServer sample / MKR 1000 HOT 1
- WiFiServer simple improvements
- WiFi.hostname("MKR1000") function has no effects
- Multiple compilation problems on ESP8266 HOT 4
- Library does not work with WINC1500 and Mega2560 HOT 9
- Adafruit Feather M0 WiFi with uFL - ATSAMD21 + ATWINC1500 - fw 19.4.4
- Tx Power Mode
- Turn on WiFi hardware once turned off with WiFi.end()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wifi101.