Compile fails on cloud compiler but works on desktop IDE

Hi all,

I want to use the TimerInterruptTest example (below) from the ESP8266TimerInterrupt library. In the desktop IDE v2 the code compiles and runs successfully, but in the cloud/web compiler there are errors.

I am using the same device selection (Node MCU ESP 12E), the same version of the library (1.60) and the same example code.

Does anyone have any suggestions how to overcome these errors? The location of this project will be really difficult to access and I need the cloud compiler and OTA updates to work, so I can't rely solely on the desktop IDE.

#if !defined(ESP8266)
  #error This code is designed to run on ESP8266 and ESP8266-based boards! Please check your Tools->Board setting.
#endif

// These define's must be placed at the beginning before #include "ESP8266TimerInterrupt.h"
// _TIMERINTERRUPT_LOGLEVEL_ from 0 to 4
// Don't define _TIMERINTERRUPT_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
#define TIMER_INTERRUPT_DEBUG         1
#define _TIMERINTERRUPT_LOGLEVEL_     1

// Select a Timer Clock
#define USING_TIM_DIV1                false           // for shortest and most accurate timer
#define USING_TIM_DIV16               false           // for medium time and medium accurate timer
#define USING_TIM_DIV256              true            // for longest timer but least accurate. Default

#include "ESP8266TimerInterrupt.h"

#define BUILTIN_LED     2       // Pin D4 mapped to pin GPIO2/TXD1 of ESP8266, NodeMCU and WeMoS, control on-board LED

volatile bool statusLed = false;
volatile uint32_t lastMillis = 0;

#define TIMER_INTERVAL_MS       1000

// Init ESP8266 timer 1
ESP8266Timer ITimer;

//=======================================================================
void IRAM_ATTR TimerHandler()
{
  static bool started = false;

  if (!started)
  {
    started = true;
    pinMode(BUILTIN_LED, OUTPUT);
  }

  digitalWrite(BUILTIN_LED, statusLed);  //Toggle LED Pin
  statusLed = !statusLed;

#if (TIMER_INTERRUPT_DEBUG > 0)
  Serial.println("Delta ms = " + String(millis() - lastMillis));
  lastMillis = millis();
#endif
}
//=======================================================================
//                               Setup
//=======================================================================
void setup()
{
  Serial.begin(115200);
  while (!Serial);

  delay(300);

  Serial.print(F("\nStarting TimerInterruptTest on ")); Serial.println(ARDUINO_BOARD);
  Serial.println(ESP8266_TIMER_INTERRUPT_VERSION);
  Serial.print(F("CPU Frequency = ")); Serial.print(F_CPU / 1000000); Serial.println(F(" MHz"));

  // Interval in microsecs
  if (ITimer.attachInterruptInterval(TIMER_INTERVAL_MS * 1000, TimerHandler))
  {
    lastMillis = millis();
    Serial.print(F("Starting ITimer OK, millis() = ")); Serial.println(lastMillis);
  }
  else
    Serial.println(F("Can't set ITimer correctly. Select another freq. or interval"));

}
//=======================================================================
//                MAIN LOOP
//=======================================================================
void loop()
{
}

When I try and compile it in the cloud compiler, I open the example and add the library. Two includes that are not in the IDE version of the sketch get added, ESP8266_ISR_Timer.h and ESP8266_ISR_Timer.hpp. The compile then fails with the following error:

In file included from /home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.h:49:0,
                 from /tmp/1904111783/TimerInterruptTest/TimerInterruptTest.ino:2:
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:108:10: error: variable or field 'IRAM_ATTR' declared void
     void IRAM_ATTR init();
          ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:108:10: error: expected ';' at end of member declaration
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:108:25: error: ISO C++ forbids declaration of 'init' with no type [-fpermissive]
     void IRAM_ATTR init();
                         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:111:10: error: variable or field 'IRAM_ATTR' declared void
     void IRAM_ATTR run();
          ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:111:10: error: expected ';' at end of member declaration
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:111:24: error: ISO C++ forbids declaration of 'run' with no type [-fpermissive]
     void IRAM_ATTR run();
                        ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:9: error: expected ';' at end of member declaration
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:78: error: ISO C++ forbids declaration of 'setInterval' with no type [-fpermissive]
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
                                                                              ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:121:9: error: expected ';' at end of member declaration
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback_p& f, void* p);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:121:9: error: redeclaration of 'int ISRTimer::IRAM_ATTR'
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:9: note: previous declaration 'int ISRTimer::IRAM_ATTR'
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:121:89: error: ISO C++ forbids declaration of 'setInterval' with no type [-fpermissive]
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback_p& f, void* p);
                                                                                         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:126:9: error: expected ';' at end of member declaration
     int IRAM_ATTR setTimeout(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:126:9: error: redeclaration of 'int ISRTimer::IRAM_ATTR'
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:9: note: previous declaration 'int ISRTimer::IRAM_ATTR'
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:126:77: error: ISO C++ forbids declaration of 'setTimeout' with no type [-fpermissive]
     int IRAM_ATTR setTimeout(const unsigned long& d, const timer_callback& f);
                                                                             ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:131:9: error: expected ';' at end of member declaration
     int IRAM_ATTR setTimeout(const unsigned long& d, const timer_callback_p& f, void* p);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:131:9: error: redeclaration of 'int ISRTimer::IRAM_ATTR'
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:9: note: previous declaration 'int ISRTimer::IRAM_ATTR'
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:131:88: error: ISO C++ forbids declaration of 'setTimeout' with no type [-fpermissive]
     int IRAM_ATTR setTimeout(const unsigned long& d, const timer_callback_p& f, void* p);
                                                                                        ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:136:9: error: expected ';' at end of member declaration
     int IRAM_ATTR setTimer(const unsigned long& d, const timer_callback& f, const unsigned& n);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:136:9: error: redeclaration of 'int ISRTimer::IRAM_ATTR'
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:9: note: previous declaration 'int ISRTimer::IRAM_ATTR'
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:136:94: error: ISO C++ forbids declaration of 'setTimer' with no type [-fpermissive]
     int IRAM_ATTR setTimer(const unsigned long& d, const timer_callback& f, const unsigned& n);
                                                                                              ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:141:9: error: expected ';' at end of member declaration
     int IRAM_ATTR setTimer(const unsigned long& d, const timer_callback_p& f, void* p, const unsigned& n);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:141:9: error: redeclaration of 'int ISRTimer::IRAM_ATTR'
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:9: note: previous declaration 'int ISRTimer::IRAM_ATTR'
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:141:105: error: ISO C++ forbids declaration of 'setTimer' with no type [-fpermissive]
     int IRAM_ATTR setTimer(const unsigned long& d, const timer_callback_p& f, void* p, const unsigned& n);
                                                                                                         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:144:10: error: expected ';' at end of member declaration
     bool IRAM_ATTR changeInterval(const unsigned& numTimer, const unsigned long& d);
          ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:144:10: error: redeclaration of 'bool ISRTimer::IRAM_ATTR'
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:9: note: previous declaration 'int ISRTimer::IRAM_ATTR'
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:144:83: error: ISO C++ forbids declaration of 'changeInterval' with no type [-fpermissive]
     bool IRAM_ATTR changeInterval(const unsigned& numTimer, const unsigned long& d);
                                                                                   ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:147:10: error: variable or field 'IRAM_ATTR' declared void
     void IRAM_ATTR deleteTimer(const unsigned& timerId);
          ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:147:10: error: expected ';' at end of member declaration
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:147:55: error: ISO C++ forbids declaration of 'deleteTimer' with no type [-fpermissive]
     void IRAM_ATTR deleteTimer(const unsigned& timerId);
                                                       ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:150:10: error: variable or field 'IRAM_ATTR' declared void
     void IRAM_ATTR restartTimer(const unsigned& numTimer);
          ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:150:10: error: expected ';' at end of member declaration
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:150:57: error: ISO C++ forbids declaration of 'restartTimer' with no type [-fpermissive]
     void IRAM_ATTR restartTimer(const unsigned& numTimer);
                                                         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:153:10: error: expected ';' at end of member declaration
     bool IRAM_ATTR isEnabled(const unsigned& numTimer);
          ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:153:10: error: redeclaration of 'bool ISRTimer::IRAM_ATTR'
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:9: note: previous declaration 'int ISRTimer::IRAM_ATTR'
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:153:54: error: ISO C++ forbids declaration of 'isEnabled' with no type [-fpermissive]
     bool IRAM_ATTR isEnabled(const unsigned& numTimer);
                                                      ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:156:10: error: variable or field 'IRAM_ATTR' declared void
     void IRAM_ATTR enable(const unsigned& numTimer);
          ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:156:10: error: expected ';' at end of member declaration
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:156:51: error: ISO C++ forbids declaration of 'enable' with no type [-fpermissive]
     void IRAM_ATTR enable(const unsigned& numTimer);
                                                   ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:159:10: error: variable or field 'IRAM_ATTR' declared void
     void IRAM_ATTR disable(const unsigned& numTimer);
          ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:159:10: error: expected ';' at end of member declaration
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:159:52: error: ISO C++ forbids declaration of 'disable' with no type [-fpermissive]
     void IRAM_ATTR disable(const unsigned& numTimer);
                                                    ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:162:10: error: variable or field 'IRAM_ATTR' declared void
     void IRAM_ATTR enableAll();
          ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:162:10: error: expected ';' at end of member declaration
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:162:30: error: ISO C++ forbids declaration of 'enableAll' with no type [-fpermissive]
     void IRAM_ATTR enableAll();
                              ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:165:10: error: variable or field 'IRAM_ATTR' declared void
     void IRAM_ATTR disableAll();
          ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:165:10: error: expected ';' at end of member declaration
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:165:31: error: ISO C++ forbids declaration of 'disableAll' with no type [-fpermissive]
     void IRAM_ATTR disableAll();
                               ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:169:10: error: variable or field 'IRAM_ATTR' declared void
     void IRAM_ATTR toggle(const unsigned& numTimer);
          ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:169:10: error: expected ';' at end of member declaration
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:169:51: error: ISO C++ forbids declaration of 'toggle' with no type [-fpermissive]
     void IRAM_ATTR toggle(const unsigned& numTimer);
                                                   ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:172:12: error: expected ';' at end of member declaration
     int8_t IRAM_ATTR getNumTimers();
            ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:172:12: error: redeclaration of 'int8_t ISRTimer::IRAM_ATTR'
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:9: note: previous declaration 'int ISRTimer::IRAM_ATTR'
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:172:35: error: ISO C++ forbids declaration of 'getNumTimers' with no type [-fpermissive]
     int8_t IRAM_ATTR getNumTimers();
                                   ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:175:12: error: expected ';' at end of member declaration
     int8_t IRAM_ATTR getNumAvailableTimers() 
            ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:175:12: error: redeclaration of 'int8_t ISRTimer::IRAM_ATTR'
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:9: note: previous declaration 'int ISRTimer::IRAM_ATTR'
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:175:44: error: ISO C++ forbids declaration of 'getNumAvailableTimers' with no type [-fpermissive]
     int8_t IRAM_ATTR getNumAvailableTimers() 
                                            ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:191:12: error: expected ';' at end of member declaration
     int8_t IRAM_ATTR setupTimer(const unsigned long& d, void* f, void* p, bool h, const unsigned& n);
            ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:191:12: error: redeclaration of 'int8_t ISRTimer::IRAM_ATTR'
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:9: note: previous declaration 'int ISRTimer::IRAM_ATTR'
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:191:100: error: ISO C++ forbids declaration of 'setupTimer' with no type [-fpermissive]
     int8_t IRAM_ATTR setupTimer(const unsigned long& d, void* f, void* p, bool h, const unsigned& n);
                                                                                                    ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:194:12: error: expected ';' at end of member declaration
     int8_t IRAM_ATTR findFirstFreeSlot();
            ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:194:12: error: redeclaration of 'int8_t ISRTimer::IRAM_ATTR'
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:116:9: note: previous declaration 'int ISRTimer::IRAM_ATTR'
     int IRAM_ATTR setInterval(const unsigned long& d, const timer_callback& f);
         ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:194:40: error: ISO C++ forbids declaration of 'findFirstFreeSlot' with no type [-fpermissive]
     int8_t IRAM_ATTR findFirstFreeSlot();
                                        ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer.hpp:88:27: error: expected initializer before 'ISRTimer'
 #define ESP8266_ISR_Timer ISRTimer
                           ^
/home/builder/Arduino/libraries/esp8266timerinterrupt_1_6_0/src/ESP8266_ISR_Timer-Impl.h:69:16: note: in expansion of macro 'ESP8266_ISR_Timer'
 void IRAM_ATTR ESP8266_ISR_Timer::init() 
                ^

Error during build: exit status 1

If I remove ESP8266_ISR_Timer.h and ESP8266_ISR_Timer.hpp, there are far fewer errors, but it still fails to compile:

/tmp/717681372/TimerInterruptTest/TimerInterruptTest.ino:61:16: error: expected initializer before 'TimerHandler'
 void IRAM_ATTR TimerHandler()
                ^
/tmp/717681372/TimerInterruptTest/TimerInterruptTest.ino:61:16: error: expected initializer before 'TimerHandler'
 void IRAM_ATTR TimerHandler()
                ^

Error during build: exit status 1

Hi @sciroccotorc. The "ESP8266TimerInterrupt" library uses the "esp8266" boards platform's IRAM_ATTR macro:

That macro was added in version 3.0.0 of the "esp8266" boards platform.

The reason you can use the IRAM_ATTR macro when compiling sketches with Arduino IDE 2.3.2 is that you have version 3.0.0 or newer of the "esp8266" boards platform installed on your computer.

Version 2.5.0 of the "esp8266" boards platform is installed on the Arduino Cloud server, so you only have access to the API provided by that version of the platform when compiling Arduino sketches in Cloud Editor. This does not provide the IRAM_ATTR macro used by the ESP8266TimerInterrupt, which unfortunately makes the library incompatible with Arduino Cloud. I checked to see if an older version of the library is compatible but the incompatibility goes all the way back to the first release of the library.

IRAM_ATTR is a drop-in replacement for the ICACHE_RAM_ATTR macro:

so you should be able to fix the problem by replacing all occurrences of IRAM_ATTR in the library's source code with ICACHE_RAM_ATTR. Since the macro is used throughout the library's files, I think the easiest way to accomplish that would be to open a copy of the library's source files in a text editor on your compute and then do a search and replace using the text editor, then import your modified version of the library to Arduino Cloud:

https://docs.arduino.cc/arduino-cloud/cloud-editor/import-your-sketchbook-and-libraries-to-the-web-editor/

Hi @ptillisch . Thanks for the very clear reply. I changed the reference in my sketch and it worked. I did not seem to have to change every instance in the library, fortunately.

At the risk of going off-topic, I have another sketch that also fails to compile on the cloud compiler while succeeding on the desktop IDE:

Werner Rothschopf's NTP for the ESP8266 including day light saving time (DST) without 3rd party library

/tmp/1787854866/new_sketch_1719624156976/new_sketch_1719624156976.ino: In function 'void setup()':
/tmp/1787854866/new_sketch_1719624156976/new_sketch_1719624156976.ino:63:34: error: invalid conversion from 'const char*' to 'long int' [-fpermissive]
   configTime(MY_TZ, MY_NTP_SERVER); // --> Here is the IMPORTANT ONE LINER needed in your sketch!
                                  ^
/tmp/1787854866/new_sketch_1719624156976/new_sketch_1719624156976.ino:63:34: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
/tmp/1787854866/new_sketch_1719624156976/new_sketch_1719624156976.ino:63:34: error: too few arguments to function 'void configTime(long int, int, const char*, const char*, const char*)'
In file included from /tmp/arduino-build-D5B79ED165D8689A84A9DEEF292EFB81/sketch/new_sketch_1719624156976.ino.cpp:1:0:
/home/builder/.arduino15/packages/esp8266/hardware/esp8266/2.5.0/cores/esp8266/Arduino.h:297:17: note: declared here
 extern "C" void configTime(long timezone, int daylightOffset_sec,
                 ^

Error during build: exit status 1

This claims to work with the ESP8266 core 2.7.4 and 3.0.2. I suppose this will be a similar problem with the Arduino server only having the older 2.5.0 core version. Seems to be due to the format of the timezone and DST offset; changing these to ints seems to solve the problem.

Just out of curiosity, what would trigger Arduino to update their server to the more recent ESP8266 core? I bet I'm not the only one coming across this type of issue.

You are welcome. Congratulations on finding a solution to both of the problems! I'm glad it is working now. Thank you for taking the time to post an update.

I don't have any information regarding plans for an update.

I try to help Arduino Cloud users out here on the forum as I am able, but I'm not directly involved in the development and maintenance of the system so I'm not very informed on such subjects.

I think it is something that must be done with care since the update that adds the features you need might break another user's project or a library. That's not to say it shouldn't be done since there are surely some very valuable enhancements and bug fixes that have been made in the 5 years of development of the "esp8266" boards platform that have occurred since the time of the 2.5.0 release installed on Arduino Cloud, but certainly Arduino would first need to make sure our own "ArduinoIoTCloud" library (and its dependencies) are working with the new version, and should also make an effort to clearly communicate about the update to the Arduino Cloud users.