Azure-Samples / iot-hub-c-m0wifi-getstartedkit

Get started with the Adafruit Feather M0 Wifi Azure IoT Starter Kit
MIT License
5 stars 8 forks source link

Missing WiFi101.h error #37

Closed richardcornell closed 8 years ago

richardcornell commented 8 years ago

Following the starter kit instructions for remote monitoring with the Adafruit Huzzah ESP8266 works until I compile the sketch at step 1.8 and the following error results: C:\Users\Documents\Arduino\libraries\AzureIoT\src\util/HTTPSClient.h:4:21: fatal error: WiFi101.h: No such file or directory

include

Is there something missing from the instructions i.e. something else that needs to be installed as the file is not present on my PC. Adding the WiFi101 library to Arduino IDE (which is not mentioned in the instructions) causes more compilation errors.

stefangordon commented 8 years ago

Hey Richard, are you using the m0 sample (this repo) with the Huzzah, or the Huzzah sample/instructions? https://github.com/Azure-Samples/iot-hub-c-huzzah-getstartedkit

richardcornell commented 8 years ago

I'm using the https://github.com/Azure-Samples/iot-hub-c-huzzah-getstartedkit sample and instructions.

stefangordon commented 8 years ago

Great. Also verify you have the Huzzah selected from the board selection UI in your Arduino IDE - that is the most likely reason it would try to use the incorrect headers as they are selected in httpsclient.h based on the type of board you are compiling for.

stefangordon commented 8 years ago

Oh - Sorry Richard, I suspect these instructions were incorrect and led you to install the Azure IoT Library from the Arduino UI - this version looks to be not refreshed with the latest for the Huzzah yet. You should remove the existing AzureIoT library with the library manager, and download the library from https://github.com/stefangordon/AzureIoT by cloning the repo, or just downloading it as zip from https://github.com/stefangordon/AzureIoT/archive/master.zip and placing the AzureIot folder in C:\Program Files (x86)\Arduino\libraries and restarting the IDE.

I have just updated the readme at https://github.com/stefangordon/AzureIoT.

ETA for the library to be available from the Arduino UI is end of day Monday.

richardcornell commented 8 years ago

The library manager doesn't appear to allow the uninstall of the AzureIoT library that's already there so I have copied the new AzureIoT folder into Program Files (x86)\Arduino\libraries and there are a load of compile errors starting with; C:\Program Files (x86)\Arduino\libraries\AzureIoT\src\esp8266\libc_esp.c: In function 'fprintf': C:\Program Files (x86)\Arduino\libraries\AzureIoT\src\esp8266\libc_esp.c:19:5: error: incompatible type for argument 2 of 'ets_vprintf' ret = ets_vprintf(format, arglist);

It ends by saying; Multiple libraries were found for "AzureIoT.h" Used: C:\Program Files (x86)\Arduino\libraries\AzureIoT Not used: C:\Users\Documents\Arduino\libraries\AzureIoT

Unless you have any other suggestions I'll remove Arduino IDE and start again when I have time.

stefangordon commented 8 years ago

Ack - I've gotten to the bottom of it now. You caught us between versions trying to catch up with some breaking changes in the ESP8266 board libraries. I apologize for all the trouble - I have reproduced the error you got and confirmed the fix.

If you'll switch over to the official library now it is compatible with the ESP8266 2.2.0 board you have installed.

This means downloading from the official rather than my fork https://github.com/arduino-libraries/AzureIoT/archive/master.zip

and replacing the bits you put in your Arduino\libraries with it.

We'll have all this straightened out within a day or so - thanks for raising the issue so we can get it cleaned up.

stefangordon commented 8 years ago

Next issue you might run into is the DHT22 remote monitoring sample in those instructions being outdated - I'm verifying that now.

stefangordon commented 8 years ago

Instructions and remote monitoring sample are updated in the quick start at https://github.com/Azure-Samples/iot-hub-c-huzzah-getstartedkit to reflect using the latest library and some tweaks to the .ino to be compatible.

richardcornell commented 8 years ago

I've updated the files and its all working fine now and I can see data from the sensors being displayed in the Azure IoT Suite dashboard! Huzzah! Thank you Stefan.

stefangordon commented 8 years ago

Perfect, thanks Richard.