adafruit / Adafruit_IO_Arduino

Arduino library to access Adafruit IO from WiFi, cellular, and ethernet modules.
Other
210 stars 107 forks source link

Example compiling error: Must define USE_AIRLIFT or USE_WINC1500 before including this file. #91

Closed WieFel closed 5 years ago

WieFel commented 5 years ago

However, when compiling the code I get the following error:

In file included from sketch/config.h:30:0,
                 from /home/felix/Arduino/adafruitio_02_pubsub/adafruitio_02_pubsub.ino:18:
/home/felix/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_WiFi.h:47:4: error: #error "Must define USE_AIRLIFT or USE_WINC1500 before including this file."
   #error "Must define USE_AIRLIFT or USE_WINC1500 before including this file."
    ^
exit status 1
Error compiling for board Adafruit Feather M0.

I cannot find out what the actual problem is. With earlier versions of the Adafruit IO examples I didn't encounter any problems. All the libraries necessary for using Adafruit board with Arduino IDE (Arduino SAMD Boards, Adafruit SAMD Boards, Adafruit IO Arduino 3.2.0, WiFi101 0.16.0) are uptodate. Any suggestions?

brentru commented 5 years ago

@WieFel Uncomment the #define USE_WINC1500 at the top of your config.h file. (see here: https://github.com/adafruit/Adafruit_IO_Arduino/blob/master/examples/adafruitio_02_pubsub/config.h#L27)

Are you using a Feather M0 + a WINC 1500 breakout? Or are you using the Adafruit Feather M0 WiFi (integrated Winc1500 module)?

If you're using the M0 WiFi, you do not need to perform the WiFi.setPins call from your .ino code, it's added into this library already.

WieFel commented 5 years ago

@WieFel Uncomment the #define USE_WINC1500 at the top of your config.h file. (see here: https://github.com/adafruit/Adafruit_IO_Arduino/blob/master/examples/adafruitio_02_pubsub/config.h#L27)

Are you using a Feather M0 + a WINC 1500 breakout? Or are you using the Adafruit Feather M0 WiFi (integrated Winc1500 module)?

If you're using the M0 WiFi, you do not need to perform the WiFi.setPins call from your .ino code, it's added into this library already.

Thanks, uncommenting #define USE_WINC1500 and removing the WiFi.setPins call solved the problem!

a7u7a commented 1 year ago

Hi, I'm running into this issue but when I add #define USE_WINC1500 right after #include "AdafruitIO_WiFi.h" then I get the following error:

In file included from /Users/userfriendly/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_Feed.h:21,
                 from /Users/userfriendly/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO.h:22,
                 from /Users/userfriendly/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/wifi/AdafruitIO_WINC1500.h:21,
                 from /Users/userfriendly/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_WiFi.h:36,
                 from /Users/userfriendly/Documents/Arduino/neopixel_and_thermometer/config.h:37,
                 from /Users/userfriendly/Documents/Arduino/neopixel_and_thermometer/neopixel_and_thermometer.ino:20:
/Users/userfriendly/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:28: warning: "strncpy_P" redefined

I'm trying to compile the following example from the library: https://github.com/adafruit/Adafruit_IO_Arduino/tree/master/examples/io_home_series/neopixel_and_thermometer

This is on a freshly installed Arduino IDE and latest dependencies

Any pointers on how to compile this?