Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 11 of 11

Thread: Ehternet Wiz820IO Using 8 Sockets

  1. #1
    Junior Member
    Join Date
    Mar 2016
    Posts
    2

    Ehternet Wiz820IO Using 8 Sockets

    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

    w5100.h
    w5100.cpp
    E.h

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

    bye ...

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,016
    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...

  3. #3
    Senior Member Epyon's Avatar
    Join Date
    Apr 2013
    Location
    Belgium
    Posts
    443
    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

  4. #4
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    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).

  5. #5
    Senior Member Epyon's Avatar
    Join Date
    Apr 2013
    Location
    Belgium
    Posts
    443
    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.

  6. #6
    Junior Member
    Join Date
    Mar 2016
    Posts
    2
    @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 ?

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,016
    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.

  8. #8
    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!

  9. #9
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,621
    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/51191...l=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)

  10. #10
    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.

  11. #11
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,016
    If anyone's still watching this thread, I've updated the Ethernet lib to handle 8 sockets, but still hopefully be correct when using W5100 which has only 4.

    Help wanted with testing, if anyone has programs needing to use all 8 sockets.

    https://github.com/PaulStoffregen/Ethernet

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •