JoaoLopesF / RemoteDebug

Library for Arduino to debug projects over WiFi, with web app or telnet, with print commands like Serial Monitor
MIT License
613 stars 127 forks source link

SHA resource no longer correct for ESP32 #87

Open TheMadTexan42 opened 1 year ago

TheMadTexan42 commented 1 year ago

Can no longer build on ESP32 due to a change in the ESP32 SHA libraries.

hwcrypto/sha.h no longer exists.

The workaround seems to be to replace

include <hwcrypto/sha.h>

in \WebSockets.cpp (line42) by

include <esp32/sha.h>

(see https://github.com/espressif/esp-idf/issues/3245)

However this is a recent change so ultimately it depends on the toolchain version you have in place for the ESP

alex-eri commented 1 year ago

warning esp32/sha.h is deprecated, please use sha_parallel_engine.h instead

JonLevin25 commented 1 year ago

Is there a way to #define <hwcrypto/sha.h> <esp32/sha.h> from user code, to avoid changing library?

The preprocessor doesn't seem to like it

In file included from src/main.cpp:5:
src/remote_debug.h:31:9: error: macro names must be identifiers
 #define <hwcrypto/sha.h> <esp32/sha.h>
quazardous commented 2 months ago

here is a good patch

https://github.com/Links2004/arduinoWebSockets/issues/738#issuecomment-1043356325

  #if ESP_IDF_VERSION_MAJOR >= 4
    #if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(1, 0, 6) )
      #include "sha/sha_parallel_engine.h"
    #else
      #include <esp32/sha.h>
    #endif  
  #else
    #include <hwcrypto/sha.h>
  #endif
quazardous commented 2 months ago

crap just use https://github.com/karol-brejna-i/RemoteDebug (RemoteDebug2)