Can ping Teensy and Wiz920IO, but webserver demo times out.

Status
Not open for further replies.
I built a combo of a Teensy 3.2 and Wiz820IO module using the PJRC adapter board. I had the webserver demo running at one time, then catastrophe struck and my PC was wiped out. I rebuilt the Arduino environment that I thought I needed on a new PC, but I cannot get the WebServer demo to work.

I have a clean install of Arduino 1.6.5, with Teensyduino 1.25 installed afterward. I am using the WebServer example from File -> Examples -> Ethernet -> WebServer.

I can successfully ping the Teensy, but I think that echoes are handled by the Wiz820IO directly. My interpretation of a WireShark capture is that the socket connection never completes.

Am I missing a library or other tweak that is required to make the webserver example work?
 
Have you made any changes to the WebServer example sketch? I see that it uses a hard coded MAC address and IP address. I have a vague recollection that I needed to use a "real" MAC Address in the past. Best is to use the T3Mac library to get the MAC address from the Teensy 3.x. It is very simple to use. Also, make sure the IP Address that you use is one that is actually within your subnet.

I hope this helps.
 
Last edited:
T3MAC tried, but didn't help.

I think it should be OK to use the hardcoded "DEAD BEEF FEED" MAC address because the upper byte (DE) has bit 1 set and bit 0 clear, for a unicast locally administered MAC address, but I tried using your suggestion of using T3MAC.

T3MAC broke the project initially. My code was waiting for the serial connection before calling read_mac() so I could print_mac() the result. Somehow, T3MAC interferes with the serial port, and PuTTY couldn't make the serial connection. When I put a delay(1) before read_mac(), I was able to make the serial connection and see the MAC address printed.

Unfortunately, the webserver still doesn't work. I've tried a few different IP addresses and subnet combinations, and even different network switches, but nothing seems to make a difference. I'll probably try a direct connect with a crossover cable next.

My new PC is a Windows 10 machine, whereas my old one was Windows 7. I tried multiple browsers, and even used a Linux PC to try the web connection. All have failed so far.

I feel I am missing something basic. How does the project know that a Wiz820IO device is being used? Maybe it thinks I have different network hardware. Is there a #define somewhere in the library that I am supposed to be tweaking?
 
I just tried the DhcpAddressPrinter and the WebServer example sketches on a Teensy 3.1. For the WebServer sketch, I did change the WebServer IP Address to 192.168.2.177 to match my LAN subnet. Both worked the first time.

EDIT: I made no other changes to either sketch.

I'm using Arduino 1.6.5 and Teensyduino 1.24.

Again, I hope this helps.

I don't know the details, but the Ethernet library figures out, at runtime, that it is a Wiz820io rather than a W5100. So there are no #DEFINEs that need to be changed.

Can you describe your hardware setup in detail. Is it a stand-alone Teensy 3.2 or do you have peripherals attached? EDIT: ... other than the PJRC adapter board and Wiz820io.
 
Last edited:
If you have the SD card installed, or any other SPI devices connected, I'd highly recommend adding the 6 lines from the Chip Select Pins During Initialization at the end of the WIZ820+SD page. SPI devices can interfere with each other. Driving those pins before starting the libraries will solve any such problems.

Turn on Verbose Info while compiling in File > Preferences. After compiling, scroll up to the beginning of the messages and look for the lines that tell you exactly which location Arduino used for each library. The normal Ethernet library from Arduino, in libraries/Ethernet, does not support the W5200. The one Teensyduino installs in hardware/teensy/avr/libraries/Ethernet is the copy with W5200. If you're using another copy of Ethernet, it won't recognize the W5200 chip.

Many other copies of the Ethernet library exist on the net. Most only work with one chip. I put quite a lot of work in the Teensyduino version to automatically detect W5100 vs W5200. If you've been downloading other copies of libraries, odds are you may have several by now in various places. Those messages in Verbose Info about exactly which version Arduino really uses are there to help you!

Teensyduino's W5100 vs W5200 detection is done in Ethernet.begin(). It looks for a W5100 first, then the W5200. The W5200 requires its reset pin. That pin should automatically be connected if you're using the PJRC adaptor. But if you connected only the normal 4 SPI signals, please be aware the W5200 requires a 5th reset signal. This is different from the W5100 which can work without reset. Sadly, Wiznet didn't design the W5200 with graceful startup, nor with its internal SPI state updated by the CS signal, so you must have the reset signal to make the W5200 work reliably.
 
Those messages which tell you exactly what libraries are used are in Arduino 1.6.3 and 1.6.5. If you're using an older version, I highly recommend upgrading. Strange problems from duplicate libraries are almost impossible to resolve on the older versions.
 
Might be a NIC problem... ChatServer connection from a different (Linux) PC works.

Using Arduino 1.6.5. The Wiz820IO adapter SD card slot is empty.
Libraries (from verbose):
Using library SPI in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI (1.0.x format)
Using library Ethernet in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Ethernet (1.0.x format)

I think the problem might be network card incompatibilities. My PC has a Killer e2200 Gigabit NIC, which is working fine for all of my other networking, including other embedded IPv4 devices.

I switched to using the ChatServer example. That also doesn't work on my PC, but on a separate Ubuntu Linux machine I can now use telnet to connect to the Teensy ChatServer app. My conclusion is that either the Wiz820IO chip itself, or the setup done by the Arduino driver can't handle something about the attempted socket connections from the e2200 NIC. Maybe there is a driver setting I need to tweak.

I've attached a ZIP of a Wireshark capture session, with my trying and failing to make the chat server connection. I also attached a printout of the traffic. I'm not enough of a networking expert to figure out what might be wrong, but maybe the answer would be obvious to somebody else.
 

Attachments

  • chatserver_failure.zip
    680 bytes · Views: 108
  • chatserver_failure.txt
    3.6 KB · Views: 160
It turns out that it was some kind of NIC driver problem. I downgraded the network card driver to a more basic one, and it started working. I suspect the issue might have to do with TCP SACK which is known to confuse some network stacks, but I have no proof. I tried a network search to see whether the Wiz820IO could handle TCP SACK, but came up with no hits. In any event, I'm past the problem.
 
Status
Not open for further replies.
Back
Top