khoih-prog / EthernetWebServer_SSL

Simple TLS/SSL Ethernet WebServer, HTTP Client and WebSocket Client library for for AVR, Portenta_H7, Teensy, SAM DUE, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, nRF52 and RASPBERRY_PI_PICO boards using Ethernet shields W5100, W5200, W5500, ENC28J60 or Teensy 4.1 NativeEthernet/QNEthernet. It now supports Ethernet TLS/SSL Client. The library supports HTTP/HTTPS GET and POST requests, provides argument parsing, handles one client at a time. It supports Arduino boards (SAM DUE, Atmel SAM3X8E ARM Cortex-M3, SAMD21, SAMD51, ESP8266, ESP32, Adafruit nRF52, Teensy boards) using Wiznet W5x00 or ENC28J60 network shields. Ethernet_Generic library is used as default for W5x00 with custom SPI
GNU General Public License v3.0
46 stars 10 forks source link

NativeEthernet compiles when it shouldn't - and fails #4

Closed signal-audio closed 3 years ago

signal-audio commented 3 years ago

Using a Teensy 4.0 with the W5500 reference design connected to the usual pins. With the 'WebServer' example, patches and dependencies installed as specified. defines.h changed as follows:

define USE_ETHERNET_WRAPPER true

define USE_ETHERNET false

define USE_ETHERNET_LARGE true

Compiler compiles three ethernet libraries: Ethernet, EthernetLarge and NativeEthernet despite this. Installed NativeEthernet & FNET to see if that helped, then I get

lib/NativeEthernet-master/src/NativeEthernet.cpp:126:30: error: 'FNET_CPU_ETH0_IF' was not declared in this scope if(fnet_netif_init(FNET_CPU_ETH0_IF, mac, 6) != FNET_ERR){

as the first several errors. Finally got it to compile after commenting out #include NativeEthernet.h in defines.h and EthernetWrapper_SSL.h. Without commenting it out the compiler loaded three ethernet libraries:

Dependency Graph
|-- <Ethernet>
|   |-- <SPI> 1.0
|-- <EthernetLarge> 2.0.0
|   |-- <SPI> 1.0
|-- <NativeEthernet>
|   |-- <FNET> 0.1.3
|-- <EthernetWebServer_SSL> 1.3.1
|   |-- <Functional-Vlpp> 1.0.2
|   |-- <Ethernet>
|   |   |-- <SPI> 1.0
|   |-- <EthernetLarge> 2.0.0
|   |   |-- <SPI> 1.0
|   |-- <NativeEthernet>
|   |   |-- <FNET> 0.1.3
|-- <SPI> 1.0

Now I'm down to two ethernet libraries. Getting closer.

PlatformIO Core 5.1.1 - Home 3.3.4 / Teensy 4.12.0 / framework-arduinoteensy 1.153.0

khoih-prog commented 3 years ago

Hi @signal-audio

I've test compiled the same example with Teensy 4.0 on Arduino IDE without error.

Selection_789


You have to check your PIO installation or settings. If you are not familiar or don't have enough experience with PIO, don't use it.

It seems that the issue is similar to these Missing stm32_def.h for Teensy 4.1 #14

I removed all unnecessary lines in library.json for our case and removed all folders under libdeps\teensy41 that we won't need. Can build now without any errors. We are still waiting for our Teensy 4.1, so will confirm if upload is successful and websocket example works when it arrives.

or ESP8266 issue platformio #14.

Those lines were added as precaution (more than just enough, covering all platforms / libraries) so that PIO users can easily select which are necessary.

If you're using platformio.ini, just remove the unnecessary dependencies or using , for example

lib_deps = 
; PlatformIO 4.x 
  Functional-Vlpp@~1.0.1
  Ethernet@~2.0.0
;  EthernetLarge@~2.0.0
;  Ethernet2@~1.0.4
;  Ethernet3@~1.5.3
;  EthernetENC@~2.0.0
;  UIPEthernet@~2.0.9
; PlatformIO 5.x  
;  khoih-prog/Functional-Vlpp@~1.0.1
;  PaulStoffregen/Ethernet@~2.0.0
;  PaulStoffregen/EthernetLarge@~2.0.0
;  adafruit/Ethernet2@~1.0.4
;  sstaub/Ethernet3@~1.5.3
;  jandrassy/EthernetENC@~2.0.0  
;  UIPEthernet/UIPEthernet@~2.0.9

I'm closing the issue now because this issue has nothing to do with the library.

Good Luck,