-
Notifications
You must be signed in to change notification settings - Fork 93
simplesample_http does not compile #86
Comments
I got the same error and have not got any clue about that. Have been struggling with Arduino IoT Hub examples for half day but couldn't get even one example compiled and working. That's so frustrating. I really doubt when people finished porting and updating their library for Arduino platform, did they even have a try to compile their example to ensure they work. |
In the end I used the following post to get it working, But had to chop and change a bit as I am not using the Huzzah. But my assumption is that if this has to be used in a production ready microcontroller and not Microsofts MX dev kit then this C library is essential. It is a bit frustrating that for a production ready service all their examples are aimed at specific Dev Kits with unstable libraries. https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-arduino-huzzah-esp8266-get-started |
Hi @kcoops , |
There isn't an issue #1 so your link navigates to nothing. I left it as is, so thats MQTT. Also be careful with the latest versions of the libraries case the are usually betas, so for instance I used version 5.13.4 of the ArduinoJson. |
Hi @kcoops , |
@kcoops can you share a bit more on how you found a workaround? I've been bouncing between both the simplesample and that Microsoft post for a few days now with no luck |
Are you able to compile successfully or is it that IOT Central is not receiving any data? simplesample never compiled for me so I gave up on that. Will be good to know specifically what issues you are having. As for the Microsoft sample just a few things I did. When it came to compilation errors I had to download version 5.13.4 of the ArduinoJson. Also I did not have a sensor connected so I updated the following flag in config.h (#define SIMULATED_DATA true). In the Message file I updated the temperature variable in the readMessage function to match what I defined in Azure. By default it is set to "temperature" in the code, but my definition was room_temp. The code looks like this root["room_temp"] = temperature. Lastly I am using IOT Central not IOT HUB which means I have to generate my connection string using dps-keygen as its not given when you create the "Real Device". Hope that helps. |
Hi @kcoops and @benparsell. Can you create a issue in the main azure-iot-sdk-c repo and link to this issue? Or continue to follow issue #795 in the repo. https://github.com/Azure/azure-iot-sdk-c/issues. We're actively working on fixing our Arduino libraries and resolving the build issues in our samples for ESP8266. We need to fix library compatibility issues and also updating the libraries to handle certs. |
ok no problem will follow #795 for a resolution. |
Hi! @kcoopss |
For starters it seems like its just not connecting to Azure. Its worth double checking you are using the correct connection string based on if you are using IOT Hub or IOT Central. Also check issue #795 for any resolutions. as this thread is now closed as requested by moderators. |
@kcoops I am using connection string based on the IotHub that was created by me and not any IoT. The thread #795 doesn't cater to this error but another error which occurs when using the remote monitoring sample. Also could you direct me to the HTTP Protocol version of the same app and the process for using it. |
@mysaggar I ran into the same errors and ended up rolling back to an earlier (non-beta) ESP (NodeMCU) Board version via the Arduino Board Manager. There may have been a bug/conflict with TLS with the WiFi packages being used in the newer versions and Azure's libraries. See if that might work! |
I had the same issues and finally got a working setup by installing certain specific versions. Others pointed out that they got it working by rollback to an older version, but I could not find a working set of compatible versions anywhere. Please always mention the specific version as this may help others reading your messages! The exact steps how I got it working is described in this comment: |
I am using a NodeMCU ESP8266 board and I am trying to compile and load simplesample_http. However it gives a compile error. I have downloaded all the latest versions of the necessary AzuteIOT libraries and still no luck. Any assistance would be appreciated. Below is a dump of the error log.
In file included from C:\Users\userx\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/lock.h:17:0,
from C:\Users\userx\Documents\Arduino\libraries\AzureIoTUtility\src/AzureIoTUtility.h:7,
from C:\Users\userx\Documents\Arduino\libraries\AzureIoTHub\src/AzureIoTHub.h:7,
from sketch\simplesample_http.c:11:
C:\Users\userx\Documents\Arduino\libraries\AzureIoTHub\src/sdk/serializer.h:441:79: error: 'REFLECTED_19' undeclared here (not in a function)
static const REFLECTED_DATA_FROM_DATAPROVIDER ALL_REFLECTED(name) = { &C2(REFLECTED_, C1(DEC(COUNTER))) };
C:\Users\userx\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/macro_utils.h:4359:18: note: in definition of macro 'C2_'
#define C2_(x,y) x##y
^
C:\Users\userx\Documents\Arduino\libraries\AzureIoTHub\src/sdk/serializer.h:441:76: note: in expansion of macro 'C2'
static const REFLECTED_DATA_FROM_DATAPROVIDER ALL_REFLECTED(name) = { &C2(REFLECTED_, C1(DEC(COUNTER))) };
C:\Users\userx\Documents\Arduino\libraries\AzureIoTHub\src/sdk/serializer.h:87:5: note: in expansion of macro 'REFLECTED_LIST_HEAD'
REFLECTED_LIST_HEAD(schemaNamespace)
^
sketch\simplesample_http.c:30:1: note: in expansion of macro 'END_NAMESPACE'
END_NAMESPACE(WeatherStation);
^
exit status 1
Error compiling for board Generic ESP8266 Module.
The text was updated successfully, but these errors were encountered: