Open Alberto-Vega opened 5 years ago
When changing ESP board library to 2.4.2 or lower, the code compiles and starts (tried with nodemcu esp12E, which is basically esp8266) Also the ArduinoJson needs to be 5.x as the syntax has changed.
This code needs to be updated to work with latest libraries.
I am getting the following error in esp8266 arduino framework
TLS failed to start the connection process. Error: io_open failed failure connecting to address [HostName].azure-devices.net
the connecting string is correct and is working fine with esp32 please help me with this issue
Commented out the round() macro in Arduino.h since it gave an error
** When using VSCode in conjunction with arduino IDE, I get the same results.
When changing ESP board library to 2.4.2 or lower, the code compiles and starts (tried with nodemcu esp12E, which is basically esp8266) Also the ArduinoJson needs to be 5.x as the syntax has changed.
This code needs to be updated to work with latest libraries.
Confirmed
I can also confirm this issue.
I have forked the repo and modified the code to work with ArduinoJson 6.x
https://github.com/martinrbowman/iot-hub-feather-huzzah-client-app
The error with the round(x) function is reported on the esp8266 and is being investigated.
Tool Chain: Arduino - 1.8.9 ArduinoJson - 6.10.1 esp8266 tools - 2.4.2 Azure Libraries - 1.0.45
Board: Generic Wemos D1 R2 Generic Wemos D1 Mini
I confirm the same problem. Same tool chain as martinrbowman, using Nodemcu esp12E.
@stefds were you able to build the sample using the toolchain versions I used?
@martinrbowman: it's indeed building using your forked repo & the listed tool chain. But get with warnings on "_macroutils.h" > #define DEC(x) C2(DEC,x) and "deprecated conversion from string constant to 'char*'"
Confirmed problem as many here. Tried @martinrbowman's fork, but it seems that I'm having the same issues as @StefDS .
For anyone checking for which versions are working: arduino 1.8.9. ESP8266 2.4.2 azureiothub, azureiotprotocol_mqtt, azureiotutility (latest versions 1.0.45) arduinoJson 5.13.4.
@martinrbowman: it's indeed building using your forked repo & the listed tool chain. But get with warnings on "_macroutils.h" > #define DEC(x) C2(DEC,x) and "deprecated conversion from string constant to 'char*'"
I will take a look and see if I can figure out what the root cause of this is.
@Yatheesha1 did you get the error Messages which @Alberto-Vega-MSFT noted at the beginning? I just ignored the errors but then got the same error as you when I did the Serial monitor:
TLS failed to start the connection process. Error: io_open failed failure connecting to address [HostName].azure-devices.net
Elgaatoo, if I remember correctly from reading a number of threads, both errors (the DEC(X) error and the errors due to TLS) are because of the NodeMCU version. If you have updated it to anything above version 2.4.2, you'll likely going to get one of the errors.
Hello @ejri , thank you for your quick response!! :) The upload in VStudio was successful with the following settings: Board: ESP8266 Huzzah 2.4.0 Libraries:
However, I am still trying to get rid of the TLS problem. The first sensor message is transmitted but then the connection fails.
Sending message: {"deviceId":"Feather HUZZAH ESP8266 WiFi","messageId":1,"temperature":22.7,"humidity":42}. IoTHubClient accepted the message for delivery. TLS failed to start the connection process. Error: io_open failed failure connecting to address [X]IoTHub.azure-devices.net.
@JhaNishant Migrating issue from the documentation to the sample application repo
https://github.com/MicrosoftDocs/azure-docs/issues/26176
In file included from C:\Users\bpnis\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/lock.h:17:0,
C:\Users\bpnis\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\bpnis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/Stream.h:26:0,
C:\Users\bpnis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/Print.h:29:0: note: this is the location of the previous definition
define DEC 10
^
C:\Users\bpnis\Desktop\iot-hub-feather-huzzah-client-app-master\app\credentials.ino: In function 'void readCredentials()':
C:\Users\bpnis\Desktop\iot-hub-feather-huzzah-client-app-master\app\credentials.ino:26:64: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
C:\Users\bpnis\Desktop\iot-hub-feather-huzzah-client-app-master\app\credentials.ino:29:68: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
C:\Users\bpnis\Desktop\iot-hub-feather-huzzah-client-app-master\app\credentials.ino:32:117: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
C:\Users\bpnis\Desktop\iot-hub-feather-huzzah-client-app-master\app\credentials.ino: In function 'bool needEraseEEPROM()':
C:\Users\bpnis\Desktop\iot-hub-feather-huzzah-client-app-master\app\credentials.ino:39:126: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
In file included from C:\Users\bpnis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/Stream.h:26:0,
C:\Users\bpnis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/Print.h:29:0: warning: "DEC" redefined [enabled by default]
define DEC 10
^
In file included from C:\Users\bpnis\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/umock_c_prod.h:23:0,
C:\Users\bpnis\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 C:\Users\bpnis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/WiFiClient.h:25:0,
c:\users\bpnis\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits\random.tcc: In member function 'void std::poisson_distribution<_IntType>::param_type::_M_initialize()':
C:\Users\bpnis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/Arduino.h:137:22: error: expected unqualified-id before '(' token
define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
c:\users\bpnis\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits\random.tcc: In member function 'void std::binomial_distribution<_IntType>::param_type::_M_initialize()':
C:\Users\bpnis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/Arduino.h:137:22: error: expected unqualified-id before '(' token
define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
C:\Users\bpnis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/Arduino.h:137:22: error: expected unqualified-id before '(' token
define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
exit status 1 Error compiling for board Adafruit Feather HUZZAH ESP8266.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.