Azure / azure-iot-arduino

Azure IoT library for the Arduino
Other
167 stars 96 forks source link

AzureIoTSocket_WiFi library is missing #102

Closed Saleh-Elhalaby closed 4 years ago

Saleh-Elhalaby commented 4 years ago

Hi guys I was trying to connect my esp32 to azure iot hub. but when installing AzureIoTSocket_WiFi from the library manger in arduino i couldn't find it as this guid said https://github.com/azure/azure-iot-arduino and on compiling of course this error pops up "fatal error: AzureIoTSocket_WiFi.h: No such file or directory". i tried to search for the missing library but i had no luck finding it.

blueish4 commented 4 years ago

It seems like the repo isn't available any more, but there is a copy of the library at https://github.com/Azure/azure-iot-pal-arduino/tree/master/build_all/base-libraries/AzureIoTSocket_WiFi

I'm pretty sure this is just an issue with the ESP32 platform, since the ESP8266 and SAMD code in the AzureIoTUtility library (which fails to compile here) doesn't reference it - probably because it only acts as an include for the platform appropriate wifi library.

jbobotek commented 4 years ago

Yes, the current process to obtain this library is to do so manually, by running the make_sdk.py to build the libraries and add them to your Arduino libraries folder.

Instructions are here: https://github.com/Azure/azure-iot-pal-arduino/blob/master/build_all/base-libraries/AzureIoTHub/README.md#prerequisites

Saleh-Elhalaby commented 4 years ago

Thanks guys i will go and try your solutions

ReneHezser commented 4 years ago

Yes, the current process to obtain this library is to do so manually, by running the make_sdk.py to build the libraries and add them to your Arduino libraries folder.

Instructions are here: https://github.com/Azure/azure-iot-pal-arduino/blob/master/build_all/base-libraries/AzureIoTHub/README.md#prerequisites

@jbobotek Can we make the libraries available through the library manager? It is an extra hassle to go though building them manually :-( And you can easily forget this step which is frustrating :-(

Tintin4000 commented 4 years ago

Hi, would you please be able to assist with a step by step description on how to build the library? I have downloaded the repo, went into build_all as described in the Prerequisites, however there is no make_sdk.py file so I am a little stuck. Thank you for your help. This issue is closed so I am not sure if it makes sense to comment on it?

jbobotek commented 4 years ago

Did you git clone the pal-Arduino repo linked above?

Tintin4000 commented 4 years ago

Hi jbobotek, I did git clone the pal-arduino now. While trying to build I got the following error:

File "make_sdk.py", line 196, in run() File "make_sdk.py", line 106, in run dir_util.copy_tree(azure_iot_sdk_path + 'iothub_client/src/', sdk_path) File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\distutils\dir_util.py", line 123, in copy_tree raise DistutilsFileError( distutils.errors.DistutilsFileError: cannot copy tree 'C:\Users\xxxxx\Documents\Arduino\azure-iot-pal-arduino/sdk/iothub_client/src/': not a directory.

I presume I need to git clone the entire sdk at some specific location? As I said first time doing this, so not that experienced.

jbobotek commented 4 years ago

Yes. Call git submodule update --init --recursive.

jbobotek commented 4 years ago

or git clone --recursive

Tintin4000 commented 4 years ago

Hi jbobotek, I am maybe one step further but still not there. After using git clone --recursive https://github.com/Azure/azure-iot-pal-arduino.git, I have now a combination of the repo here above and the sdk. However when I run python make_sdk.py -o C:\Users\xxxxx\Documents\Arduino\Azure-iot-arduino, I still get the following error, since there is no such "inc" dir in the iothub_client. File "make_sdk.py", line 196, in run() File "make_sdk.py", line 107, in run dir_util.copy_tree(azure_iot_sdk_path + 'iothub_client/inc/', sdk_path) File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\distutils\dir_util.py", line 123, in copy_tree raise DistutilsFileError( distutils.errors.DistutilsFileError: cannot copy tree 'C:\Users\xxxx\Documents\Arduino\azure-iot-pal-arduino/sdk/iothub_client/inc/': not a directory

jbobotek commented 4 years ago

This means that the submodules weren't actually downloaded. The folder exists: https://github.com/Azure/azure-iot-sdk-c/tree/master/iothub_client/inc Try the other command while in the git repo.

Tintin4000 commented 4 years ago

After cloning a second time, the "inc" directory appeared and I could compile the library. Thank you so much for your help, I learned a lot. Now my code is breaking but one thing at the time ;-). I will try the example and get started again from there. Thx.