не компилирует код с помощью Include AzureIoThub.h на устройстве esp8266

Я пытаюсь подключить свое устройство esp8266 к концентратору azure IOT, и, насколько я понимаю, нужно использовать официальную библиотеку AzureIoThub (распространяемую в диспетчере библиотек), но почему-то код с этой включенной библиотекой не компилируется.

Я получаю следующие ошибки при включении библиотеки.

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

Build options changed, rebuilding all
In file included from C:\Users\uriya\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/constbuffer.h:16:0,

                 from C:\Users\uriya\Documents\Arduino\libraries\AzureIoTHub\src\internal/iothub_client_private.h:9,

                 from C:\Users\uriya\Documents\Arduino\libraries\AzureIoTHub\src\iothub_client_ll_uploadtoblob.c:20:

C:\Users\uriya\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/umock_c_prod.h:114:30: error: pasting "MOCKABLE_" and "/*this creates a new constbuffer from a memory area*/" does not give a valid preprocessing token

 #define EXPAND_PROD_ENTRY(A) MOCKABLE_##A

                              ^

C:\Users\uriya\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/azure_macro_utils/macro_utils.h:9069:1: note: in expansion of macro 'EXPAND_PROD_ENTRY'

 X(P1) \

 ^

C:\Users\uriya\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/azure_macro_utils/macro_utils.h:8585:21: note: in expansion of macro 'MU_FOR_EACH_1_9'

 #define MU_C2_(x,y) x##y

                     ^

C:\Users\uriya\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/umock_c_prod.h:119:5: note: in expansion of macro 'MU_FOR_EACH_1'

     MU_FOR_EACH_1(EXPAND_PROD_ENTRY, __VA_ARGS__)

     ^

C:\Users\uriya\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/constbuffer.h:35:1: note: in expansion of macro 'MOCKABLE_INTERFACE'

 MOCKABLE_INTERFACE(constbuffer,

 ^

C:\Users\uriya\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/umock_c_prod.h:114:30: error: pasting "MOCKABLE_" and "/*this creates a new constbuffer from an existing BUFFER_HANDLE*/" does not give a valid preprocessing token

 #define EXPAND_PROD_ENTRY(A) MOCKABLE_##A

                              ^

C:\Users\uriya\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/azure_macro_utils/macro_utils.h:9073:1: note: in expansion of macro 'EXPAND_PROD_ENTRY'

 X(P1) \

 ^

C:\Users\uriya\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/azure_macro_utils/macro_utils.h:9070:1: note: in expansion of macro 'MU_FOR_EACH_1_8'

 MU_FOR_EACH_1_8(X, P2, P3, P4, P5, P6, P7, P8, P9)

 ^

C:\Users\uriya\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/azure_macro_utils/macro_utils.h:8585:21: note: in expansion of macro 'MU_FOR_EACH_1_9'

 #define MU_C2_(x,y) x##y

                     ^

C:\Users\uriya\Documents\Arduino\libraries\AzureIoTUtility\src/umock_c/umock_c_prod.h:119:5: note: in expansion of macro 'MU_FOR_EACH_1'

     MU_FOR_EACH_1(EXPAND_PROD_ENTRY, __VA_ARGS__)

     ^

C:\Users\uriya\Documents\Arduino\libraries\AzureIoTUtility\src/azure_c_shared_utility/constbuffer.h:35:1: note: in expansion of macro 'MOCKABLE_INTERFACE'

 MOCKABLE_INTERFACE(constbuffer,

 ^

C:\Users\uriya\Documents\Arduino\libraries\AzureIoTHub\src\iothub_client_ll_uploadtoblob.c:26:27: fatal error: internal/blob.h: No such file or directory

 #include "internal/blob.h"

                           ^

compilation terminated.

exit status 1
Error compiling for board Generic ESP8266 Module.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Любое предложение или комментарий очень поможет мне


person Uriyasama    schedule 25.12.2019    source источник


Ответы (4)


Это сообщение может быть решением.

По существу отредактируйте .\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\platform.txt так, чтобы он имел следующую строку:

build.extra_flags=-DESP8266 -DDONT_USE_UPLOADTOBLOB -DUSE_BALTIMORE_CERT
person Benn    schedule 28.04.2020

Проверьте, помогает это или нет http://learniotwithzain.com/2018/10/send-data-from-nodemcu-to-azure-iot-hub/

person Zainu    schedule 26.12.2019

Возможно, вы столкнулись со следующей похожей проблемой: https://github.com/arduino/Arduino/issues/7930

это оказалось arduino-builder, который был исправлен с помощью: https://github.com/arduino/arduino-builder/pull/285

person Amicis    schedule 27.12.2019

В файле platform.txt есть важная подсказка в строке, предшествующей build.extra_flags=:
# Это можно переопределить в boards.txt

Используя универсальную плату 8266, мне пришлось изменить build.extra_flag в файле boards.txt следующим образом, чтобы скомпилировать примеры Azure:

generic.menu.CrystalFreq.40.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266 -DDONT_USE_UPLOADTOBLOB -DUSE_BALTIMORE_CERT
person Thomas    schedule 26.08.2020