arduino-libraries / WiFiNINA

136 stars 105 forks source link

Add non blocking WiFi.connect() method #264

Closed hasenradball closed 6 months ago

hasenradball commented 8 months ago

why to update/benefits

With this approach we introduce the methods connect which is an non blocking wifi connect method

Now we can start the wifi connection without blocking..

Changes in methods

tested on

Arduino Nano 33 IOT

CLAassistant commented 8 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: hasenradball
:x: cmaglie
You have signed the CLA already but the status is still pending? Let us recheck it.

github-actions[bot] commented 8 months ago

Memory usage change @ 494c0f7d793fde422a075334fc6ac7e9c4e745f4

Board flash % RAM for global variables %
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018:mode=on 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table Board|`examples/AP_SimpleWebServer`
flash|%|`examples/AP_SimpleWebServer`
RAM for global variables|%|`examples/ConnectNoEncryption`
flash|%|`examples/ConnectNoEncryption`
RAM for global variables|%|`examples/ConnectWifi_waitForConnectResult`
flash|%|`examples/ConnectWifi_waitForConnectResult`
RAM for global variables|%|`examples/ConnectWithWEP`
flash|%|`examples/ConnectWithWEP`
RAM for global variables|%|`examples/ConnectWithWPA`
flash|%|`examples/ConnectWithWPA`
RAM for global variables|%|`examples/ConnectWithWPA2Enterprise`
flash|%|`examples/ConnectWithWPA2Enterprise`
RAM for global variables|%|`examples/ScanNetworks`
flash|%|`examples/ScanNetworks`
RAM for global variables|%|`examples/ScanNetworksAdvanced`
flash|%|`examples/ScanNetworksAdvanced`
RAM for global variables|%|`examples/SimpleWebServerWiFi`
flash|%|`examples/SimpleWebServerWiFi`
RAM for global variables|%|`examples/Tools/CheckFirmwareVersion`
flash|%|`examples/Tools/CheckFirmwareVersion`
RAM for global variables|%|`examples/Tools/FirmwareUpdater`
flash|%|`examples/Tools/FirmwareUpdater`
RAM for global variables|%|`examples/Tools/SerialNINAPassthrough`
flash|%|`examples/Tools/SerialNINAPassthrough`
RAM for global variables|%|`examples/WiFiChatServer`
flash|%|`examples/WiFiChatServer`
RAM for global variables|%|`examples/WiFiPing`
flash|%|`examples/WiFiPing`
RAM for global variables|%|`examples/WiFiSSLClient`
flash|%|`examples/WiFiSSLClient`
RAM for global variables|%|`examples/WiFiStorage`
flash|%|`examples/WiFiStorage`
RAM for global variables|%|`examples/WiFiUdpNtpClient`
flash|%|`examples/WiFiUdpNtpClient`
RAM for global variables|%|`examples/WiFiUdpSendReceiveString`
flash|%|`examples/WiFiUdpSendReceiveString`
RAM for global variables|%|`examples/WiFiWebClient`
flash|%|`examples/WiFiWebClient`
RAM for global variables|%|`examples/WiFiWebClientRepeating`
flash|%|`examples/WiFiWebClientRepeating`
RAM for global variables|%|`examples/WiFiWebServer`
flash|%|`examples/WiFiWebServer`
RAM for global variables|% -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|- `arduino:mbed_nano:nanorp2040connect`|0|0.0|0|0.0|0|0.0|0|0.0|N/A|N/A|N/A|N/A|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|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0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0
Click for full report CSV ``` Board,examples/AP_SimpleWebServer
flash,%,examples/AP_SimpleWebServer
RAM for global variables,%,examples/ConnectNoEncryption
flash,%,examples/ConnectNoEncryption
RAM for global variables,%,examples/ConnectWifi_waitForConnectResult
flash,%,examples/ConnectWifi_waitForConnectResult
RAM for global variables,%,examples/ConnectWithWEP
flash,%,examples/ConnectWithWEP
RAM for global variables,%,examples/ConnectWithWPA
flash,%,examples/ConnectWithWPA
RAM for global variables,%,examples/ConnectWithWPA2Enterprise
flash,%,examples/ConnectWithWPA2Enterprise
RAM for global variables,%,examples/ScanNetworks
flash,%,examples/ScanNetworks
RAM for global variables,%,examples/ScanNetworksAdvanced
flash,%,examples/ScanNetworksAdvanced
RAM for global variables,%,examples/SimpleWebServerWiFi
flash,%,examples/SimpleWebServerWiFi
RAM for global variables,%,examples/Tools/CheckFirmwareVersion
flash,%,examples/Tools/CheckFirmwareVersion
RAM for global variables,%,examples/Tools/FirmwareUpdater
flash,%,examples/Tools/FirmwareUpdater
RAM for global variables,%,examples/Tools/SerialNINAPassthrough
flash,%,examples/Tools/SerialNINAPassthrough
RAM for global variables,%,examples/WiFiChatServer
flash,%,examples/WiFiChatServer
RAM for global variables,%,examples/WiFiPing
flash,%,examples/WiFiPing
RAM for global variables,%,examples/WiFiSSLClient
flash,%,examples/WiFiSSLClient
RAM for global variables,%,examples/WiFiStorage
flash,%,examples/WiFiStorage
RAM for global variables,%,examples/WiFiUdpNtpClient
flash,%,examples/WiFiUdpNtpClient
RAM for global variables,%,examples/WiFiUdpSendReceiveString
flash,%,examples/WiFiUdpSendReceiveString
RAM for global variables,%,examples/WiFiWebClient
flash,%,examples/WiFiWebClient
RAM for global variables,%,examples/WiFiWebClientRepeating
flash,%,examples/WiFiWebClientRepeating
RAM for global variables,%,examples/WiFiWebServer
flash,%,examples/WiFiWebServer
RAM for global variables,% arduino:mbed_nano:nanorp2040connect,0,0.0,0,0.0,0,0.0,0,0.0,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 arduino:megaavr:uno2018:mode=on,0,0.0,0,0.0,0,0.0,0,0.0,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 arduino:samd:mkrvidor4000,0,0.0,0,0.0,0,0.0,0,0.0,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 arduino:samd:mkrwifi1010,0,0.0,0,0.0,0,0.0,0,0.0,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 arduino:samd:nano_33_iot,0,0.0,0,0.0,0,0.0,0,0.0,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 ```
JAndrassy commented 8 months ago

if I want wait for connection result I can use begin. so waitForConnectionResult is not useful. esp8266 and esp32 have waitForConnectionResult because their begin is not blocking. connect is useful if state() is checked later in loop() to do some communication over WiFi

hasenradball commented 8 months ago

@JAndrassy If you don`t see ann benefit for waitForConnect then please look at PR #263. With this approach there are indroduced small benefits. And please read the explanations. Thanks Frank

JAndrassy commented 8 months ago

@263 changes begin. how is it related to waitForConnectResult?

hasenradball commented 8 months ago

@JAndrassy It is related in this way:

please take two min. to read the explanations in #263 .

If waitForConnectResult is no way for you, maybee we can improve the begin methods slightly. 😊

JAndrassy commented 8 months ago

I have no objection to connect.

there is nothing to improve in begin. it is a normal time for the esp32. around 3 seconds for the first and a 1 second for repeated begin

hasenradball commented 8 months ago

@JAndrassy maybee you looked in the wrong code.

Chances in begin are located in #263 .

And one hint to the benefit if a non blocking connect! Why to wait if wifi is connected? Use a non blocking connect method an let the wifi connecting in background. Do meanwhile other stuff in setup. And check the connection status at the end of setup.

JAndrassy commented 8 months ago

again. I have no objection to your connect.

I responded about begin to your "maybee we can improve the begin methods slightly."

hasenradball commented 8 months ago

@JAndrassy Thanks for your reply. I will rework it to add only the necessary changes. Will you add the connect method from the existing branch to the master to be able to be used?

JAndrassy commented 8 months ago

I am just a contributor here. I would like my own PR be merged.

hasenradball commented 8 months ago

@JAndrassy can we then move further discussions for begin to #263 ?

hasenradball commented 8 months ago

Hi @JAndrassy, I removed the waitForConnectResult, now only the non blocking connect method added here.

github-actions[bot] commented 8 months ago

Memory usage change @ 46b83a0da871958c06db97081b2dccf4cc2fe967

Board flash % RAM for global variables %
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018:mode=on 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table Board|`examples/AP_SimpleWebServer`
flash|%|`examples/AP_SimpleWebServer`
RAM for global variables|%|`examples/ConnectNoEncryption`
flash|%|`examples/ConnectNoEncryption`
RAM for global variables|%|`examples/ConnectWifi_waitForConnectResult`
flash|%|`examples/ConnectWifi_waitForConnectResult`
RAM for global variables|%|`examples/ConnectWithWEP`
flash|%|`examples/ConnectWithWEP`
RAM for global variables|%|`examples/ConnectWithWPA`
flash|%|`examples/ConnectWithWPA`
RAM for global variables|%|`examples/ConnectWithWPA2Enterprise`
flash|%|`examples/ConnectWithWPA2Enterprise`
RAM for global variables|%|`examples/ScanNetworks`
flash|%|`examples/ScanNetworks`
RAM for global variables|%|`examples/ScanNetworksAdvanced`
flash|%|`examples/ScanNetworksAdvanced`
RAM for global variables|%|`examples/SimpleWebServerWiFi`
flash|%|`examples/SimpleWebServerWiFi`
RAM for global variables|%|`examples/Tools/CheckFirmwareVersion`
flash|%|`examples/Tools/CheckFirmwareVersion`
RAM for global variables|%|`examples/Tools/FirmwareUpdater`
flash|%|`examples/Tools/FirmwareUpdater`
RAM for global variables|%|`examples/Tools/SerialNINAPassthrough`
flash|%|`examples/Tools/SerialNINAPassthrough`
RAM for global variables|%|`examples/WiFiChatServer`
flash|%|`examples/WiFiChatServer`
RAM for global variables|%|`examples/WiFiPing`
flash|%|`examples/WiFiPing`
RAM for global variables|%|`examples/WiFiSSLClient`
flash|%|`examples/WiFiSSLClient`
RAM for global variables|%|`examples/WiFiStorage`
flash|%|`examples/WiFiStorage`
RAM for global variables|%|`examples/WiFiUdpNtpClient`
flash|%|`examples/WiFiUdpNtpClient`
RAM for global variables|%|`examples/WiFiUdpSendReceiveString`
flash|%|`examples/WiFiUdpSendReceiveString`
RAM for global variables|%|`examples/WiFiWebClient`
flash|%|`examples/WiFiWebClient`
RAM for global variables|%|`examples/WiFiWebClientRepeating`
flash|%|`examples/WiFiWebClientRepeating`
RAM for global variables|%|`examples/WiFiWebServer`
flash|%|`examples/WiFiWebServer`
RAM for global variables|% -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|- `arduino:mbed_nano:nanorp2040connect`|0|0.0|0|0.0|0|0.0|0|0.0|N/A|N/A|N/A|N/A|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0 `arduino:megaavr:uno2018:mode=on`|0|0.0|0|0.0|0|0.0|0|0.0|N/A|N/A|N/A|N/A|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0 `arduino:samd:mkrvidor4000`|0|0.0|0|0.0|0|0.0|0|0.0|N/A|N/A|N/A|N/A|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0 `arduino:samd:mkrwifi1010`|0|0.0|0|0.0|0|0.0|0|0.0|N/A|N/A|N/A|N/A|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0 `arduino:samd:nano_33_iot`|0|0.0|0|0.0|0|0.0|0|0.0|N/A|N/A|N/A|N/A|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0
Click for full report CSV ``` Board,examples/AP_SimpleWebServer
flash,%,examples/AP_SimpleWebServer
RAM for global variables,%,examples/ConnectNoEncryption
flash,%,examples/ConnectNoEncryption
RAM for global variables,%,examples/ConnectWifi_waitForConnectResult
flash,%,examples/ConnectWifi_waitForConnectResult
RAM for global variables,%,examples/ConnectWithWEP
flash,%,examples/ConnectWithWEP
RAM for global variables,%,examples/ConnectWithWPA
flash,%,examples/ConnectWithWPA
RAM for global variables,%,examples/ConnectWithWPA2Enterprise
flash,%,examples/ConnectWithWPA2Enterprise
RAM for global variables,%,examples/ScanNetworks
flash,%,examples/ScanNetworks
RAM for global variables,%,examples/ScanNetworksAdvanced
flash,%,examples/ScanNetworksAdvanced
RAM for global variables,%,examples/SimpleWebServerWiFi
flash,%,examples/SimpleWebServerWiFi
RAM for global variables,%,examples/Tools/CheckFirmwareVersion
flash,%,examples/Tools/CheckFirmwareVersion
RAM for global variables,%,examples/Tools/FirmwareUpdater
flash,%,examples/Tools/FirmwareUpdater
RAM for global variables,%,examples/Tools/SerialNINAPassthrough
flash,%,examples/Tools/SerialNINAPassthrough
RAM for global variables,%,examples/WiFiChatServer
flash,%,examples/WiFiChatServer
RAM for global variables,%,examples/WiFiPing
flash,%,examples/WiFiPing
RAM for global variables,%,examples/WiFiSSLClient
flash,%,examples/WiFiSSLClient
RAM for global variables,%,examples/WiFiStorage
flash,%,examples/WiFiStorage
RAM for global variables,%,examples/WiFiUdpNtpClient
flash,%,examples/WiFiUdpNtpClient
RAM for global variables,%,examples/WiFiUdpSendReceiveString
flash,%,examples/WiFiUdpSendReceiveString
RAM for global variables,%,examples/WiFiWebClient
flash,%,examples/WiFiWebClient
RAM for global variables,%,examples/WiFiWebClientRepeating
flash,%,examples/WiFiWebClientRepeating
RAM for global variables,%,examples/WiFiWebServer
flash,%,examples/WiFiWebServer
RAM for global variables,% arduino:mbed_nano:nanorp2040connect,0,0.0,0,0.0,0,0.0,0,0.0,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0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,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 ```
JAndrassy commented 8 months ago

I think you would achieve same as this connect with setting timeout to a very short time for begin

hasenradball commented 8 months ago

@JAndrassy

Could be, BUT if you look at the code, the value of timeout is hardcoded! And if I want to use an non blocking connect method, I don't want to step into the src file first and make changes in the constructor!

Thats's not my way of smart software development!

Bildschirmfoto 2023-11-11 um 19 18 47

That's the reason I wanted to add a method like waitForConnectResult because here you are able to define the timeout as function parameter!

But lets say with the both PR (#263 and #264) I would be happy because all is possible.

JAndrassy commented 8 months ago

there is WiFi.setTimeout

hasenradball commented 8 months ago

Yes, you are right I saw it in the same time you wrote.

Bildschirmfoto 2023-11-11 um 20 09 47

Is there an big point to add the connect methods?

I actually had an idea about simplify the connect methods by using the setTimeout() method like:

Bildschirmfoto 2023-11-11 um 20 17 04

This would be much cleaner than this approach:

Bildschirmfoto 2023-11-11 um 20 21 41
hasenradball commented 8 months ago

@JAndrassy using setTimeout(0)before begin()works fine. So I would say there is no real need to introduce a connect()method.