I have ARDUINO 1.6.12 Software and Arduino YUN device.
I have the latest ubidots library as pointed by https://ubidots.com/docs/devices/ArduinoYUN.html#arduino-yun
I get compilation error when I link the library.
Arduino: 1.6.7 (Windows 10), Board: “Arduino Yún”
In file included from \Documents\Arduino\libraries\ubidots-arduino-yun-master\examples\UbidotsGetValue\UbidotsGetValue.ino:1:0:
\Documents\Arduino\libraries\ubidots-arduino-yun-master/UbidotsYUN.h:30:16: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
#define SERVER “translate.ubidots.com”
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master/UbidotsYUN.h:44:52: note: in expansion of macro ‘SERVER’
explicit Ubidots(char* token, char* server = SERVER);
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\examples\UbidotsGetValue\UbidotsGetValue.ino:5:21: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Ubidots client(TOKEN);
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\examples\UbidotsGetValue\UbidotsGetValue.ino:5:21: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
In file included from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:26:0:
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.h:30:16: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
#define SERVER “translate.ubidots.com”
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.h:44:52: note: in expansion of macro ‘SERVER’
explicit Ubidots(char* token, char* server = SERVER);
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:31:1: error: prototype for ‘Ubidots::Ubidots(char*)’ does not match any in class ‘Ubidots’
Ubidots::Ubidots(char* token) {
^
In file included from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:26:0:
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.h:42:7: error: candidates are: constexpr Ubidots::Ubidots(Ubidots&&)
class Ubidots {
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.h:42:7: error: constexpr Ubidots::Ubidots(const Ubidots&)
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.h:44:16: error: Ubidots::Ubidots(char*, char*)
explicit Ubidots(char* token, char* server = SERVER);
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp: In member function ‘void Ubidots::sendAll()’:
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:148:41: error: invalid conversion from ‘const char*’ to ‘size_t {aka unsigned int}’ [-fpermissive]
snprintf(buffer, "(sleep 1\necho \"");
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:148:41: error: too few arguments to function ‘int snprintf(char*, size_t, const char*, …)’
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:24:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Bridge.h:26,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Process.h:22,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.h:28,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:26:
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdio.h:685:12: note: declared here
extern int snprintf(char *__s, size_t __n, const char *__fmt, …);
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:150:92: error: invalid conversion from ‘const char*’ to ‘size_t {aka unsigned int}’ [-fpermissive]
snprintf(buffer, "%s%s%s|POST|%s|%s=>", buffer, USER_AGENT, VERSION, _token, _dsTag);
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:24:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Bridge.h:26,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Process.h:22,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.h:28,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:26:
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdio.h:685:12: error: initializing argument 2 of ‘int snprintf(char*, size_t, const char*, …)’ [-fpermissive]
extern int snprintf(char *__s, size_t __n, const char *__fmt, …);
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:152:104: error: invalid conversion from ‘const char*’ to ‘size_t {aka unsigned int}’ [-fpermissive]
snprintf(buffer, "%s%s%s|POST|%s|%s:%s=>", buffer, USER_AGENT, VERSION, _token, _dsTag, _dsName);
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:24:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Bridge.h:26,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Process.h:22,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.h:28,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:26:
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdio.h:685:12: error: initializing argument 2 of ‘int snprintf(char*, size_t, const char*, …)’ [-fpermissive]
extern int snprintf(char *__s, size_t __n, const char *__fmt, …);
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:156:77: error: invalid conversion from ‘const char*’ to ‘size_t {aka unsigned int}’ [-fpermissive]
snprintf(buffer, "%s%s:%s", buffer, (val + i)->idName, value.c_str());
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:24:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Bridge.h:26,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Process.h:22,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.h:28,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:26:
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdio.h:685:12: error: initializing argument 2 of ‘int snprintf(char*, size_t, const char*, …)’ [-fpermissive]
extern int snprintf(char *__s, size_t __n, const char *__fmt, …);
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:158:67: error: invalid conversion from ‘const char*’ to ‘size_t {aka unsigned int}’ [-fpermissive]
snprintf(buffer, "%s\\$%s", buffer, (val + i)->context);
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:24:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Bridge.h:26,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Process.h:22,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.h:28,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:26:
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdio.h:685:12: error: initializing argument 2 of ‘int snprintf(char*, size_t, const char*, …)’ [-fpermissive]
extern int snprintf(char *__s, size_t __n, const char *__fmt, …);
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:162:43: error: invalid conversion from ‘const char*’ to ‘size_t {aka unsigned int}’ [-fpermissive]
snprintf(buffer, "%s,", buffer);
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:24:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Bridge.h:26,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Process.h:22,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.h:28,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:26:
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdio.h:685:12: error: initializing argument 2 of ‘int snprintf(char*, size_t, const char*, …)’ [-fpermissive]
extern int snprintf(char *__s, size_t __n, const char *__fmt, …);
^
\Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:165:70: error: invalid conversion from ‘const char*’ to ‘size_t {aka unsigned int}’ [-fpermissive]
snprintf(buffer, "%s|end\") | telnet %s %s", buffer, SERVER, PORT);
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:24:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Bridge.h:26,
from C:\Program Files (x86)\Arduino\libraries\Bridge\src/Process.h:22,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.h:28,
from \Documents\Arduino\libraries\ubidots-arduino-yun-master\UbidotsYUN.cpp:26:
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdio.h:685:12: error: initializing argument 2 of ‘int snprintf(char*, size_t, const char*, …)’ [-fpermissive]
extern int snprintf(char *__s, size_t __n, const char *__fmt, …);
^
exit status 1
Error compiling.