Main Site Documentation

Wiznet


#1

Dear All,
I have soldered the wiznet module with my Fez-Rhino. I tried example in beginer’s guide, it started failing in socket creation. Then I located a source code in GHI Electrocnice NETMF Library documentation. I saw

WIZnet_W5100.Enable(SPI.SPI_module.SPI1, (Cpu.Pin)38, (Cpu.Pin)67,true); // WIZnet interface on FEZ Rhino (USBizi)

This statement corrected the socket creation poblem.

Question1: I am not able to relate to relate to magical number 38 and 67 mentioned here. Can some one explain me these numbers. I am not able to relate it to PIN documentation in manuals FEZ as well as USBizi.

Question 2: when I try to connect to this server from my IE browser, it is not able to reach to this server. I am not able to ping the IP address. I have connected my FEZ to router via one of the LAN ports of my router (wireless). I have checked subnet,gateway etc. and all are correct.

Please help.


#2

Hi zkumar ,

it is also described in the documentation. One pin is for chip select and the other is for reseting the Wiznet module

[quote]public static void Enable(
SPI_module spi,
Pin CS,
Pin Reset,
bool ReserveSocket
)

Parameters

spi
Type: SPI_module
SPI module.

CS
Type: Pin
Chip Select pin.

Reset
Type: Pin
External Reset pin.

ReserveSocket
Type: System…::…Boolean
By setting this parameter to true, the system will reserve one socket out of the four socket reources for internal use to insure smooth service for DNS and DHCP. [/quote]

For starting with networking take alook into the Beginners guide and/or int the networking section of the wiki

Here : http://www.microframeworkprojects.com/index.php?title=Networking

Best regards

Marc


#3

zhumar:

Q1: That magical numbers(38 & 67) is another way to specify the pin without using the enum, which is coinsided with the enum of FEZ Rhino.

In your case, you have the WIZ module soldered in.
The CS pin for the WIZ Module is IO38
The ReSeT pin for the WIZ Module is IO67
The INTerrupt pin for the WIZ Module is IO39

The SCK pin for the WIZ Module is IO42
The MOSI pin for the WIZ Module is IO41
The MISO pin for the WIZ Module is IO40

I do not have the Rhino to try out with the WIZ module. So, I couldnot answer the Q2! :frowning:
May be somebody else could!

Hope this help.


#4

Thanks SAM. that explains.

I am bit confused about code that been put as there are not compiling fully. I need to make minor changes to them.

WIZnet_W5100.Enable(SPI.SPI_module.SPI1,
(Cpu.Pin)FEZ_Pin.Digital.Di10,
(Cpu.Pin)FEZ_Pin.Digital.Di9, true);

in FEZ Rhino there are no Di?? all are IOxx and currently I am using IO38 and IO67.

I have a wireless router which DHCP enabled. Is HUB is different than router? Still I am not able to connect to Fez Rhino, I am sure I am just missing something important and FEZ guy must have tested it many times.
I just soldered it . Please let me know any other suggestion you have.


#5

That’s correct! :wink:

I wish somebody who really know better about this could help answer this!! :frowning:


#6

Thank you Sam for help.
I have extra information about the IOxx vs. Di.
IOxx are the original GPIO numbers of USBizi chipset. Take a look at USBizi chipset user manual.

Now for network connectivity, Make sure that you set a static IP address that belongs to your local network. If you did not know what I mean, I can explain this more.


#7

DHCP is not currently supported. You need to set the IP as shown in example code.

Also, we have seen it where netgear router/switch doesn’t like static IPs and so you have to enter the router settings and set your IP in there.

This is what your code should do

  1. init W5100
  2. Set static IP
  3. while loop to blink LED
  4. Try to ping FEZ from your PC

#8

I have tried just initializing the wiznet and running a loop just printing “I am sleeping”. I tried pinging the FEZ Rhino but no answer.

I see green light glowing and orange light blinking.But at pining level nothing happens.

I will test with some other router, but not having DHCP is limitation. :frowning:


#9

DHCP will be supported. It is on high priority list.

For the connection issue, if you don’t have another router, You can connect it directly to your PC and test it. Of course after setting a matching IP addresses for both.


#10

Great Joe!! Your suggestion did work and I am happy wiznet is working atleast.I have a laptop with wireless and normal lan connection. I would ultimately like FEZ to talk to application on internet. Could you suggest setting. for the two connection.


#11

Nice, let’s go to the next step.
Are you using Netgear router?


#12

So if you have those two devices on the same network, what do you need to do? Do you actually have any error?


#13

Brett,
Some Netgear routers have a problem forwarding the broadcast messages. So the IP address and the MAC address of your device can not be associated on the network, thus the communication can not be established with this device.
I searched netgear forum and I found this
http://forum1.netgear.com/showthread.php?t=47503&highlight=failure+forward+broadcast
There was a more clear post that explain this problem. I will look for it.

Maybe the problem is fixed in new firmwares. I am not sure.

To work around this problem, you have to teach your router with MAC and IP address of your device. In another word, login to the router settings, go to DHCP server page, add a static IP address lease. This lease will force associating the IP with the MAC address on the network.