NetworkHelper.SetupAndConnectNetwork fails on ESP32_OLIMEX_WROVER with Firmware >1.14
Library/API/IoT binding
nanoFramework.Networking
Visual Studio version
VS2022 V17.14.19
.NET nanoFramework extension version
2022.17.14.19
Target name(s)
ESP32_OLIMEX_WROVER
Firmware version
1.14
Device capabilities
System Information HAL build info: nanoCLR running @ ESP32 built with ESP-IDF v5.4.2 Target: ESP32_OLIMEX_WROVER Platform: ESP32
Firmware build Info: Date: Nov 8 2025 Type: MinSizeRel build, chip rev. >= 3, support for PSRAM CLR Version: 1.14.0.124 Compiler: GNU ARM GCC v14.2.0
OEM Product codes (vendor, model, SKU): 0, 0, 0
Serial Numbers (module, system): 00000000000000000000000000000000 10000000001097BDE2F550
Target capabilities: Has nanoBooter: NO IFU capable: NO Has proprietary bootloader: YES
AppDomains:
Assemblies: NFCommTest, 1.0.0.0 System.Threading, 1.1.52.34401 mscorlib, 1.17.11.0 nanoFramework.Runtime.Events, 1.11.32.0 System.Net, 1.11.43.0 nanoFramework.System.Text, 1.3.42.0 System.IO.Streams, 1.1.96.0
Native Assemblies: mscorlib v100.5.0.24, checksum 0x1549C856 nanoFramework.Runtime.Native v100.0.10.0, checksum 0x0EAE898B nanoFramework.Hardware.Esp32 v100.0.10.0, checksum 0x6A20A689 nanoFramework.Hardware.Esp32.Rmt v100.0.5.1, checksum 0x8ADAC728 nanoFramework.Device.OneWire v100.0.4.0, checksum 0xB95C43B4 nanoFramework.Networking.Sntp v100.0.4.4, checksum 0xE2D9BDED nanoFramework.ResourceManager v100.0.0.1, checksum 0xDCD7DF4D nanoFramework.System.Collections v100.0.2.0, checksum 0x40DC251F nanoFramework.System.Text v100.0.0.1, checksum 0x8E6EB73D nanoFramework.System.IO.Hashing v100.0.0.1, checksum 0xEBD8ED20 nanoFramework.System.Security.Cryptography v100.0.0.3, checksum 0x343142CA nanoFramework.Runtime.Events v100.0.8.0, checksum 0x0EAB00C9 EventSink v1.0.0.0, checksum 0xF32F4C3E System.IO.FileSystem v1.1.0.4, checksum 0x1777E2FE System.Math v100.0.5.5, checksum 0x9F9E2A7E System.Net v100.2.0.11, checksum 0xD82C1452 System.Device.Adc v100.0.0.0, checksum 0xE5B80F0B System.Device.Dac v100.0.0.6, checksum 0x02B3E860 System.Device.Gpio v100.1.0.6, checksum 0x097E7BC5 System.Device.I2c v100.0.0.2, checksum 0xFA806D33 System.Device.I2c.Slave v1.0.0.0, checksum 0x4238164B System.Device.I2s v100.0.0.1, checksum 0x478490FE System.Device.Pwm v100.1.0.4, checksum 0xABF532C3 System.IO.Ports v100.1.6.1, checksum 0xB798CE30 System.Device.Spi v100.1.2.0, checksum 0x3F6E2A7E System.Runtime.Serialization v100.0.0.0, checksum 0x0A066871 System.Device.Wifi v100.0.6.4, checksum 0x00A058C6
++++++++++++++++++++++++++++++++ ++ Memory Map ++ ++++++++++++++++++++++++++++++++ Type Start Size ++++++++++++++++++++++++++++++++ RAM 0x3f80087c 0x003b0000 FLASH 0x00000000 0x00400000
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++ Flash Sector Map ++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Region Start Blocks Bytes/Block Usage +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 0 0x00010000 1 0x1D0000 nanoCLR 1 0x001E0000 1 0x1C0000 Deployment 2 0x003C0000 1 0x040000 Configuration
+++++++++++++++++++++++++++++++++++++++++++++++++++ ++ Storage Usage Map ++ +++++++++++++++++++++++++++++++++++++++++++++++++++ Start Size (kB) Usage +++++++++++++++++++++++++++++++++++++++++++++++++++ 0x003C0000 0x040000 (256kB) Configuration 0x00010000 0x1D0000 (1856kB) nanoCLR 0x001E0000 0x1C0000 (1792kB) Deployment
Deployment Map Empty
Description
With firmware 1.12 the SetupAndConnectNetwork function was initializing Ethernet with DHCP on a POE network just fine. Since 1.14 this does no longer work and the function returns false every time although the network is correctly connected and the NetworkInformation class returns a valid IP. With a static IP this works just fine, but not with HDCP.
I tested with a Pi-Hole DHCP server as well as with a Unifi UDM Pro Router
How to reproduce
- Flash the OLIMEX With the latest firmware:
nanoff --platform esp32 --target ESP32_OLIMEX_WROVER --serialport COM<yourPort> --update --masserase
- Run the following program:
public static void Main()
{
bool IsCommReady = false;
NetworkInterface[] allNetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
NetworkInterface[] array = allNetworkInterfaces;
foreach (NetworkInterface networkInterface in array)
{
if (networkInterface.NetworkInterfaceType == NetworkInterfaceType.Ethernet && networkInterface.IPv4Address[0] != '0')
{
var ip = networkInterface.IPv4Address;
Debug.WriteLine($"IP: {ip}");
IsCommReady = true;
}
}
if (IsCommReady)
Debug.WriteLine("Ethernet Connected");
using (CancellationTokenSource cs = new(60000))
{
Debug.WriteLine($"Trying Ethernet...");
IsCommReady = NetworkHelper.SetupAndConnectNetwork(cs.Token);
}
if (!IsCommReady)
Debug.WriteLine("SetupAndConnect Ethernet Failed");
}
- Debug or execute the program.
It will show "Ethernet Connected" and a valid IP, but once it hits SetupAndConnectNetwork it will stall for 60 seconds per cancel token and then returns with failed.
Expected behaviour
This works just fine with Firmware 1.12
Screenshots
No response
Sample project or code
No response
Aditional information
No response
After debugging the "NetworkInterface.cs" sets the DHCP again although it is already set.
/// <summary>
/// Enables the Dynamic Host Configuration Protocol (DHCP) for service with this network interface.
/// </summary>
public void EnableDhcp()
{
try
{
if (_startupAddressMode != AddressMode.DHCP)
{
_startupAddressMode = AddressMode.DHCP;
UpdateConfiguration((int)UpdateOperation.Dhcp);
}
}
finally
{
ReloadSettings();
}
}
Not calling UpdateConfiguration() when the NetworkInterface is already in AddressMode.DHCP fixed this problem for me.
@muenchris great finding and PR welcome :-)
The issue with the WebSockets I reported in Discord still exists. I will file another issue on that shortly.