ArduinoThread icon indicating copy to clipboard operation
ArduinoThread copied to clipboard

Incompatible with ESP32

Open SciLor opened this issue 7 years ago • 9 comments
trafficstars

The library seems not to work on the ESP32. Boards: https://github.com/espressif/arduino-esp32

I always get "error: 'Thread' has not been declared" Using the ESP8266 boards it works fine

SciLor avatar Jan 07 '18 15:01 SciLor

See https://github.com/SciLor/ESP8266_Hyperion_LED-Controller/issues/34

SciLor avatar Apr 29 '18 13:04 SciLor

Can you please check #include <Thread.h> is the first included file from the library, and that it is indeed included?

Also, please post the code here so we can understand better.

(Luckily, yesterday I was using a ESP32... but did not use it with ArduinoThread)

ivanseidel avatar Apr 30 '18 13:04 ivanseidel

The code is here: https://github.com/SciLor/ESP8266_Hyperion_LED-Controller/blob/develop/HyperionRGB/EnhancedThread.h

You can reproduce the problem easily: Create a new Arduino Sketch. Create an EnhancedThread.cpp with:

#include "EnhancedThread.h"
void EnhancedThread::run() {
  Thread::run();
}

and EnhancedThread.h

#include <Thread.h>
class EnhancedThread : public Thread {
  public:
    void
      run(void);
};

Select the Wemos LOLIN32 or ESP32 Devboard as device. Compile - error

Known workarounds: Copy the ArduinoThread lib into the projects folder or combine the h+cpp file into one file.

Use Arduino / ESP8266 and it works fine.

SciLor avatar Apr 30 '18 18:04 SciLor

Try including Thread.h and ThreadController.h in your main file. That shouls work

On Mon, Apr 30, 2018, 3:58 PM SciLor [email protected] wrote:

The code is here:

https://github.com/SciLor/ESP8266_Hyperion_LED-Controller/blob/develop/HyperionRGB/EnhancedThread.h

You can reproduce the problem easily: Create a new Arduino Sketch. Create an EnhancedThread.cpp with:

#include "EnhancedThread.h" void EnhancedThread::run() { Thread::run(); }

and EnhancedThread.h

#include <Thread.h> class EnhancedThread : public Thread { public: void run(void); };

Select the Wemos LOLIN32 or ESP32 Devboard as device. Compile - error

Known workarounds: Copy the ArduinoThread lib into the projects folder or combine the h+cpp file into one file.

Use Arduino / ESP8266 and it works fine.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ivanseidel/ArduinoThread/issues/30#issuecomment-385495483, or mute the thread https://github.com/notifications/unsubscribe-auth/AC9Vr21Ckyd0hB-7vSUTdN4_4bttTB_Yks5tt17dgaJpZM4RVsA1 .

ivanseidel avatar Apr 30 '18 19:04 ivanseidel

I have added #include <Thread.h> in the other 2 files without success. The error stays the same.

SciLor avatar Apr 30 '18 19:04 SciLor

I'm testing this lib with a standard ESP32 and Visual Code. It works fine.

phoax avatar Jul 26 '18 16:07 phoax

I am using the Arduino Software

SciLor avatar Jul 26 '18 17:07 SciLor

I'm using this library with ESP32 without any problem. For nodemcu and wimos.

patrickelectric avatar Jul 31 '18 12:07 patrickelectric