Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WiFi: ARP gratuitous API for wifi station mode#6889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
d-a-v merged 20 commits intoesp8266:masterfromd-a-v:gratuitous
Apr 9, 2020

Conversation

@d-a-v
Copy link
Collaborator

Based on multiple reports and examples

fixes#6886
fixes#5998 (together with#6484, hopefully)

ascillato and marrold reacted with thumbs up emoji
@d-a-vd-a-v mentioned this pull requestDec 7, 2019
6 tasks
@TD-er
Copy link
Contributor

Just looking at the code and I think this is probably not optimal to use.

boolESP8266WiFiSTAClass::stationKeepAliveEnabled (){return _keepStationAliveUs !=0;}voidESP8266WiFiSTAClass::stationKeepAliveStop (){    _keepStationAliveUs = -1;// will be set to 0 at recurrent call}boolESP8266WiFiSTAClass::stationKeepAliveSetupMs (int ms){if (_keepStationAliveUs !=0 || ms <=0)returnfalse;[...]

So on other words, you can only change the value by calling stop and then wait for the next scheduled interval before you can even set a new value.
Worst case scenario is to wait for as long as the previous set interval.
It would make sense to set the interval to anything > 0 and if you want to stop it, call the stop function.
Now you just have to poll as long as you receive false to set a new interval.

Also I do miss to send (or restart the scheduler) when a wifi connection to the AP is established.
That's the most important one to send these ARP packets. If it was set to for example 10 seconds and you make a connection right after the scheduler tried sending these ARP packets, you may be unable to make a connection to another host, for about 10 seconds after successful wifi connection was established.

@d-a-v
Copy link
CollaboratorAuthor

@TD-er please review the API change

@d-a-v
Copy link
CollaboratorAuthor

@TD-er the API has changed, based on your use case. Setting the interval will:

  • cancel everything that was planned
  • immediately send a packet
  • schedule the next ones based on the new interval

@marrold
Copy link

Novice question, is there a simple way I can test this branch in platformio?

@d-a-v
Copy link
CollaboratorAuthor

If you are using git for this repository in your platformIO setup, then yes.
You first need to checkout this PR (help with this) then rebuild using PIO.

@d-a-vd-a-v mentioned this pull requestMar 5, 2020
6 tasks
@Jason2866
Copy link
Contributor

Sorry for replying sooo late. We had no equipment until now to reproduce the issue (of not beeing reachable via http after a while) in our wifi setups. Since a few days i have a OpenWRT AP which has this issue...
@s-hadinger implemented your changes as backport in a Tasmota test versionhttps://github.com/s-hadinger/Tasmota/tree/arp_dev
Using this version (which sends every minute Gratiuitous ARP) device keeps beeing reachable.
The issue is solved (at least for OpenWRT)

It would be great if you merge this PR that all users can benefit from this option to solve issues
of devices not reachable because ARP seems to get lost if no Gratiuitous ARP is done.

d-a-v and marrold reacted with thumbs up emoji

@s-hadinger
Copy link
Contributor

I confirm this feature is useful with some wifi routers. I ported this feature in Tasmota, and it would be great for it to be integrated natively in Arduino Core. Some other projects might benefit from it.

d-a-v reacted with thumbs up emoji

@d-a-vd-a-v added this to the2.7.0 milestoneApr 7, 2020
@d-a-vd-a-v closed thisApr 7, 2020
@d-a-vd-a-v deleted the gratuitous branchApril 7, 2020 21:14
@devytedevyte self-assigned thisApr 8, 2020
@d-a-vd-a-v restored the gratuitous branchApril 8, 2020 10:21
@d-a-vd-a-v self-assigned thisApr 8, 2020
@d-a-vd-a-v reopened thisApr 8, 2020
@d-a-v
Copy link
CollaboratorAuthor

Per internal review comment:

  • use a Ticker, but with adding a new ticker method using recurrent scheduled function once so:
    when tick is fired, function is executed once at nextyield() (instead of at nextloop())
    This is needed to keep regularity the most we can in cont space.
  • move to a newexperimental::ESP8266WiFiGratuitous class

@d-a-v
Copy link
CollaboratorAuthor

@ivankravets@platformio I need help withthis issue:

Following change does not help (because in that case arduino does not compileTicker.cpp):

-#include <Ticker.h>+#include "../../Ticker/src/Ticker.h" // instead of <Ticker.h> (platformio can't find it otherwise)

ThisTicker is ours and does not appear inhttps://platformio.org/lib/search?query=header:Ticker.h .
This is a case where a local library uses another local library.
This isnot a problem with arduino.

@d-a-v
Copy link
CollaboratorAuthor

Moving#include <Ticker.h> from.cpp to.h didn't help

@valeros
Copy link
Contributor

Hi@d-a-v ! Looks like these changes are going to affect a lot of PlatformIO users sinceLibrary Dependency Finder in default mode doesn't look for dependencies in source files. Probably an optimal solution would be to adddepends field to thelibrary.properties file forESP8266WiFi library, e.g.:

name=ESP8266WiFiversion=1.0author=Ivan Grokhotkovmaintainer=Ivan Grokhtkov <ivan@esp8266.com>sentence=Enables network connection (local and Internet) using the ESP8266 built-in WiFi.paragraph=With this library you can instantiate Servers, Clients and send/receive UDP packets through WiFi. The shield can connect either to open or encrypted networks (WEP, WPA). The IP address can be assigned statically or through a DHCP. The library can also manage DNS.category=Communicationurl=architectures=esp8266dot_a_linkage=truedepends=Ticker

@s-hadinger
Copy link
Contributor

What about just leaving thestationKeepAliveNow () function and leaving the timer on the client side? In Tasmota that's easy to add a timer for that, and it would avoid bringing yet another library to projects that don't need it.

@d-a-v
Copy link
CollaboratorAuthor

@valeros good idea but as@s-hadinger says, it may include Ticker for nothing if gratuitous is not used (unless it is moved in a separate directory ?).
Well, I chose to short-circuit the library and use the core api instead.

@d-a-vd-a-v merged commitbc170e6 intoesp8266:masterApr 9, 2020
@d-a-vd-a-v deleted the gratuitous branchAugust 9, 2020 17:51
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@devytedevyteAwaiting requested review from devyte

1 more reviewer

@TD-erTD-erTD-er left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

@d-a-vd-a-v

@devytedevyte

Labels

None yet

Projects

None yet

Milestone

2.7.0

Development

Successfully merging this pull request may close these issues.

ESP8266 Doesn't respond to ARP requests WiFi dropouts unless using WiFi.setSleepMode(WIFI_NONE_SLEEP)

7 participants

@d-a-v@TD-er@marrold@Jason2866@s-hadinger@valeros@devyte

[8]ページ先頭

©2009-2025 Movatter.jp