Main Site Documentation

Connecting Ethernet to Fez Panda II and wifi bridge


#1

Hi!

I’m trying to connect my fez panda in order to perform a get http request that I need but it seems that it is not working and I don’t know if maybe I need to change something in my router configuration.

What I did is:

  • Configured my vonets wifi bridge to be connected to my wifi connection
  • Connect the wifi bridge usb to my laptop and the rj45 to the fez connect shield
  • Run this example code from internet of things book:
 ip = { 192, 168, 1, 222 };
byte[] subnet = { 255, 255, 255, 0 };
byte[] gateway = { 192, 168, 1, 1 };
byte[] mac = { 0x00, 0x88, 0x98, 0x90, 0xD4, 0xE0 };
WIZnet_W5100.Enable(SPI.SPI_module.SPI1, (Cpu.Pin)FEZ_Pin.Digital.Di10, 
(Cpu.Pin)FEZ_Pin.Digital.Di7, true);
NetworkInterface.EnableStaticIP(ip, subnet, gateway, mac);
NetworkInterface.EnableStaticDns(new byte[] { 192, 168, 1, 1 });
IPHostEntry GHI_ip = Dns.GetHostEntry("www.GHIElectronics.com");
Debug.Print("GHI's IP = " + GHI_ip.AddressList[0].ToString());
while (true) {
Thread.Sleep(300);
}

Then it returns a null for GHI_ip and if I ping the 192.168.1.222 ip that ping works randomly (it depends of the execution or if I change the ip the ping works for both of them and I don’t undertand). Does anyone know what is the problem?


#2

This is a real old, long discontinued, product and I personally don’t remember much. But I really want to see this running TinyCLR. There are thousands of these devices floating around.

Sorry I couldn’t help but maybe others can.


#3

I’d suggest you look at someone else’s project and see if that works for you. https://www.ghielectronics.com/community/codeshare/entry/358 is not a bad place to start.

Also, where did you get the MAC address? Completely random, or something that you know? It is a critical part of the physical network layer, if you have a conflict on your network then you’ll struggle to get any comms working


#4

Thanks Brett, but I tried with other projects and I always have the same problem. Using this dinamic dns I get this error:

FEZ Connect Driver : Initializing network…
#### Exception System.Exception - 0x00000000 (1) ####
#### Message: Dhcp Client Timeout
#### GHIElectronics.NETMF.Net.NetworkInformation.Dhcp::GetDhcpLease [IP: 00aa] ####
#### GHIElectronics.NETMF.Net.NetworkInformation.Dhcp::EnableDhcp [IP: 004a] ####
#### JDI.NETMF.Shields.FEZConnect::InitializeNetwork [IP: 002b] ####
#### FEZConnectDriver.Program::InitializeNetwork [IP: 0015] ####
#### FEZConnectDriver.Program::Main [IP: 0092] ####
A first chance exception of type ‘System.Exception’ occurred in GHIElectronics.NETMF.W5100.Dhcp.dll
FEZ Connect Driver : Network ready.
IP Address: 0.0.0.0
Subnet Mask: 0.0.0.0
Default Getway: 0.0.0.0
DNS Server: 0.0.0.0
Free mem : 40788

And this is why I think that maybe I have a problem with my router configuration or something like that. Can I connect the fez to the router using a rj45 cable? Although I disabled my laptop connections and I was able to connect using the wifi bridge.

Thanks for your time!


#5

Yes, It seems that It is a problem with the wifi bridge, because trying using the cable I see:

FEZ Connect Driver : Initializing network…
FEZ Connect Driver : Network ready.
IP Address: 192.168.1.107
Subnet Mask: 255.255.255.0
Default Getway: 192.168.1.1
DNS Server: 192.168.1.1


#6

so when connected to the wifi device you aren’t getting DHCP leased addresses. Certainly sounds like a config issue on the bridge - proven when you connect direct to the router. Great to know your code works, right? :slight_smile: Now all you need to do is track down if you can get the bridge to pass DHCP packets


#7

Yes!! :slight_smile: Thanks, I will try to configure the wifi bridge again.