Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom Ethernet timeouts #107

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

manchoz
Copy link
Contributor

@manchoz manchoz commented Dec 13, 2023

This PR adds support for specifying custom timeouts on Ethernet connections.

Combined with the ArduinoIoTCloud library, this PR allows writing sketches that don't block for 15s in the loop() if the Ethernet cable is not connected or there is no link-layer connectivity.

To be used as:

EthernetConnectionHandler ArduinoIoTPreferredConnection(IP, DNS, GATEWAY, NETMASK, 1000);
  auto connStatus = ArduinoIoTPreferredConnection.check();

  if (connStatus == NetworkConnectionState::CONNECTED)
    ArduinoCloud.update();

Copy link

Memory usage change @ 36aa008

Board flash % RAM for global variables %
arduino:esp32:nano_nora 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed:envie_m7 N/A N/A N/A N/A
arduino:mbed_edge:edge_control 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_giga:giga 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nicla:nicla_vision 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_opta:opta 🔺 +160 - +160 +0.01 - +0.01 🔺 +32 - +32 +0.01 - +0.01
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 🔺 +136 - +136 +0.01 - +0.01 🔺 +32 - +32 +0.01 - +0.01
arduino:renesas_uno:unor4wifi 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 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
esp32:esp32:esp32 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ConnectionHandlerDemo
flash
% examples/ConnectionHandlerDemo
RAM for global variables
%
arduino:esp32:nano_nora 0 0.0 0 0.0
arduino:mbed:envie_m7 N/A N/A N/A N/A
arduino:mbed_edge:edge_control 0 0.0 0 0.0
arduino:mbed_giga:giga 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 0 0.0 0 0.0
arduino:mbed_nicla:nicla_vision 0 0.0 0 0.0
arduino:mbed_opta:opta 160 0.01 32 0.01
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 136 0.01 32 0.01
arduino:renesas_uno:unor4wifi 0 0.0 0 0.0
arduino:samd:mkr1000 0 0.0 0 0.0
arduino:samd:mkrgsm1400 0 0.0 0 0.0
arduino:samd:mkrnb1500 0 0.0 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0
arduino:samd:mkrwifi1010 0 0.0 0 0.0
arduino:samd:nano_33_iot 0 0.0 0 0.0
esp32:esp32:esp32 0 0.0 0 0.0
esp8266:esp8266:huzzah 0 0.0 0 0.0
Click for full report CSV
Board,examples/ConnectionHandlerDemo<br>flash,%,examples/ConnectionHandlerDemo<br>RAM for global variables,%
arduino:esp32:nano_nora,0,0.0,0,0.0
arduino:mbed:envie_m7,N/A,N/A,N/A,N/A
arduino:mbed_edge:edge_control,0,0.0,0,0.0
arduino:mbed_giga:giga,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,0,0.0,0,0.0
arduino:mbed_nicla:nicla_vision,0,0.0,0,0.0
arduino:mbed_opta:opta,160,0.01,32,0.01
arduino:mbed_portenta:envie_m7,N/A,N/A,N/A,N/A
arduino:renesas_portenta:portenta_c33,136,0.01,32,0.01
arduino:renesas_uno:unor4wifi,0,0.0,0,0.0
arduino:samd:mkr1000,0,0.0,0,0.0
arduino:samd:mkrgsm1400,0,0.0,0,0.0
arduino:samd:mkrnb1500,0,0.0,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0
arduino:samd:mkrwifi1010,0,0.0,0,0.0
arduino:samd:nano_33_iot,0,0.0,0,0.0
esp32:esp32:esp32,0,0.0,0,0.0
esp8266:esp8266:huzzah,0,0.0,0,0.0

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Dec 13, 2023
@pennam pennam self-requested a review June 3, 2024 06:41
@pennam pennam merged commit b90758b into arduino-libraries:master Jun 3, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants