arduino-libraries / Ethernet

Ethernet Library for Arduino
http://arduino.cc/
252 stars 253 forks source link

Fixes static IPs for Arduino Nano Every #218

Closed mghie closed 1 year ago

mghie commented 1 year ago

The example program WebClient does not work on the Arduino Nano Every when DHCP is not available or commented out - the versions of Ethernet::begin() using a static IP address fail. I tested the example on Uno, Mega2560 and Micro, it works on all of them using either DHCP or static IP.

This modifies the begin() method so that it uses IPAddress::raw_address() instead of platform conditional code in the same way the DHCP version of begin() does. With this change static addresses work on the Nano Every too.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

github-actions[bot] commented 1 year ago

Memory usage change @ 72462ca2661ef5667fb2482a0b2c48b278c5333f

Board flash % RAM for global variables %
arduino:avr:leonardo 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:avr:mega 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:avr:nano 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:nona4809 :small_red_triangle: 0 - +56 0.0 - +0.11 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018 :small_red_triangle: 0 - +56 0.0 - +0.12 0 - 0 0.0 - 0.0
arduino:sam:arduino_due_x_dbg 0 - 0 0.0 - 0.0 N/A N/A
arduino:samd:arduino_zero_edbg 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:mkrfox1200 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:mkrvidor4000 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:mkrzero 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/AdvancedChatServer
flash|%|examples/AdvancedChatServer
RAM for global variables|%|examples/BarometricPressureWebServer
flash|%|examples/BarometricPressureWebServer
RAM for global variables|%|examples/ChatServer
flash|%|examples/ChatServer
RAM for global variables|%|examples/DhcpAddressPrinter
flash|%|examples/DhcpAddressPrinter
RAM for global variables|%|examples/DhcpChatServer
flash|%|examples/DhcpChatServer
RAM for global variables|%|examples/LinkStatus
flash|%|examples/LinkStatus
RAM for global variables|%|examples/PagerServer
flash|%|examples/PagerServer
RAM for global variables|%|examples/TelnetClient
flash|%|examples/TelnetClient
RAM for global variables|%|examples/UDPSendReceiveString
flash|%|examples/UDPSendReceiveString
RAM for global variables|%|examples/UdpNtpClient
flash|%|examples/UdpNtpClient
RAM for global variables|%|examples/WebClient
flash|%|examples/WebClient
RAM for global variables|%|examples/WebClientRepeating
flash|%|examples/WebClientRepeating
RAM for global variables|%|examples/WebServer
flash|%|examples/WebServer
RAM for global variables|% -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|- arduino:avr:leonardo|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|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:avr:mega|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.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 arduino:samd:mkrwifi1010|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|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:mkrzero|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|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|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|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/AdvancedChatServer
flash,%,examples/AdvancedChatServer
RAM for global variables,%,examples/BarometricPressureWebServer
flash,%,examples/BarometricPressureWebServer
RAM for global variables,%,examples/ChatServer
flash,%,examples/ChatServer
RAM for global variables,%,examples/DhcpAddressPrinter
flash,%,examples/DhcpAddressPrinter
RAM for global variables,%,examples/DhcpChatServer
flash,%,examples/DhcpChatServer
RAM for global variables,%,examples/LinkStatus
flash,%,examples/LinkStatus
RAM for global variables,%,examples/PagerServer
flash,%,examples/PagerServer
RAM for global variables,%,examples/TelnetClient
flash,%,examples/TelnetClient
RAM for global variables,%,examples/UDPSendReceiveString
flash,%,examples/UDPSendReceiveString
RAM for global variables,%,examples/UdpNtpClient
flash,%,examples/UdpNtpClient
RAM for global variables,%,examples/WebClient
flash,%,examples/WebClient
RAM for global variables,%,examples/WebClientRepeating
flash,%,examples/WebClientRepeating
RAM for global variables,%,examples/WebServer
flash,%,examples/WebServer
RAM for global variables,% arduino:avr:leonardo,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,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:avr:mega,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,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:avr:nano,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,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:nona4809,50,0.1,0,0.0,56,0.11,0,0.0,50,0.1,0,0.0,0,0.0,0,0.0,48,0.1,0,0.0,0,0.0,0,0.0,56,0.11,0,0.0,56,0.11,0,0.0,56,0.11,0,0.0,0,0.0,0,0.0,56,0.11,0,0.0,56,0.11,0,0.0,56,0.11,0,0.0 arduino:megaavr:uno2018,50,0.1,0,0.0,56,0.12,0,0.0,50,0.1,0,0.0,0,0.0,0,0.0,48,0.1,0,0.0,0,0.0,0,0.0,56,0.12,0,0.0,56,0.12,0,0.0,56,0.12,0,0.0,0,0.0,0,0.0,56,0.12,0,0.0,56,0.12,0,0.0,56,0.12,0,0.0 arduino:sam:arduino_due_x_dbg,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N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