HI everyone,
After monthes, I’m returning to gadgeteer development and I face a strange problem with network: it looks like the hi-level code doesn’t receive data.
I’ve tested with a Spider and a Cerberus, both in version 4.3. and showing exactly the same behaviour.
Here is the sample code from gadgeteer solutions (just mainboard + ethernet) :
void ProgramStarted()
{
Debug.Print("Program Started");
ethernet.UseDHCP();
ethernet.NetworkUp += NetworkUp;
ethernet.NetworkDown += NetworkDown;
}
private void NetworkDown(GTM.Module.NetworkModule sender, GTM.Module.NetworkModule.NetworkState state)
{
Debug.Print("Network DOWN");
}
void NetworkUp(GTM.Module.NetworkModule sender, GTM.Module.NetworkModule.NetworkState state)
{
Debug.Print("Network UP");
DateTime max = DateTime.Now + new TimeSpan(0, 0, 30);
while ((ethernet.NetworkSettings.IPAddress == "0.0.0.0") && (DateTime.Now < max))
System.Threading.Thread.Sleep(500);
Debug.Print("IP " + ethernet.NetworkSettings.IPAddress);
Debug.Print("SN " + ethernet.NetworkSettings.SubnetMask);
Debug.Print("GW " + ethernet.NetworkSettings.GatewayAddress);
foreach (var dns in ethernet.NetworkSettings.DnsAddresses)
Debug.Print("DNS " + dns);
}
I receive the network up/down events but the IP address never comes.
Both devices respond to ping and I can see their MAC address in the switch.
I’ve staticaly set the network config and tested with wireshark, I see the devices sending data, the responses are sent back but they ignore them.
Any hint would be appreciated
I already did some working ethernet code, but it was in version 4. I’ve not tried yet to reinstall old versions of everything…