Latest Thinger.io versio doesn;t compile with tinygsm library

when i updated thinger.io library to latest version and trying to compile it i got these messages even TinyGSM was the latest version and compile successfully with thinger.io 2.17

Blockquote

In file included from C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/thinger/thinger.h:29:0,
from C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:29,
from C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:28,
from C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\examples\Arduino\ArduinoTinyGSM\ArduinoTinyGSM.ino:12:
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:390:66: error: expected ‘;’ at end of member declaration
void (*stream_listener)(uint16_t, unsigned long, bool enabled) get_stream_listener(){
^
In file included from C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:28:0,
from C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\examples\Arduino\ArduinoTinyGSM\ArduinoTinyGSM.ino:12:
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:540:34: error: ‘std::function’ has not been declared
void set_state_listener(std::function<void(THINGER_STATE)> state_listener){
^~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:540:42: error: expected ‘,’ or ‘…’ before ‘<’ token
void set_state_listener(std::function<void(THINGER_STATE)> state_listener){
^
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:557:10: error: ‘function’ in namespace ‘std’ does not name a template type
std::function<void(THINGER_STATE)> state_listener_;
^~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function ‘virtual void ThingerClient::run_reboot()’:
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:361:20: error: ‘WDTO_15MS’ was not declared in this scope
wdt_enable(WDTO_15MS);
^~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:361:9: error: ‘wdt_enable’ was not declared in this scope
wdt_enable(WDTO_15MS);
^~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:361:9: note: suggested alternative: ‘mutable’
wdt_enable(WDTO_15MS);
^~~~~~~~~~
mutable
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function ‘virtual void ThingerClient::thinger_state_listener(ThingerClient::THINGER_STATE)’:
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:425:12: error: ‘state_listener_’ was not declared in this scope
if(state_listener_) state_listener_(state);
^~~~~~~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:425:12: note: suggested alternative: ‘set_state_listener’
if(state_listener_) state_listener_(state);
^~~~~~~~~~~~~~~
set_state_listener
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function ‘void ThingerClient::set_state_listener(int)’:
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:541:9: error: ‘state_listener_’ was not declared in this scope
state_listener_ = state_listener;
^~~~~~~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:541:9: note: suggested alternative: ‘set_state_listener’
state_listener_ = state_listener;
^~~~~~~~~~~~~~~
set_state_listener
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:541:27: error: ‘state_listener’ was not declared in this scope
state_listener_ = state_listener;
^~~~~~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:541:27: note: suggested alternative: ‘set_state_listener’
state_listener_ = state_listener;
^~~~~~~~~~~~~~
set_state_listener
In file included from C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\examples\Arduino\ArduinoTinyGSM\ArduinoTinyGSM.ino:12:0:
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h: At global scope:
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:123:30: error: ‘std::function’ has not been declared
void setModuleReset(std::function<void()> module_reset){
^~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:123:38: error: expected ‘,’ or ‘…’ before ‘<’ token
void setModuleReset(std::function<void()> module_reset){
^
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:138:10: error: ‘function’ in namespace ‘std’ does not name a template type
std::function<void()> module_reset_;
^~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h: In member function ‘virtual bool ThingerTinyGSM::connect_network()’:
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:59:12: error: ‘module_reset_’ was not declared in this scope
if(module_reset_) module_reset_();
^~~~~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:59:12: note: suggested alternative: ‘setModuleReset’
if(module_reset_) module_reset_();
^~~~~~~~~~~~~
setModuleReset
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h: In member function ‘void ThingerTinyGSM::setModuleReset(int)’:
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:124:9: error: ‘module_reset_’ was not declared in this scope
module_reset_ = module_reset;
^~~~~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:124:9: note: suggested alternative: ‘setModuleReset’
module_reset_ = module_reset;
^~~~~~~~~~~~~
setModuleReset
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:124:25: error: ‘module_reset’ was not declared in this scope
module_reset_ = module_reset;
^~~~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:124:25: note: suggested alternative: ‘setModuleReset’
module_reset_ = module_reset;
^~~~~~~~~~~~
setModuleReset
exit status 1
Error compiling for board Arduino Mega or Mega 2560.

type or paste code here

Hi, I have released a new library version (2.21.1) fixing this problem.
It seems that your device does not support std::functional. What device are you using? Arduino IDE?

Best regards.

I’m using Arduino version 1.8.15
and latest version from library manager is 2.21.0

Version 2.21.1 should be available now (Arduino takes some time to update the libraries).

What is the device you are using? Just to know why it does not support std::function

what means by the used device? I’m using windows 10

i got the following messages after update











In file included from C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:28:0,
                 from C:\Users\z003vwxj\Desktop\test\sketch_sep28a\sketch_sep28a.ino:5:
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:540:34: error: 'std::function' has not been declared
     void set_state_listener(std::function<void(THINGER_STATE)> state_listener){
                                  ^~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:540:42: error: expected ',' or '...' before '<' token
     void set_state_listener(std::function<void(THINGER_STATE)> state_listener){
                                          ^
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:557:10: error: 'function' in namespace 'std' does not name a template type
     std::function<void(THINGER_STATE)> state_listener_;
          ^~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function 'virtual void ThingerClient::run_reboot()':
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:361:20: error: 'WDTO_15MS' was not declared in this scope
         wdt_enable(WDTO_15MS);
                    ^~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:361:9: error: 'wdt_enable' was not declared in this scope
         wdt_enable(WDTO_15MS);
         ^~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:361:9: note: suggested alternative: 'mutable'
         wdt_enable(WDTO_15MS);
         ^~~~~~~~~~
         mutable
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function 'virtual void ThingerClient::thinger_state_listener(ThingerClient::THINGER_STATE)':
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:425:12: error: 'state_listener_' was not declared in this scope
         if(state_listener_) state_listener_(state);
            ^~~~~~~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:425:12: note: suggested alternative: 'set_state_listener'
         if(state_listener_) state_listener_(state);
            ^~~~~~~~~~~~~~~
            set_state_listener
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function 'void ThingerClient::set_state_listener(int)':
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:541:9: error: 'state_listener_' was not declared in this scope
         state_listener_ = state_listener;
         ^~~~~~~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:541:9: note: suggested alternative: 'set_state_listener'
         state_listener_ = state_listener;
         ^~~~~~~~~~~~~~~
         set_state_listener
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:541:27: error: 'state_listener' was not declared in this scope
         state_listener_ = state_listener;
                           ^~~~~~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:541:27: note: suggested alternative: 'set_state_listener'
         state_listener_ = state_listener;
                           ^~~~~~~~~~~~~~
                           set_state_listener
In file included from C:\Users\z003vwxj\Desktop\test\sketch_sep28a\sketch_sep28a.ino:5:0:
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h: At global scope:
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:123:30: error: 'std::function' has not been declared
     void setModuleReset(std::function<void()> module_reset){
                              ^~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:123:38: error: expected ',' or '...' before '<' token
     void setModuleReset(std::function<void()> module_reset){
                                      ^
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:138:10: error: 'function' in namespace 'std' does not name a template type
     std::function<void()> module_reset_;
          ^~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h: In member function 'virtual bool ThingerTinyGSM::connect_network()':
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:59:12: error: 'module_reset_' was not declared in this scope
         if(module_reset_) module_reset_();
            ^~~~~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:59:12: note: suggested alternative: 'setModuleReset'
         if(module_reset_) module_reset_();
            ^~~~~~~~~~~~~
            setModuleReset
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h: In member function 'void ThingerTinyGSM::setModuleReset(int)':
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:124:9: error: 'module_reset_' was not declared in this scope
         module_reset_ = module_reset;
         ^~~~~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:124:9: note: suggested alternative: 'setModuleReset'
         module_reset_ = module_reset;
         ^~~~~~~~~~~~~
         setModuleReset
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:124:25: error: 'module_reset' was not declared in this scope
         module_reset_ = module_reset;
                         ^~~~~~~~~~~~
C:\Users\z003vwxj\Documents\Arduino\libraries\thinger.io\src/ThingerTinyGSM.h:124:25: note: suggested alternative: 'setModuleReset'
         module_reset_ = module_reset;
                         ^~~~~~~~~~~~
                         setModuleReset
exit status 1
Error compiling for board Arduino Mega or Mega 2560.

I mean what microcontroller are you using, so I cant test it? i.e. ESP8266, Arduino Mega, ESP32…

I’m using ATmega2560 “arduino mega”

IS THERE ANY SUGGESTION ?
@alvarolb

I tested the last version with an ESP32 and it works without issues.

thank you. but I’m working with Atmega 2560, is it no longer supported?

I dont see that is the reason, surely it is a unexpected bug, product of the library update, just need to wait they release the patch for this particular.

Kind regards.

Hi, I have same result with an Arduino Wifi Uno REV 2 (ArduinoMegaAVRboard) " Compilation error for Arduino Uno WiFi Rev2 board

I did the same thing here https://docs.thinger.io/arduino/arduino-wifi#arduino-uno-wifi-rev2

Hi I solve my problem by remove the latest library version 2.21.1 by the oldest library version 2.17.0 of Thinger.io
With the oldest version 2.17.0 I haven’t compilation problem with my Arduino Uno Wifi Rev2 (listed in cad type :ArduinoMegaAVR)

Arduino µC: ATmega4809 microcontroller
Wifi native on board: u-blox NINA-W102

Libraries in my program <WiFiNINA.h> (1.8.13 version) and <ThingerWiFiNINA.h> (2.17.0 version)

Hi,

It should work without issues, lastest updates has been related mostly to OTA feature, and the Arduino uno doesn’t support OTA.

Hope this helps.