khoih-prog / EthernetWebServer

This is simple yet complete WebServer library for AVR, AVR Dx, Portenta_H7, Teensy, SAM DUE, SAMD21/SAMD51, nRF52, STM32, RP2040-based, etc. boards running Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Coexisting now with `ESP32 WebServer` and `ESP8266 ESP8266WebServer` libraries. Ethernet_Generic library is used as default for W5x00 with custom SPI
MIT License
178 stars 49 forks source link

Compile Error on Teensy 4.1 #14

Closed jimmie11 closed 3 years ago

jimmie11 commented 3 years ago

Thank you for your efforts. I was very happy to find a library that works on Teensy 4.1 however I am unable to compile the WebServer example. I had download the VLP library and also copied boards.txt but this did not help. I also tried changing Ethernet.h to NativeEthernet.h but his did not help either.

Here is the error:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Stream.h:68:6: error: 'int Stream::timedRead()' is private

int timedRead();

  ^

C:\Users\TTC\Documents\Arduino\libraries\EthernetWebServer-master\src\Ethernet_HTTPClient\Ethernet_HttpClient.cpp:642:13: error: within this context

 int c = timedRead();

         ^

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/HardwareSerial.h:106:0,

             from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/WProgram.h:46,

             from C:\Users\TTC\AppData\Local\Temp\arduino_build_394779/pch/Arduino.h:6,

             from C:\Users\TTC\Documents\Arduino\libraries\EthernetWebServer-master\src/Ethernet_HTTPClient/Ethernet_HttpClient.h:43,

             from C:\Users\TTC\Documents\Arduino\libraries\EthernetWebServer-master\src\Ethernet_HTTPClient\Ethernet_HttpClient.cpp:44:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Stream.h:68:6: error: 'int Stream::timedRead()' is private

int timedRead();

  ^

C:\Users\TTC\Documents\Arduino\libraries\EthernetWebServer-master\src\Ethernet_HTTPClient\Ethernet_HttpClient.cpp:642:23: error: within this context

 int c = timedRead();

                   ^

Multiple libraries were found for "Ethernet.h" Used: C:\Program Files (x86)\Arduino\libraries\Ethernet Not used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Ethernet-master Error compiling for board Teensy 4.1.

jimmie11 commented 3 years ago

I made the following changes and it is now working.

define USE_ETHERNET false

//.... //....

define USE_CUSTOM_ETHERNET true

elif USE_CUSTOM_ETHERNET

include "NativeEthernet.h"

khoih-prog commented 3 years ago

Thanks for your interest in the library and the solution. I'll include it in the next release. It'll definitely be very helpful for other Teensy users.

jimmie11 commented 3 years ago

Hello Khoi,

Thank you for your efforts in making your library available.

I forgot to mention one more change that is needed:

In:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\Stream.h

Change from private to public.

public: char read_error; int timedRead(); int timedPeek(); int peekNextDigit();

Regards.

On Thu, Dec 3, 2020 at 10:54 AM Khoi Hoang notifications@github.com wrote:

Thanks for your interest in the library and the solution. I'll include it in the next release. It'll definitely be very helpful for other Teensy users.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/khoih-prog/EthernetWebServer/issues/14#issuecomment-738097402, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5ZBNY3NRR5H7JO643O3N3SS6YDLANCNFSM4UMBSOVA .

khoih-prog commented 3 years ago

It'll be great if you can post your experience on Teensy Forum to help Teensy users there.

Teensy 4.1 NativeEthernet Library

BR

jimmie11 commented 3 years ago

I posted the info at this link:

https://forum.pjrc.com/threads/64953-Teensy-4-1-Ethernet-Problems?p=262054#post262054

On Thu, Dec 3, 2020 at 1:34 PM Khoi Hoang notifications@github.com wrote:

It'll be great if you can post your experience on Teensy Forum to help Teensy users there.

Teensy 4.1 NativeEthernet Library https://forum.pjrc.com/threads/60857-T4-1-Ethernet-Library

BR

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/khoih-prog/EthernetWebServer/issues/14#issuecomment-738206694, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5ZBN52T7DHR5HZH7RA6G3SS7K2BANCNFSM4UMBSOVA .

khoih-prog commented 3 years ago

Hi @jimmie11

Just release EthernetWebServer v1.2.0

Can you test to see if there is any more issue and give feedback.

Your contribution is noted in Contributions-and-Thanks


Release v1.2.0

  1. Add support to NativeEthernet Library for Teensy 4.1
  2. Add Version String.
khoih-prog commented 3 years ago

Hi @jimmie11

Just release EthernetWebServer_SSL v1.3.0

Can you test to see if there is any more issue and give feedback.

Your contribution is noted in Contributions-and-Thanks


Release v1.3.0

  1. Add support to NativeEthernet Library for Teensy 4.1
teatralnik commented 3 years ago

Thanks to everyone for solving this isue!