Uno examples won't compile (ethernet, cc3000)


#1

Hello,
I’m trying to test out some of the thinger examples on an Uno with either an ethernet shield or a cc3000. Having changed nothing but the username, device_id and device_credential, the sketches fail to compile. I was able to successfully test a sketch for a nodeMCU. Oddly enough, when I accidentally compiled one of the Uno sketches while the nodeMCU device was still selected the sketch compiled. I’m not sure what I’m missing here.

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino/Genuino Uno"

In file included from sketch\ArduinoEthernet.ino.cpp:1:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:81:18: error: expected identifier before numeric constant

 #define INTERNAL 3

                  ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:56:9: note: in expansion of macro 'INTERNAL'

         INTERNAL    = 3

         ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:81:18: error: expected '}' before numeric constant

 #define INTERNAL 3

                  ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:56:9: note: in expansion of macro 'INTERNAL'

         INTERNAL    = 3

         ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:81:18: error: expected unqualified-id before numeric constant

 #define INTERNAL 3

                  ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:56:9: note: in expansion of macro 'INTERNAL'

         INTERNAL    = 3

         ^

In file included from C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger.h:29:0,

                 from C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:28,

                 from C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/ThingerEthernet.h:29,

                 from C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\examples\Arduino\ArduinoEthernet\ArduinoEthernet.ino:1:

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:65:1: error: expected unqualified-id before 'private'

 private:

 ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:87:5: error: 'io_type' does not name a type

     io_type io_type_;

     ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:88:5: error: 'access_type' does not name a type

     access_type access_type_;

     ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:89:5: error: 'callback' does not name a type

     callback callback_;

     ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:112:1: error: expected unqualified-id before 'public'

 public:

 ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:148:50: error: 'thinger::thinger_resource& thinger::operator[](const char*)' must be a nonstatic member function

     thinger_resource & operator[](const char* res){

                                                  ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:152:35: error: declaration of 'operator()' as non-function

     thinger_resource & operator()(access_type type){

                                   ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:152:35: error: 'access_type' was not declared in this scope

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:157:5: error: 'io_type' does not name a type

     io_type get_io_type(){

     ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:161:5: error: 'access_type' does not name a type

     access_type get_access_type(){

     ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: In function 'void thinger::fill_api(protoson::pson_object&)':

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:166:12: error: 'io_type_' was not declared in this scope

         if(io_type_!=none){

            ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:166:22: error: 'none' was not declared in this scope

         if(io_type_!=none){

                      ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:167:29: error: 'access_type_' was not declared in this scope

             content["al"] = access_type_;

                             ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:174:33: error: 'class thinger::thinger_resource' has no member named 'fill_api'

                 current->value_.fill_api(actions[current->key_]);

                                 ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: In function 'void thinger::fill_api_io(protoson::pson_object&)':

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:181:12: error: 'io_type_' was not declared in this scope

         if(io_type_ == pson_in){

            ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:181:24: error: 'pson_in' was not declared in this scope

         if(io_type_ == pson_in){

                        ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:182:13: error: 'callback_' was not declared in this scope

             callback_.pson(content["in"]);

             ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:183:30: error: 'pson_out' was not declared in this scope

         }else if(io_type_ == pson_out){

                              ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:184:13: error: 'callback_' was not declared in this scope

             callback_.pson(content["out"]);

             ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:185:30: error: 'pson_in_pson_out' was not declared in this scope

         }else if(io_type_ == pson_in_pson_out){

                              ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:186:13: error: 'callback_' was not declared in this scope

             callback_.pson_in_pson_out(content["in"], content["out"]);

             ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: In function 'void thinger::fill_output(protoson::pson&)':

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:191:12: error: 'io_type_' was not declared in this scope

         if(io_type_ == pson_out){

            ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:191:24: error: 'pson_out' was not declared in this scope

         if(io_type_ == pson_out){

                        ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:192:13: error: 'callback_' was not declared in this scope

             callback_.pson(content);

             ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: At global scope:

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:200:1: error: expected unqualified-id before 'public'

 public:

 ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: In function 'void thinger::set_function(void (*)())':

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:282:9: error: 'io_type_' was not declared in this scope

         io_type_ = run;

         ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:282:20: error: 'run' was not declared in this scope

         io_type_ = run;

                    ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:283:9: error: 'callback_' was not declared in this scope

         callback_.run = run_function;

         ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: At global scope:

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:289:60: error: 'void thinger::operator<<(void (*)(protoson::pson&))' must have an argument of class or enumerated type

     void operator<<(void (*in_function)(protoson::pson& in)){

                                                            ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: In function 'void thinger::set_input(void (*)(protoson::pson&))':

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:298:9: error: 'io_type_' was not declared in this scope

         io_type_ = pson_in;

         ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:298:20: error: 'pson_in' was not declared in this scope

         io_type_ = pson_in;

                    ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:299:9: error: 'callback_' was not declared in this scope

         callback_.pson = in_function;

         ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: At global scope:

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:305:62: error: 'void thinger::operator>>(void (*)(protoson::pson&))' must have an argument of class or enumerated type

     void operator>>(void (*out_function)(protoson::pson& out)){

                                                              ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: In function 'void thinger::set_output(void (*)(protoson::pson&))':

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:314:9: error: 'io_type_' was not declared in this scope

         io_type_ = pson_out;

         ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:314:20: error: 'pson_out' was not declared in this scope

         io_type_ = pson_out;

                    ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:315:9: error: 'callback_' was not declared in this scope

         callback_.pson = out_function;

         ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: At global scope:

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:321:94: error: 'void thinger::operator=(void (*)(protoson::pson&, protoson::pson&))' must be a nonstatic member function

     void operator=(void (*pson_in_pson_out_function)(protoson::pson& in, protoson::pson& out)){

                                                                                              ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: In function 'void thinger::set_input_output(void (*)(protoson::pson&, protoson::pson&))':

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:330:9: error: 'io_type_' was not declared in this scope

         io_type_ = pson_in_pson_out;

         ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:330:20: error: 'pson_in_pson_out' was not declared in this scope

         io_type_ = pson_in_pson_out;

                    ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:331:9: error: 'callback_' was not declared in this scope

         callback_.pson_in_pson_out = pson_in_pson_out_function;

         ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: In function 'void thinger::handle_request(thinger::thinger_message&, thinger::thinger_message&)':

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:343:25: error: 'io_type_' was not declared in this scope

                 switch (io_type_){

                         ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:344:26: error: 'pson_in' was not declared in this scope

                     case pson_in:

                          ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:345:25: error: 'callback_' was not declared in this scope

                         callback_.pson(request);

                         ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:347:26: error: 'pson_out' was not declared in this scope

                     case pson_out:

                          ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:350:26: error: 'run' was not declared in this scope

                     case run:

                          ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:353:26: error: 'pson_in_pson_out' was not declared in this scope

                     case pson_in_pson_out:

                          ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:356:26: error: 'none' was not declared in this scope

                     case none:

                          ^

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp: At global scope:

C:\Users\johnm\OneDrive\Documents\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:374:1: error: expected declaration before '}' token

 }

 ^

Multiple libraries were found for "Ethernet.h"
 Used: C:\Users\johnm\OneDrive\Documents\Arduino\libraries\Ethernet
 Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Ethernet
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

ThingerEthernet.h won't compile for Arduino Uno with ethernet shield
#2

I have the same problem, but is with any atmega328 board. The problem occurs with Arduino IDE and with Arduino web editor.


#3

I could compile the example with thinger 2.9.2 library, (downgraded from 2.13.0), didn’t test if it runs ok at the board, but at least it is compiling.

I know that it shouldn’t be the solution, but surely developing last version they modified something and miss watch this particular detail.


#4

I tried downgrading the Arduino IDE, which didn’t work, but I didn’t try downgrading the thinger libraries. I will give that a shot to see if I can at least get it working on the boards I have. Thanks.