Ehternet Wiz820IO Using 8 Sockets

Status
Not open for further replies.

Elektrolyt

New member
Hi All,

I have some optimation for using the Wiz820IO chield, which is based on the 5200 chipset.
In my project i need 8 sockets for the using of different communication services like
NTP, Ping, Web-Server, ftp, plc-connection etc..

Here is my modification for these files: w5100.cpp ; w5100.h ; Ethernet.h

View attachment w5100.h
View attachment w5100.cpp
View attachment E.h

Dear Paul Stoffregen, is it possible to put this as option in the new Ethernet library for Teensyduino?

bye ...
 
It's probably possible, but I'll need some way to test if 8 are really working.

Any chance you could create a program that tries to use 8 at once and tells which work and which fail? That'd really help me to do this sooner...
 
Isn't this already implemented in Ethernet2?

Code:
 * - 10 Apr. 2015
 * Added support for Arduino Ethernet Shield 2
 * by Arduino.org team
 */

#ifndef	W5500_H_INCLUDED
#define	W5500_H_INCLUDED

#define MAX_SOCK_NUM 8
 
Do I recall correctly that the W5100 has on-chip RAM for TX, RX packets for FOUR, not EIGHT sockets? And newer Wiznet chips support EIGHT?
(file name w5100 could be confusing if same source targets other chip types).
 
The W5200/5500 has double the Tx/Rx ram (32kB) and simultaneous sockets (8) of the older W5100. Its SPI interface also runs at twenty times the speed (80MHz) of the latter. It also supports burst transmission, allowing to transfer the full buffer (32kB) in one transaction, whereas the W5100 only supported byte mode. The Arduino core already supports the W5200 for quite some time, but for some reason they kept the 5100 naming of the source files.
 
@Epyon: You are right the w5200 has 8 sockets. The source file w5100 is used for many ethernet based libs and examples. Thats the real reason why i ask Paul s. to put it into there libs.

@Paul: I did a test by using the excample advanced telnet server. I modivied the example to get 8 Clients simultan. The test wasn't sucsessfull. Wen i conect over telnet the server with 2 Clients and send many messages, the connection of one and later all clients get lost. I did the test with my modivied lib and it wasnt good. I did the test with last original teensyduino lib, and it fails also. Then i decide to load your new libs from github (spi, ethernet) and the test failed also with 2 Clients and max 4 sockets. So it looks like the ethernet lib or spi lib is buggy....
i dont known where could be the problem.

Paul did you tests the new libs ?
 
My copy of the ethernet library only supports 4 sockets, even on W5200 where the hardware can do 8.

I have not personally tested the chat server example with any number of connections. I'll put this on my list of stuff to test. Realistically, I probably won't be able to look at this for a couple weeks, since the prop shield beta test will be drawing most of my dev time.
 
Hey, I submitted an issue on github for this but probably should have just posted here... I'd just like to bump this and see if there is time to take another pass at it?

If there is and you need some help/testing/sample code, please let me know! It is a very high priority for me so I can definitely sink some time into it.

I'll also try to do it myself and submit a PR if I can get it clean enough but it's pushing my abilities... so we'll see!
 
I was able to get 8 sockets working on T3.2 with WIZ820IO (w5200). Confusingly, MAX_SOCK_NUM is defined in both Ethernet.h and w5100.h?? I changed both to use

#define MAX_SOCK_NUM 8

Also in hardware/teensy/avr/libraries/Ethernet/w5100.h you need to change
static const int SOCKETS = 4;
to
static const int SOCKETS = MAX_SOCK_NUM;

This bug was noted at https://forum.pjrc.com/threads/5119...-compile-error?p=176946&viewfull=1#post176946
and I filed an issue on Paul's Ethernet github.

To test, I modified Ethernet example AdvancedChatServer to support 8 clients, and was able to have 8 different/concurrent telnet's connect to the server.

Running 1.8.4/1.40

I confirmed the socket buffer size was 2K, so 8 transmit and 8 receive buffers would fit in the w5200 32K. (On w5100 you would need to use 1K buffers -- not tested)
 
Awesome! Thanks for testing! I thought it would be much more complex but I think I was going on old info. I will do some further tests in the next week or so and confirm that it works for me too.
 
Status
Not open for further replies.
Back
Top