khoih-prog / WebSockets2_Generic

A WebSocket Server and Client library for Arduino, based on RFC6455, for writing modern Websockets applications. Now support ESP8266, ESP32 (including ESP32-S2 Saola, AI-Thinker ESP-12K, WT32_ETH01, etc.), nRF52, SAMD21, SAMD51, SAM DUE, STM32F/L/H/G/WB/MP1, Teensy, RP2040-based, etc. boards, with WiFiNINA, Teensy 4.1 NativeEthernet/QNEthernet, Ethernet W5x00 / ENC28J60 / LAN8742A / LAN8720, ESP8266 / ESP32-AT modules/shields, as well as SINRIC / Alexa / Google Home
GNU General Public License v3.0
81 stars 30 forks source link

Missing stm32_def.h for Teensy 4.1 #14

Closed hendrikjvr closed 3 years ago

hendrikjvr commented 3 years ago

PlatformIO Core, version 5.1.0 Windows 10 Enterprise Board: Teensy 4.1 Framework: Arduino

Hi, I am trying to build a project in PlatfromIO for the Teensy 4.1 with this library added to platform.ini. It does not compile successfully. I get the following error 8 times before the compilation is terminated:

".pio\libdeps\teensy41\STM32Ethernet\src\utility\stm32_eth.h:42:23: fatal error: stm32_def.h: No such file or directory"

Why would there be STM32 files under the teensy41 core?

My platform.ini file looks as follows:

[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
lib_deps = 
    https://github.com/vjmuzik/FNET.git
    https://github.com/vjmuzik/NativeEthernet.git
    https://github.com/sstaub/TeensyID.git
    https://github.com/khoih-prog/WebSockets2_Generic.git

Steps to reproduce:

  1. Open PIO project for Teensy 4.1 board
  2. Add Github link for FNET to platformo.ini file: https://github.com/vjmuzik/FNET.git
  3. Add Github link for NativeEthernet to platformio.ini file: https://github.com/vjmuzik/NativeEthernet.git
  4. Add Github link for TeensyID to platformio.ini file: https://github.com/sstaub/TeensyID.git
  5. Add Github link for WebSockets2_Generic to platformio.ini file: https://github.com/khoih-prog/WebSockets2_Generic.git
  6. Build project
khoih-prog commented 3 years ago

Thanks for using the library.

As I don't spend time with PIO and don't have good experience with it, I can only suggest that you check and remove unnecessary lines in library.json. For example:

library.json #L70-L87

   {
      "owner": "khoih-prog",
      "name": "EthernetWebServer_STM32",
      "version": "^1.1.0",
      "platforms": ["*"]
    },
    {
      "owner": "stm32duino",
      "name": "STM32duino LwIP",
      "version": "^2.1.2",
      "platforms": ["ststm32"]
    },
    {
      "owner": "stm32duino",
      "name": "STM32Ethernet",
      "version": "^1.2.0",
      "platforms": ["ststm32"]
    },

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 that deletion won't solve your issue, I suggest you post on PIO forum to ask for help from many experienced experts there.

If you find out and solve the issue, please giving back and help other users by posting the fix here.

Good Luck,

hendrikjvr commented 3 years ago

Thanks for your feedback. I will revert here if issue is resolved.

hendrikjvr commented 3 years ago

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.

khoih-prog commented 3 years ago

I'm closing this issue now. If you have new issue after receiving Teensy 4.1, please post new issue.