Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
WieFel opened this issue Jun 10, 2019 · 3 comments

Comments

@WieFel
Copy link

WieFel commented Jun 10, 2019

  • Arduino board: Adafruit Feather M0

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.9

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too):
    I am trying to compile the example adafruitio_02_pubsub for my board. I opened the example project using the Arduino IDE.
    The only things I modified were the IO_USERNAME, IO_KEY, WIFI_SSID and WIFI_PASS fields in the file config.h.
    In the main file adafruitio_02_pubsub.ino I only added the line WiFi.setPins(8,7,4,2); as the first line in the setup() function as it is done in the setup guide here: https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500/using-the-wifi-module#check-connections-and-version-7-7

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
Copy link
Member

brentru commented Jun 10, 2019

@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
Copy link
Author

WieFel commented Jun 11, 2019

@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!

@brentru brentru closed this as completed Jun 11, 2019
@a7u7a
Copy link

a7u7a commented Mar 6, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants