Skip to content

systronix/W5500_Test

Repository files navigation

W5500 WIZnet Ethernet Tests

Applies to all boards and modules which use the WIZnet W5500 chip: WIZ850io, W5500 Shield, etc.

Hardware used

  • Teensy 3.2 Teensy 3.2 with ARM Cortex M4
  • Teensy 3.2 breakout board R3 at OSH park, essential to map Teensy 3.2 to a standard DIP-style pinout without the awkward bottom header and end pins. Systronix designed a simple assembly jig to help in assembling Teensy 3.2 to this adapter.
  • PRJC WIZ820io & Micro SD Card Adaptor which also works with the WIZ850io module (850io and 820io are pin-compatible). To use this with Ethernet, the CS and DC signals need remapping with cuts on the board. @TODO: add photos of the hacks
    • TFT_CS moves from default 10 to 20
    • TFT_DC moves from default 9 to 21
  • WIZnet WIZ850io - about USD $17; this module uses the W5500 chip, will also work with WIZ820io which uses the W5200
  • ILI9341 2.8" color touchscreen, available tested from PJRC or take your chances on eBay. A recent order of five on eBay had 4/5 with cracked screens, all with bent pins. Inadequately packaged.
  • ILI9341 2.8" color touchscreen, BuyDisplay ER-TFT028-4 and a custom carrier board with buffers, able to use at least a 36" ribbon cable back to the Teensy host board.
  • eBay WIZ850io clones - about USD $9; ignore the misleading name in the listing. Five ordered 2017 Feb 25 for testing. These have been tested by PJRC. These are reporterdly the real W5500 cheap on a cheaper Chinese module with other Chinese components. It ain't rocket science so there's no reason these have to be crap.
  • Adafruit M0 Pro which appears to be identical to the Arduino.org M0Pro with SAMD21 ARM Cortex M0
  • Arduino.org M0 Pro
  • WIZnet W5500 Shield which uses the W5500 chip in the Arduino board form factor. I bought this combo to have an official, blessed-by-WIZnet board set which should work out of the box. This turned out to be mostly true thanks to Adafruit Ethernet2
  • note: these M0 Pros are not identical to the Arduino.cc Zero boards. They are very close. Apparently pins #2 and #4 are swapped (see Adafruit M0 page)

Software and Libraries

Ethernet2

  • Currently using the Ethernet2 library, the Adafruit fork, modified by Systronix, so this Ethernet2
  • Adafruit Ethernet2 library 1v2 which is required for the W5500 shield. This Adafruit library is actually based on WIZnet code of Soohwan Kim which has not seen any change in 2+ years. The default "Ethernet" library supports only W5100 and W5200 chips.

Arduino.cc 1.8.2

  • Remember the schism between Arduino.cc and Arduino.org? Now (2016 Oct 01) they have promised to kiss and make up but the unification has not occurred yet and affects these efforts... why can't we all just get along? Oh yeah... that human nature thing.
  • Arduino.cc Arduino 1.8.2, also worked with 1.6.11, modified for Teensy 3 by TeensyDuino:

TeensyDuino

Teensy MAC and ID constants

Superceded libraries

  • This information kept for informational and transitional purposes.
  • Arduino .org and .cc are now merged Arduino.org Arduino 1.7.11, or at least a version 1.7.5 or later. Arduino.org 1.7.X must be used with the .org M0 Pro, or now with Arduino.cc 1.8.11 I can build the DHCP stress test program for M0Pro. Don't add TeensyDuino to this Arduino.org installation.
  • The WIZnet W5500 Ethernet library is now the Adafruit Ethernet2, we have forked and modified WIZnet advises you go to wizwiki.net where you can find W5500 Ethernet Shield Docs and this W5500 getting started which refers to WIZ_Ethernet_Library which has not seen a commit since two years ago. So instead I used the Adafruit Ethernet2 library.

Installation and Configuration

  • All programs use default SPI pins D10,11,12,13 for Ethernet connection. These pins can now be changed (within limits) since TD 1.3.2
  • I set my DHCP server to the minimum lease time of 120 seconds. This is a stress test so I want the lease to renew as often as possible.
  • Arduino M0 Pro plugs under the W5500 shield and is programmed with Arduino.org 1.7.11, selecting:
    • Select Tools > board "Arduino M0 Pro (Programming Port)"" and connect USB cable to the port closest to the M0 power jack
    • Selection of programmer doesn't seem to matter but it should be "Atmel EDBG ..." since that's what it really is
    • For the Serial Monitor to work the baud rate must match what is used in the code, 115 kbaud. It's USB... go figure.
  • Teensy 3.2 connects to WIZ850io and is programmed with Arduino.cc 1.8.11 with Teensyduino 1.35
    • Teensy 3.2 connects to WIZ850io using the PJRC WIZ820io adapter, a custom board, or wires
    • Select Tools > board "Teensy 3.2/3.1" and I used 48 MHz.
    • Programmer selection is not critical, default is "AVR ISP". The TeensyDuino extension will pop up and do the actual programming.
    • Serial monitor baud rate doesn't matter. It's really serial over USB... Why is Arduino.org 1.7.11 different?

Programs & Logs

DhcpStressTest

  • Originally developed for the WIZ820io which has some ARP/DHCP bugs which necessitate special recovery techniques in code
  • DHCP lease time (on my router) is set to 120 seconds, the minimum allowed by the Asus RT56NU router, and it appears to allow renewal at 1/2 that, or every 60 seconds.
  • This enables 24 * 60, or 1440 DHCP renewals in 24 hrs vs a more typical one or two. This compresses one or two years of DHCP renewal into 24 hours.
  • Versions for Teensy3 with WIZ850io and the Arduino.org (not the same as Arduino.cc) M0 Pro with WIZnet W5500 Shield
  • Logs for this test

ILI9341_Test

  • Copied from WIZ820io_test repo 2017 Apr 23.
  • Existence of Ethernet and the ILI9341 touchscreen at same time: resets Ethernet and then ignores it, while testing the LCD and touchscreen.
  • the point is to show that Ethernet chip doesn't clash on the SPI lines.
  • Binaries saved in the bin subfolder

TempServer

  • TempServer Socket Debug logs showing Zombie Sockets
  • Simple temperature server which displays TMP102 temperature from onboard SALT temp sensor, or from a TMP102 breakout
  • Intended to be a proof of concept for a highly reliable, secure (not hackable or crashable) Teensy/WIZ850io data server
  • Uses a DDNS service and Port Forwarding to operate behind a router/firewall
  • First version stopped responding after some few thousand seconds. Turns out code optimization SMALLEST CODE breaks when printf is used just after client.stop() in Line 335
  • you can try the example at this IP address
  • some documentation about this apparent optimizer-related bug in this google drive file, anyone can enter comments
  • Working very reliably 2017 Jul 18 after too much effort tracing Zombie Sockets
  • running on custom board with also a buffered interface to ILI9341 touchscreen displaying temperature

Webserver

  • taken from the Arduino Ethernet Example "Webserver" with minimal changes to work on our hardware
  • but even this would not run for more than a few hours without becoming unresponsive to requests
  • I set this aside in 2017 May to work on other things

Webserver Simple

  • start over with Arduino Ethernet webserver example, making even fewer changes, only what is needed to get to run on our hardware, simpler than "Webserver"
  • but this also does not render reliably in standard browsers, fails W3 validator, and becomes unresponsive
  • back to TempServer as the focus, 2017 July

NTP Servers

  • NTP servers are a surprisingly complex topic, and server response can be fickle.
  • Typically we use the NTP Pool Project since it has fewer response fails than NIST
  • NTP messages have a lot to decode
  • Good NTP citizens don't request time more often than once per minute. Some servers will give you the Kiss of Death if you pester them.

NtpTest

  • just as it sounds, to use Network Time Protocol. Based on Arduino Ethernet example UdpNtpClient with mods for Teensy and W5500.
  • Test Logs

M0Pro version does not work and I don't know why.

Ntp_clock_set

  • Greatly enhanced output of NTP server response, by Scott. With a lot more info about the particular NTP server connection. Quite informative.
  • [Test Logs coming soon]

TODO

Current version of NtpTest runs for weeks without failing. The new NTP_clock_set is not so reliable.

About

WIZnet W5500 and WIZ850io test programs

Resources

License

Stars

Watchers

Forks

Packages

No packages published