Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

'AzureIoTHubClient' does not name a type #274

Open
austnalio opened this issue Jul 7, 2018 · 3 comments
Open

'AzureIoTHubClient' does not name a type #274

austnalio opened this issue Jul 7, 2018 · 3 comments

Comments

@austnalio
Copy link

OS and version used: Windows 10 1803 & Raspberry Pi Jessie
Arduino IDE Version 1.8.5
Azure IoT Hub Library 1.0.45 (also tried 1.0.40 and 1.0.17)
GitHub Master Branch (As of 7/6/2018)
Trying on both Node MCU and Wemos D1

Description of the issue:

When going to compile the ESP8266 connect the dots project (connectthedots/Devices/DirectlyConnectedDevices/ESP8266/connect_the_dots/) I get an error 'AzureIoTHubClient' does not name a type .

Code sample exhibiting the issue:

No changes have been made from the code cloned aside from the connectionString, ssid, and pass variables.

Console log of the issue:


                 from F:\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Deserialization/../StringTraits/ArduinoStream.hpp:9,

                 from F:\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Deserialization/../StringTraits/StringTraits.hpp:32,

                 from F:\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Deserialization/../JsonVariantComparisons.hpp:7,

                 from F:\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Deserialization/../JsonVariantBase.hpp:8,

                 from F:\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Deserialization/../JsonVariant.hpp:13,

                 from F:\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Deserialization/../JsonBuffer.hpp:12,

                 from F:\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Deserialization/JsonParser.hpp:7,

                 from F:\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/JsonBufferBase.hpp:7,

                 from F:\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/DynamicJsonBuffer.hpp:7,

                 from F:\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.hpp:9,

                 from F:\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.h:9,

                 from sketch\connect_the_dots.cpp:9:

C:\Users\aust\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:29:0: warning: "DEC" redefined [enabled by default]

 #define DEC 10

 ^

In file included from F:\OneDrive\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/lock.h:17:0,

                 from F:\OneDrive\Documents\Arduino\libraries\AzureIoTUtility\src/AzureIoTUtility.h:7,

                 from F:\OneDrive\Documents\Arduino\libraries\AzureIoTHub\src/AzureIoTHub.h:7,

                 from sketch\connect_the_dots.cpp:4:

F:\OneDrive\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/macro_utils.h:222:0: note: this is the location of the previous definition

 #define DEC(x) C2(DEC,x)

 ^

In file included from F:\OneDrive\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/lock.h:17:0,

                 from F:\OneDrive\Documents\Arduino\libraries\AzureIoTUtility\src/AzureIoTUtility.h:7,

                 from F:\OneDrive\Documents\Arduino\libraries\AzureIoTHub\src/AzureIoTHub.h:7,

                 from C:\Users\rosho\Desktop\connect_the_dots\connect_the_dots.ino:40:

F:\OneDrive\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/macro_utils.h:222:0: warning: "DEC" redefined [enabled by default]

 #define DEC(x) C2(DEC,x)

 ^

In file included from C:\Users\aust\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Stream.h:26:0,

                 from C:\Users\aust\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/HardwareSerial.h:31,

                 from C:\Users\aust\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Arduino.h:245,

                 from sketch\connect_the_dots.ino.cpp:1:

C:\Users\aust\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:29:0: note: this is the location of the previous definition

 #define DEC 10

 ^

C:\Users\aust\Desktop\connect_the_dots\connect_the_dots.ino:149:7: warning: extra tokens at end of #else directive [enabled by default]

 #else -------------------------------------------------

       ^

C:\Users\aust\Desktop\connect_the_dots\connect_the_dots.ino:169:8: warning: extra tokens at end of #endif directive [enabled by default]

 #endif ===============================================

        ^

connect_the_dots:54: error: 'AzureIoTHubClient' does not name a type

 static AzureIoTHubClient iotHubClient;

        ^

C:\Users\aust\Desktop\connect_the_dots\connect_the_dots.ino: In function 'void setup()':

connect_the_dots:65: error: 'iotHubClient' was not declared in this scope

     iotHubClient.begin(sslClient);

     ^

exit status 1
'AzureIoTHubClient' does not name a type```

@olivierbloch
Copy link
Contributor

Hi @austnalio, sorry for the late answer on this one.
The Azure IoT Arduino library has been updated some time ago with breaking changes. I need to go back and update this sample. In the meantime, try using the version 2.3.0 for the ESP8266 board package and version 1.0.17 for the following libraries: azureiothub, azureiotutility, azureiotprotocol_mqtt.
Let me know if that unblocks you.
I'll keep the issue open till I resolve the issue and will edit the readme to make sure people use the older versions of the libraries
Thanks

@HenrikBach1
Copy link

Hi, you should also bump (or let the) ArduinoJSON library (stay) to 5.13.5.

@olivierbloch
Copy link
Contributor

Sorry I have not been maintaining this project much. Hopefully I can spend some cycles soon to refresh it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants