Connecting Sparkfun ESP8266 Thing to Azure IoT Hub - azure

I am currently trying to connect my Sparkfun ESP8266 Thing to my Azure IoT Hub. I have successfully set up my hub, and am following this tutorial on how to connect the Thing to my Azure IoT Hub: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-sparkfun-esp8266-thing-dev-get-started
Unfortunately I keep getting the error:
'StaticJsonBuffer' was not declared in this scope
Arduino: 1.8.5 (Windows 10), Board: "SparkFun ESP8266 Thing, 80 MHz, 512K (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
Build options changed, rebuilding all
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino: In function 'bool readMessage(int, char*)':
message:46: error: 'StaticJsonBuffer' was not declared in this scope
StaticJsonBuffer<MESSAGE_MAX_LEN> jsonBuffer;
^
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:46:5: note: suggested alternative:
In file included from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/StaticJsonDocument.hpp:8:0,
from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson.hpp:10,
from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson.h:9,
from C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:2:
C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/Memory/StaticJsonBuffer.hpp:110:7: note: 'ArduinoJson::Internals::StaticJsonBuffer'
class StaticJsonBuffer : public Internals::StaticJsonBufferBase {
^
message:46: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<MESSAGE_MAX_LEN> jsonBuffer;
^
message:74: error: 'class ArduinoJson::JsonObject' has no member named 'printTo'
root.printTo(payload, MESSAGE_MAX_LEN);
^
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino: In function 'void parseTwinMessage(char*)':
message:80: error: 'StaticJsonBuffer' was not declared in this scope
StaticJsonBuffer<MESSAGE_MAX_LEN> jsonBuffer;
^
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:80:5: note: suggested alternative:
In file included from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/StaticJsonDocument.hpp:8:0,
from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson.hpp:10,
from C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson.h:9,
from C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:2:
C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/Memory/StaticJsonBuffer.hpp:110:7: note: 'ArduinoJson::Internals::StaticJsonBuffer'
class StaticJsonBuffer : public Internals::StaticJsonBufferBase {
^
message:80: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<MESSAGE_MAX_LEN> jsonBuffer;
^
message:82: error: 'class ArduinoJson::JsonObject' has no member named 'success'
if (!root.success())
^
message:88: error: 'ArduinoJson::Internals::enable_if >::type' has no member named 'success'
if (root["desired"]["interval"].success())
^
exit status 1
'StaticJsonBuffer' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I have changed the DEVICE_ID from "SparkFun ESP8266 Thing Dev" to "SparkFun ESP8266 Thing", and am using simulated data.
Any help with this would be much appreciated!

The reason for this error is that you install the ArduinoJson version >= 6. Default version 6.2.3-beta will be installed but from version 6 and higher JsonBuffer is replaced with JsonDocument. It is also indicate in the error message:
C:\Users\L.FULL\Documents\Arduino\iot-hub-SparkFun-ThingDev-client-app\app\message.ino:46:5:
note: suggested alternative:
In file included from
C:\Users\L.FULL\Documents\Arduino\libraries\arduino_172002\src/ArduinoJson/StaticJsonDocument.hpp:8:0
To solve this issue you can roll back to the previous version. Version 5.13.2 works for me.
Reference issue on ArduinoJson repo and issue on iot-hub-feather-huzzah-client-app repo.

Related

Multiple libraries were found for "wire"\\\\\\\\

Arduino: 1.8.11 (Windows Store 1.8.28.0) (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new can abort), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp: In function 'void wiresend(uint8_t)':
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp:53:15: error: 'Wire1' was not declared in this scope
#define WIRE Wire1
^
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp:78:5: note: in expansion of macro 'WIRE'
WIRE.write((uint8_t)x);
^
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp: In function 'uint8_t wirerecv()':
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp:53:15: error: 'Wire1' was not declared in this scope
#define WIRE Wire1
^
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp:92:12: note: in expansion of macro 'WIRE'
return WIRE.read();
^
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp: In member function 'void Adafruit_NFCShield_I2C::begin()':
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp:53:15: error: 'Wire1' was not declared in this scope
#define WIRE Wire1
^
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp:120:3: note: in expansion of macro 'WIRE'
WIRE.begin();
^
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp: In member function 'void Adafruit_NFCShield_I2C::wirereaddata(uint8_t*, uint8_t)':
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp:53:15: error: 'Wire1' was not declared in this scope
#define WIRE Wire1
^
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp:981:3: note: in expansion of macro 'WIRE'
WIRE.requestFrom((uint8_t)PN532_I2C_ADDRESS, (uint8_t)(n+2));
^
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp: In member function 'void Adafruit_NFCShield_I2C::wiresendcommand(uint8_t*, uint8_t)':
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp:53:15: error: 'Wire1' was not declared in this scope
#define WIRE Wire1
^
C:\Users\user\Documents\Arduino\libraries\Adafruit_NFCShield_I2C-master\Adafruit_NFCShield_I2C.cpp:1021:3: note: in expansion of macro 'WIRE'
WIRE.beginTransmission(PN532_I2C_ADDRESS);
^
Multiple libraries were found for "Wire.h"
Used: C:\Users\user\Documents\Arduino\libraries\Wire
Not used: C:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.6.3\libraries\Wire
Multiple libraries were found for "SPI.h"
Used: C:\Users\user\Documents\Arduino\libraries\SPI
Not used: C:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.6.3\libraries\SPI
Multiple libraries were found for "ESP8266WiFi.h"
Used: C:\Users\user\Documents\Arduino\libraries\ESP8266WiFi
Not used: C:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
You have SPI and Wire library installed in libraries folder. This libraries are platform dependent and are the correct version is bundled with the boards package for the platform.
The ESP8266WiFi library is bundled with the ESP8266 Arduino boards package. It should not be installed in libraries.
Delete the Wire, SPI library and ESP8266WiFi from C:\Users\user\Documents\Arduino\libraries\
The Arduino builder should prefer the library bundled with boards package, but the version of builder in Arduino IDE 1.8.11 has a bug and selects the wrong library.

Install OpenCV-2.4.9 on CentOS 7 (PC)

I'm trying to install OpenCV-2.4.9 on CentOS 7 (PC) however getting error after 16% when running "make" command. I leave default configuration for OpenCV.
make
...
[ 16%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_v4l.cpp.o /opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:306:29: error: field ‘capability’ has incomplete type
struct video_capability capability;
^ /opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:307:29: error: field ‘captureWindow’ has incomplete type
struct video_window captureWindow;
....
....
/opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp: In function ‘void icvCloseCAM_V4L(CvCaptureCAM_V4L*)’:
/opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:2812:46: error: ‘CvCaptureCAM_V4L’ has no member named ‘memoryBuffer’
It seems that the define HAVE_CAMV4L has the value 1, if you look in the file modules/highgui/src/cap_v4l.cpp looking for the structure definition at the row 306. If the compilation fails at that point this means that the video4linux development configuration is corrupted.
Using google I have found that the OpenCV Bug #1357 is described as follow:
CHECK_INCLUDE_FILE(linux/videodev.h HAVE_CAMV4L) succeeds even though linux/videodev.h doesn't exist on the system. (Bug #1357)
http://code.opencv.org/issues/1357
Anyway the solution is described at the same URL for "HAVE_CAMV4L gets set incorrectly": "Setting it to FALSE in CMakeLists.txt fixes the problem".

Use of static_assert forbidden in Android project

I am porting some C++ code to Android. One of the source files includes a webrtc header file that causes error during compilation. I have reduced the problem to this simple code:
template <class T, int n>
struct DefaultDeleter<T[n]> {
// Never allow someone to declare something like scoped_ptr<int[10]>.
static_assert(sizeof(T) == -1, "do not use array with size as type");
};
The error I get is:
[armeabi-v7a] Compile++ thumb: dummyclient <= dummy.cpp
dummy.cpp:7:3: warning: identifier 'static_assert' will become a keyword in C++0x [-Wc++0x-compat]
dummy.cpp:5:8: error: 'DefaultDeleter' is not a template
dummy.cpp:7:17: error: expected identifier before 'sizeof'
dummy.cpp:7:17: error: expected ',' or '...' before 'sizeof'
dummy.cpp:7:70: error: ISO C++ forbids declaration of 'static_assert' with no type [-fpermissive]
The same code compiles fine on Windows and Linux. Is there some compiler settings that are required for Android? Regards.
You need to pass the CPPFLAG -std=c++11.

not building with ./build_native.sh and android- ndk-r8 in cocos2d-x

I have downloaded the source code for a projet in cocos2d-x.
I am using the ./build_native.sh from the Hello World example, which is sure it works.
Yet again I am getting this error when compiling:
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile++ thumb : cocos2d <= CCGrabber.cpp
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In constructor 'cocos2d::CCGrabber::CCGrabber()':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:46:32: error: 'glGenFramebuffersOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In member function 'void cocos2d::CCGrabber::grab(cocos2d::CCTexture2D*)':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:61:47: error: 'glBindFramebufferOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:65:26: error: 'glFramebufferTexture2DOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:68:63: error: 'glCheckFramebufferStatusOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In member function 'void cocos2d::CCGrabber::beforeRender(cocos2d::CCTexture2D*)':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:88:47: error: 'glBindFramebufferOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In member function 'void cocos2d::CCGrabber::afterRender(cocos2d::CCTexture2D*)':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:113:50: error: 'glBindFramebufferOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In destructor 'virtual cocos2d::CCGrabber::~CCGrabber()':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:127:35: error: 'glDeleteFramebuffersOES' was not declared in this scope
I searched and found this sollution. But it does not work for me. I am still getting the same error. Maybe it is different in ndk-r8 whilst the sollution is for ndk-r7.
Any help?
Your android sdk version must bigger than 2.2.because from 2.2,the android begin to support opengl es 2.0,and the cocos2d-x 2.0 use the opengles 2.0 to render

Cannot build "cyrus-sasl-2.1.23" on SUSE Linux 10.0

I downloaded the source code from "ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/".
Configure went well but when i build I end up with following errors:
digestmd5.c:852: error: 'des_context_t' has no member named 'keysched'
digestmd5.c:853: error: 'des_context_t' has no member named 'keysched2'
digestmd5.c:854: error: 'des_context_t' has no member named 'ivec'
digestmd5.c:855: error: 'DES_DECRYPT' undeclared (first use in this function)
....
Well i guess configuration issues.
I configured it with following settings and it worked.
./configure --prefix= (PATH) --exec-prefix=(PATH) --with-dblib=no --without-des --with-openssl=(PATH)

Resources