Experimental Drivers for Wiznet-based Ethernet Shields
#21
Posted 29 September 2010 - 03:19 AM
#22
Posted 29 September 2010 - 03:31 AM
#23
Posted 29 September 2010 - 03:47 AM
I had read that DNS was not working, but I thought that was the purpose of the proxy in the following segment from the Wiznet test posted in this forum.Looking at your error code again... DNS is not supported yet. We put that in the release notes next to the download link, but maybe we need to make that more obvious. Can you try connecting via direct IP and see if that works?
Chris
string url = "http://www.secretlabs.com/default.htm"; // NOTE: since this experimental release does not support DNS yet, we must use the IP address of the web server as the proxy address. string proxy = "174.143.45.105"; // ip address of secretlabs.com // If the device must go through a proxy server, then set proxy to the // fqdn or ip of the proxy server. try { String html = GetWebPage(proxy, url, 80); Debug.Print(html); } catch (SocketException se)
BTW I don't require a proxy server to access the net.
#24
Posted 29 September 2010 - 03:54 AM
I fixed that error by updating PhysicalAddress initialization in the sample program with the MAC address printed on sticker on the back of my Ethernet Shield.Hi Chris and others! I was trying this code with my DFRobot shield, but everytime I run the code I get this error:
SocketException when connecting to http://www.nu.nl/.
If your network uses IPSec, you may need enable the port manually
Socket Error Code: 10060
I have turned of my firewall just to be sure, but I can't seem to get it to work.. anyone any suggestions?
Thanks,
Ramon
Replace the bytes in red with your actual MAC address.
networkInterface.PhysicalAddress = new byte[] { 0x01, 0x23, 0x45, 0x67, 0x89, 0x01 };
Good luck!
#25
Posted 29 September 2010 - 04:00 AM
I fixed that error by updating PhysicalAddress initialization in the sample program with the MAC address printed on sticker on the back of my Ethernet Shield.
Replace the bytes in red with your actual MAC address.
networkInterface.PhysicalAddress = new byte[] { 0x01, 0x23, 0x45, 0x67, 0x89, 0x01 };
Good luck!
I have an Arduino Ethernet shield and there is no MAC address printed on it anywhere. Does the Wiz5100 have one "programmed" into it? If so how do I get it?
#26
Posted 29 September 2010 - 04:14 AM
I have an Arduino Ethernet shield and there is no MAC address printed on it anywhere. Does the Wiz5100 have one "programmed" into it? If so how do I get it?
klotz,
Try the following MAC address; it's an official Secret Labs MAC address (and one we use for testing).
5C-86-4A-00-00-09
Chris
#27
Posted 29 September 2010 - 04:17 AM
#28
Posted 29 September 2010 - 04:23 AM
Thanks alot Chris, That was the ticket! It works now. When I get to work in the morning I will get a MAC address from my allocation.klotz,
Try the following MAC address; it's an official Secret Labs MAC address (and one we use for testing).
5C-86-4A-00-00-09
Chris
Just out of curiosity, any idea why the default one in the test code would not work?
#29
Posted 29 September 2010 - 04:35 AM
Thanks alot Chris, That was the ticket! It works now. When I get to work in the morning I will get a MAC address from my allocation.
Just out of curiosity, any idea why the default one in the test code would not work?
Some routers don't like the one from the test code--which is interesting. We'll start using a "reserved test MAC address"--probably the one I just posted--in test code going forward.
Chris
#30
Posted 29 September 2010 - 04:39 AM
Some routers don't like the one from the test code--which is interesting. We'll start using a "reserved test MAC address"--probably the one I just posted--in test code going forward.
And actually, here are 6 test MAC addresses that you can use--in case you have a small network of Wiznet-based shields which don't have MAC addresses.
5C-86-4A-00-00-DA
5C-86-4A-00-00-DB
5C-86-4A-00-00-DC
5C-86-4A-00-00-DD
5C-86-4A-00-00-DE
5C-86-4A-00-00-DF
Chris
#31
Posted 29 September 2010 - 04:42 AM
That is a good suggestion. However, you may want to be careful about using an address that will be on the same network segment as the shield. Some ethernet devices count on all the addresses on the same segment being unique.I don't understand it, but it ALSO works when I use the physical address of my PC!? So you can try that.
Open a command prompt on your PC, type ipconfig /all
You should see Physical Address listed for each ethernet card on your PC, it should look like XX-XX-XX-XX-XX-XX, pick one, and convert it to 0xXX, 0xXX, etc.
Also confusing is that my NKC Ethernet Shield does not seem to care what I put as Physical Address. It works even with the physical address of the Arduino Ethernet shield.
Another good source of unique mac addresses would be defunct or dead network devices you may have laying around. MAC addresses are generally printed on the serial number label and if they are truly defunct/dead you can be certain that the address is unique.
#32
Posted 29 September 2010 - 04:49 AM
Some routers don't like the one from the test code--which is interesting. We'll start using a "reserved test MAC address"--probably the one I just posted--in test code going forward.
Chris
I did a quick check of the standard, maybe the problem is that the first byte has the least significant bit set which means broadcast. Routers generally will not propagate a broadcast by default, for many good reasons. I don't know why I didn't notice it before, must be because it is getting late.
Since my network here at home is three tiered, my first jump would have been blocked. I was just luck that my pc and the 'duino were on the same segment(switch).
#33
Posted 30 September 2010 - 10:06 PM
A few things regarding Wiznet drivers for Netduino:
1) For MAC addresses, Wiznet has their own manufacturer code (the first three bytes of MAC address): 0x00, 0x08, 0xDC. This may help people choose a non-conflicting MAC Address.
2) Take a look at tinyclr.com downloads and get FEZ Open Firmware. The FEZ Domino supports the Arduino Ethernet shield and the open source firmware may provide what is needed here
Kai
#34
Posted 01 October 2010 - 02:42 AM
I got the Netduino along with Ethernet Shield and a Netduino Plus talking to each other via Ethernet, but it fails after the fourth communication because Socket class in System.Net.Socket does not implement Close() yet and we only have four sockets in Wiznet5100 implementation.
I tried fixing this myself by calling a new CloseSocket() I created in Wiznet5100.cs, but I got stuck because I don't know how to send the SnIR.
Can someone please help me write the SnIR portion?
internal void CloseSocket(System.Net.Sockets.Socket socket) { //-- Find socket index -- int socketIndex = -1; for (int i = 0; i < m_Sockets.Length; i++) { if (m_Sockets[i] == socket) { socketIndex = i; break; } } if (socketIndex >= 0) { // Netduino equivalent to Arduino's W5100.execCmdSn(s, Sock_CLOSE); UInt16 socketBaseAddress = (UInt16)(0x400 + (socketIndex * 0x100)); WriteRegister((UInt16)(socketBaseAddress + 0x0001), 0x10); // 0x10 = CLOSE // Netduino equivalent to Arduino's W5100.writeSnIR(s, 0xFF); // ???? // ???? } }
#35
Posted 01 October 2010 - 03:06 AM
Sorry, it looks like FEZ open source is in the same position. The Wiznet driver is just a stub waiting for implementation. I'm willing to put in some effort to assist in this effort. I am an experience C++ and C# developer, but I don't know where to start...
A few things regarding Wiznet drivers for Netduino:
1) For MAC addresses, Wiznet has their own manufacturer code (the first three bytes of MAC address): 0x00, 0x08, 0xDC. This may help people choose a non-conflicting MAC Address.
2) Take a look at tinyclr.com downloads and get FEZ Open Firmware. The FEZ Domino supports the Arduino Ethernet shield and the open source firmware may provide what is needed here
Kai
#36
Posted 01 October 2010 - 03:33 AM
I'm willing to put in some effort to assist in this effort. I am an experience C++ and C# developer, but I don't know where to start...
Ooh, we always love volunteers
Let's keep the Wiznet drives in C# for now, and then translate them to C++ later. They'll be faster as native code, but there are fewer "gotchas" and somewhat more portability if we create them in C#.
If you'd like a copy of the Wiznet communication spec, just PM me your e-mail address and I'll send over a copy. We could create a CodePlex project pretty easily.
All that said, finishing the Wiznet drivers will probably take about 5-10 more days of work. The easiest/fastest solution is probably to have us focus on fleshing out the implementation next week...and to have you and hari test and help resolve any bugs... Interested?
Chris
#37
Posted 01 October 2010 - 03:48 AM
Woohoo!! Time permitting, yes, I'd be happy to help SecretLabs.All that said, finishing the Wiznet drivers will probably take about 5-10 more days of work. The easiest/fastest solution is probably to have us focus on fleshing out the implementation next week...and to have you and hari test and help resolve any bugs... Interested?
#38
Posted 01 October 2010 - 03:55 AM
Woohoo!! Time permitting, yes, I'd be happy to help SecretLabs.
Okay, let me see what we can do. Implementing the Close routine should be pretty quick. Then we can implement Listen (for server connections) and UDP (for streaming/DNS) and DNS.
We actually already wrote a large DNS client implementation in C# (for pulling any type of record), so it'll be a matter of paring it all down. Or incorporating the version from the .NET MF PK source...
Chris
#39
Posted 01 October 2010 - 04:38 AM
Chris add me to your list of volunteers. I have worked on a project were we implemented uIP on an HC12 using the enc... chip so I have some experience with networking in sockets. (though I will admit to being a newbie at C# I have extensive experience in C++). I just spent the last 2 hours getting bind and listen implemented and ran into a glitch on accept so I do want to help.Ooh, we always love volunteers
Let's keep the Wiznet drives in C# for now, and then translate them to C++ later. They'll be faster as native code, but there are fewer "gotchas" and somewhat more portability if we create them in C#.
If you'd like a copy of the Wiznet communication spec, just PM me your e-mail address and I'll send over a copy. We could create a CodePlex project pretty easily.
All that said, finishing the Wiznet drivers will probably take about 5-10 more days of work. The easiest/fastest solution is probably to have us focus on fleshing out the implementation next week...and to have you and hari test and help resolve any bugs... Interested?
Chris
#40
Posted 01 October 2010 - 05:54 AM
Chris add me to your list of volunteers. I have worked on a project were we implemented uIP on an HC12 using the enc... chip so I have some experience with networking in sockets. (though I will admit to being a newbie at C# I have extensive experience in C++). I just spent the last 2 hours getting bind and listen implemented and ran into a glitch on accept so I do want to help.
klotz--any interest in helping get uIP up and running on the Netduino Plus? I might be able to get you one of the lab units. We only have a few, but if you were serious about helping... pascal06 is leading the project.
Chris
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users