Has anyone successfully run the khoi-prog EthernetWebServer example program (https://github.com/khoih-prog/EthernetWebServer/tree/master/examples/AdvancedWebServer v1.3.0) on a Teensy4.1 with MagJack ethernet? I’m trying the unaltered example code (other than patches and debug) without success.
Using the Teensyduino IDE (Arduino 1.8.13, Teensyduino 1.53), I’ve:
I see this serial output:
When I launch a URL against 192.168.1.70, it immediately drops the connection (ping), and I get into what I suspect is an infinite loop (since the board starts to heat up). I’ve done some debugging trying to narrow it down:
Stepping into Parsing-impl.h (from the khoi-prog EthernetWebServer), which iteratively calls client.readStringUntil(char, size_t) in the teensy4 patched stream.cpp, I see the following:
The khoih-prog updates seem to suggest this should work, but I may be debugging something that is known incompatible so first wonders if others have tried with success.
Thanks.
Using the Teensyduino IDE (Arduino 1.8.13, Teensyduino 1.53), I’ve:
- verified I’m using NativeEthernet
- verified I’m using Functional-Vlpp
- updated the khoi-prog patches for teensy4 (boards.txt & https://github.com/khoih-prog/Ether...er/Packages_Patches/hardware/teensy/avr/cores)
- confirmed I get a valid ping return for 192.168.1.70
- put in a series of debug printlns, to ultimately trace it to what appears to be a failure in Stream.cpp upon exiting the readStringUntil(‘\r’) after reading a newline character
- verified virtually identical results from Chrome browser
I see this serial output:
Code:
Starting AdvancedWebServer_NativeEthernet on TEENSY 4.1 with Custom Ethernet using Teensy 4.1 NativeEthernet Library
EthernetWebServer v1.3.0
[ETHERNET_WEBSERVER] ======== USE_NATIVE_ETHERNET ========
[ETHERNET_WEBSERVER] Default SPI pinout:
[ETHERNET_WEBSERVER] MOSI: 11
[ETHERNET_WEBSERVER] MISO: 12
[ETHERNET_WEBSERVER] SCK: 13
[ETHERNET_WEBSERVER] SS: 10
[ETHERNET_WEBSERVER] =========================
[ETHERNET_WEBSERVER] Board : TEENSY 4.1 , setCsPin: 10
=========================
Currently Used SPI pinout:
MOSI:11
MISO:12
SCK:13
SS:10
=========================
Using mac index = 2
Connected! IP address: 192.168.1.70
When I launch a URL against 192.168.1.70, it immediately drops the connection (ping), and I get into what I suspect is an infinite loop (since the board starts to heat up). I’ve done some debugging trying to narrow it down:
Stepping into Parsing-impl.h (from the khoi-prog EthernetWebServer), which iteratively calls client.readStringUntil(char, size_t) in the teensy4 patched stream.cpp, I see the following:
Code:
After retrieving:
GET / HTTP/1.1
client.readStringUntil(‘\r’) yields
Host: 192.168.1.70
client.readStringUntil(‘\n’) yields
<newline>
client.readStringUntil(‘\r’) yields
Upgrade-Insecure-Requests: 1
client.readStringUntil(‘\n’) yields
<newline>
client.readStringUntil(‘\r’) yields
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
client.readStringUntil(‘\n’) yields
<newline>
client.readStringUntil(‘\r’) yields
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safa
client.readStringUntil(‘\n’) yields
ri/605.1.15
client.readStringUntil(‘\r’) yields
Accept-Language: en-us
client.readStringUntil(‘\n’) yields
<newline>
client.readStringUntil(‘\r’) yields
Accept-Encoding: gzip, deflate
client.readStringUntil(‘\n’) yields
<newline>
client.readStringUntil(‘\r’) yields
Connection: keep-alive
client.readStringUntil(‘\n’) yields
<newline>
client.readStringUntil(‘\r’) yields
<newline>
And then drops ping
The khoih-prog updates seem to suggest this should work, but I may be debugging something that is known incompatible so first wonders if others have tried with success.
Thanks.