0

IO Basics: Example 07_digital_out. With Winc1500 & Arduino u
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

IO Basics: Example 07_digital_out. With Winc1500 & Arduino u

by lorenzo_1025 on Thu May 02, 2019 11:42 am

Hi everyone

I'm trying out the Adafruit io with an example from the "Adafruit IO Arduino" Library. In example 07, the goal is to Turn an LED on/off using Adafruit IO. I followed the guide and set up my Feed/Dashboard on the Adafruit IO.

The program on the Arduino has 2 parts, one being config.h. In this part, information like IO_username, IO_Key, SSID, etc.. are being set. There, I'm encountering issues while trying to set the hardware that I'm using ( https://cdn-learn.adafruit.com/downloads/pdf/adafruit-atwinc1500-wifi-module-breakout.pdf ). In the program shown (which is literally a copy-paste from the library), it is asked to uncomment sections if you use one or another hardware type, which I did.

I'm now wondering where information like:

Code: Select all | TOGGLE FULL SIZE
#define WINC_CS   8
#define WINC_IRQ  7
#define WINC_RST  4
#define WINC_EN   2 

Adafruit_WINC1500 WiFi(WINC_CS, WINC_IRQ, WINC_RST);


are to be written. And thus how to make the example work.


The code is as follows:

Code: Select all | TOGGLE FULL SIZE
/************************ Adafruit IO Config *******************************/

// visit io.adafruit.com if you need to create an account,
// or if you need your Adafruit IO key.
#define IO_USERNAME   "lorenzo_1025"
#define IO_KEY        "xxxxxxxxxxx"

/******************************* WIFI **************************************/

// the AdafruitIO_WiFi client will work with the following boards:
//   - HUZZAH ESP8266 Breakout -> https://www.adafruit.com/products/2471
//   - Feather HUZZAH ESP8266 -> https://www.adafruit.com/products/2821
//   - Feather HUZZAH ESP32 -> https://www.adafruit.com/product/3405
//   - Feather M0 WiFi -> https://www.adafruit.com/products/3010
//   - Feather WICED -> https://www.adafruit.com/products/3056
//   - Adafruit PyPortal -> https://www.adafruit.com/product/4116
//   - Adafruit Metro M4 Express AirLift Lite -> https://www.adafruit.com/product/4000
//   - Adafruit AirLift Breakout -> https://www.adafruit.com/product/4201

#define WIFI_SSID   "xxxxxxxxxxxxx"
#define WIFI_PASS   "xxxxxxxx"

// uncomment the following line if you are using airlift
// #define USE_AIRLIFT

// uncomment the following line if you are using winc1500
#define USE_WINC1500

// comment out the following lines if you are using fona or ethernet
#include "AdafruitIO_WiFi.h"

#ifdef USE_AIRLIFT
  // Configure the pins used for the ESP32 connection
  #if !defined(SPIWIFI_SS) // if the wifi definition isnt in the board variant
    // Don't change the names of these #define's! they match the variant ones
    #define SPIWIFI SPI
    #define SPIWIFI_SS 10  // Chip select pin
    #define SPIWIFI_ACK 9  // a.k.a BUSY or READY pin
    #define ESP32_RESETN 6 // Reset pin
    #define ESP32_GPIO0 -1 // Not connected
  #endif
  AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS, SPIWIFI_SS, SPIWIFI_ACK, ESP32_RESETN, ESP32_GPIO0, &SPIWIFI);
#else
  AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
#endif
/******************************* FONA **************************************/

// the AdafruitIO_FONA client will work with the following boards:
//   - Feather 32u4 FONA -> https://www.adafruit.com/product/3027

// uncomment the following two lines for 32u4 FONA,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include "AdafruitIO_FONA.h"
// AdafruitIO_FONA io(IO_USERNAME, IO_KEY);

/**************************** ETHERNET ************************************/

// the AdafruitIO_Ethernet client will work with the following boards:
//   - Ethernet FeatherWing -> https://www.adafruit.com/products/3201

// uncomment the following two lines for ethernet,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include "AdafruitIO_Ethernet.h"
// AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY);


The Error code:

Code: Select all | TOGGLE FULL SIZE
In file included from sketch\config.h:30:0,

                 from C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_620994\adafruitio_07_digital_out.ino:19:

C:\Users\Laurent\Documents\Arduino\libraries\Adafruit_IO_Arduino\src/AdafruitIO_WiFi.h:28:11: error: 'AdafruitIO_WINC1500' does not name a type

   typedef AdafruitIO_WINC1500 AdafruitIO_WiFi;

           ^

In file included from C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_620994\adafruitio_07_digital_out.ino:19:0:

config.h:44:3: error: 'AdafruitIO_WiFi' does not name a type

   AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);

   ^

adafruitio_07_digital_out:27:1: error: 'AdafruitIO_Feed' does not name a type

 AdafruitIO_Feed *digital = io.feed("digital");

 ^

adafruitio_07_digital_out:75:20: error: variable or field 'handleMessage' declared void

 void handleMessage(AdafruitIO_Data *data) {

                    ^

adafruitio_07_digital_out:75:20: error: 'AdafruitIO_Data' was not declared in this scope

adafruitio_07_digital_out:75:37: error: 'data' was not declared in this scope

 void handleMessage(AdafruitIO_Data *data) {

                                     ^

C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_620994\adafruitio_07_digital_out.ino: In function 'void setup()':

adafruitio_07_digital_out:41:3: error: 'io' was not declared in this scope

   io.connect();

   ^

adafruitio_07_digital_out:47:3: error: 'digital' was not declared in this scope

   digital->onMessage(handleMessage);

   ^

adafruitio_07_digital_out:47:22: error: 'handleMessage' was not declared in this scope

   digital->onMessage(handleMessage);

                      ^

adafruitio_07_digital_out:50:23: error: 'AIO_CONNECTED' was not declared in this scope

   while(io.status() < AIO_CONNECTED) {

                       ^

C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_620994\adafruitio_07_digital_out.ino: In function 'void loop()':

adafruitio_07_digital_out:68:3: error: 'io' was not declared in this scope

   io.run();

   ^

C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_620994\adafruitio_07_digital_out.ino: At global scope:

adafruitio_07_digital_out:75:20: error: variable or field 'handleMessage' declared void

 void handleMessage(AdafruitIO_Data *data) {

                    ^

adafruitio_07_digital_out:75:20: error: 'AdafruitIO_Data' was not declared in this scope

adafruitio_07_digital_out:75:37: error: 'data' was not declared in this scope

 void handleMessage(AdafruitIO_Data *data) {

                                     ^
exit status 1
'AdafruitIO_WiFi' does not name a type



Hope all the needed information has been written.

lorenzo_1025
 
Posts: 9
Joined: Tue Apr 23, 2019 4:01 am

Re: IO Basics: Example 07_digital_out. With Winc1500 & Ardui

by brubell on Thu May 02, 2019 12:05 pm

We just updated Adafruit IO Arduino this past week to include compatibility for the AirLift boards/breakouts. We also added the ability to set the WINC1500's pins right from the config.h file with this update.

In the config.h file, uncomment:
Code: Select all | TOGGLE FULL SIZE
#define USE_WINC1500

Then, add the custom pins into the following (replacing WINC_CS with the Chip select Pin #, etc..)
Code: Select all | TOGGLE FULL SIZE
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS, WINC_CS, WINC_IRQ, WINC_RST, WINC_EN);

You do not need to set the pins in the main code, they're set and initialized in config.h.

brubell
 
Posts: 402
Joined: Fri Jul 17, 2015 10:33 pm

Re: IO Basics: Example 07_digital_out. With Winc1500 & Ardui

by lorenzo_1025 on Thu May 02, 2019 12:52 pm

Hi Brubell

Thanks for the quick reply! I've update my code with the information you gave me. Am I doing this right?

Code: Select all | TOGGLE FULL SIZE
/************************ Adafruit IO Config *******************************/

// visit io.adafruit.com if you need to create an account,
// or if you need your Adafruit IO key.
#define IO_USERNAME   "lorenzo_1025"
#define IO_KEY        "xxxxxxxxxxxxxxxxx"

/******************************* WIFI **************************************/

// the AdafruitIO_WiFi client will work with the following boards:
//   - HUZZAH ESP8266 Breakout -> https://www.adafruit.com/products/2471
//   - Feather HUZZAH ESP8266 -> https://www.adafruit.com/products/2821
//   - Feather HUZZAH ESP32 -> https://www.adafruit.com/product/3405
//   - Feather M0 WiFi -> https://www.adafruit.com/products/3010
//   - Feather WICED -> https://www.adafruit.com/products/3056
//   - Adafruit PyPortal -> https://www.adafruit.com/product/4116
//   - Adafruit Metro M4 Express AirLift Lite -> https://www.adafruit.com/product/4000
//   - Adafruit AirLift Breakout -> https://www.adafruit.com/product/4201

#define WIFI_SSID   "xxxxxxxx"
#define WIFI_PASS   "xx"

// uncomment the following line if you are using airlift
// #define USE_AIRLIFT

// uncomment the following line if you are using winc1500
#define USE_WINC1500

// comment out the following lines if you are using fona or ethernet
#include "AdafruitIO_WiFi.h"

#ifdef USE_AIRLIFT
  // Configure the pins used for the ESP32 connection
  #if !defined(SPIWIFI_SS) // if the wifi definition isnt in the board variant
    // Don't change the names of these #define's! they match the variant ones
    #define SPIWIFI SPI
    #define SPIWIFI_SS 10  // Chip select pin
    #define SPIWIFI_ACK 9  // a.k.a BUSY or READY pin
    #define ESP32_RESETN 6 // Reset pin
    #define ESP32_GPIO0 -1 // Not connected
  #endif
  AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS, 8, 7, 4, 2);
#else
  AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
#endif


Somehow still not compiling correctly. The error code looks quite similar to the first one.

Error code:

Code: Select all | TOGGLE FULL SIZE
In file included from sketch\config.h:30:0,

                 from C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_842663\adafruitio_07_digital_out.ino:19:

C:\Users\Laurent\Documents\Arduino\libraries\Adafruit_IO_Arduino\src/AdafruitIO_WiFi.h:28:11: error: 'AdafruitIO_WINC1500' does not name a type

   typedef AdafruitIO_WINC1500 AdafruitIO_WiFi;

           ^

In file included from C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_842663\adafruitio_07_digital_out.ino:19:0:

config.h:44:3: error: 'AdafruitIO_WiFi' does not name a type

   AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);

   ^

adafruitio_07_digital_out:27:1: error: 'AdafruitIO_Feed' does not name a type

 AdafruitIO_Feed *digital = io.feed("digital");

 ^

adafruitio_07_digital_out:75:20: error: variable or field 'handleMessage' declared void

 void handleMessage(AdafruitIO_Data *data) {

                    ^

adafruitio_07_digital_out:75:20: error: 'AdafruitIO_Data' was not declared in this scope

adafruitio_07_digital_out:75:37: error: 'data' was not declared in this scope

 void handleMessage(AdafruitIO_Data *data) {

                                     ^

C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_842663\adafruitio_07_digital_out.ino: In function 'void setup()':

adafruitio_07_digital_out:41:3: error: 'io' was not declared in this scope

   io.connect();

   ^

adafruitio_07_digital_out:47:3: error: 'digital' was not declared in this scope

   digital->onMessage(handleMessage);

   ^

adafruitio_07_digital_out:47:22: error: 'handleMessage' was not declared in this scope

   digital->onMessage(handleMessage);

                      ^

adafruitio_07_digital_out:50:23: error: 'AIO_CONNECTED' was not declared in this scope

   while(io.status() < AIO_CONNECTED) {

                       ^

C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_842663\adafruitio_07_digital_out.ino: In function 'void loop()':

adafruitio_07_digital_out:68:3: error: 'io' was not declared in this scope

   io.run();

   ^

C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_842663\adafruitio_07_digital_out.ino: At global scope:

adafruitio_07_digital_out:75:20: error: variable or field 'handleMessage' declared void

 void handleMessage(AdafruitIO_Data *data) {

                    ^

adafruitio_07_digital_out:75:20: error: 'AdafruitIO_Data' was not declared in this scope

adafruitio_07_digital_out:75:37: error: 'data' was not declared in this scope

 void handleMessage(AdafruitIO_Data *data) {

                                     ^

exit status 1
'AdafruitIO_WiFi' does not name a type



Edit: It feels like I'm missing something but cannot figure out what it is to solve this "simple" issue. Thanks for any help I can get! :)

lorenzo_1025
 
Posts: 9
Joined: Tue Apr 23, 2019 4:01 am

Re: IO Basics: Example 07_digital_out. With Winc1500 & Ardui

by lorenzo_1025 on Tue May 07, 2019 6:38 am

Hi

I've tried to figure out the issue I'm having with the program, this is what I have done:

1. I've tried to include the Winc1500, Adafruit IO and Adafruit MQTT library in the sketch, as follows:

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_MQTT.h>
#include <Adafruit_MQTT_Client.h>
//#include <Adafruit_MQTT_FONA.h>

#include <AdafruitIO.h>
#include <AdafruitIO_Dashboard.h>
#include <AdafruitIO_Data.h>
#include <AdafruitIO_Definitions.h>
#include <AdafruitIO_Ethernet.h>
#include <AdafruitIO_Feed.h>
//#include <AdafruitIO_FONA.h>
#include <AdafruitIO_Group.h>
#include <AdafruitIO_MQTT.h>
#include <AdafruitIO_Time.h>
#include <AdafruitIO_WiFi.h>

#include <Adafruit_WiFiMDNSResponder.h>
#include <Adafruit_WINC1500.h>
#include <Adafruit_WINC1500Client.h>
#include <Adafruit_WINC1500Server.h>
#include <Adafruit_WINC1500SSLClient.h>
#include <Adafruit_WINC1500Udp.h>

/************************ Adafruit IO Config *******************************/


#define USE_WINC1500
#include "AdafruitIO_WiFi.h"

// visit io.adafruit.com if you need to create an account,
// or if you need your Adafruit IO key.
#define IO_USERNAME   "your_username"
#define IO_KEY        "your_key"

/******************************* WIFI **************************************/

#define WIFI_SSID   "your_ssid"
#define WIFI_PASS   "your_pass"

// uncomment the following line if you are using airlift
// #define USE_AIRLIFT

#ifdef USE_AIRLIFT
  // Configure the pins used for the ESP32 connection
  #if !defined(SPIWIFI_SS) // if the wifi definition isnt in the board variant
    // Don't change the names of these #define's! they match the variant ones
    #define SPIWIFI SPI
    #define SPIWIFI_SS 10  // Chip select pin
    #define SPIWIFI_ACK 9  // a.k.a BUSY or READY pin
    #define ESP32_RESETN 6 // Reset pin
    #define ESP32_GPIO0 -1 // Not connected
  #endif
  AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS, 8, 7, 4, 2);
#else
  AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
#endif
/******************************* FONA **************************************/

// the AdafruitIO_FONA client will work with the following boards:
//   - Feather 32u4 FONA -> https://www.adafruit.com/product/3027

// uncomment the following two lines for 32u4 FONA,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include "AdafruitIO_FONA.h"
// AdafruitIO_FONA io(IO_USERNAME, IO_KEY);

/**************************** ETHERNET ************************************/

// the AdafruitIO_Ethernet client will work with the following boards:
//   - Ethernet FeatherWing -> https://www.adafruit.com/products/3201

// uncomment the following two lines for ethernet,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include "AdafruitIO_Ethernet.h"
// AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY);


THe error code tells me that I have to define "use_WINC1500" before including the file:

Code: Select all | TOGGLE FULL SIZE
In file included from sketch\config.h:15:0,

                 from C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_926138\adafruitio_07_digital_out.ino:19:

C:\Users\Laurent\Documents\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 Arduino/Genuino Uno.


2. when I set the #define USE_WINC1500 before calling #include "libraries", I get following error code:

Code: Select all | TOGGLE FULL SIZE
In file included from sketch\config.h:17:0,

                 from C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_769247\adafruitio_07_digital_out.ino:19:

C:\Users\Laurent\Documents\Arduino\libraries\Adafruit_IO_Arduino\src/AdafruitIO_WiFi.h:28:11: error: 'AdafruitIO_WINC1500' does not name a type

   typedef AdafruitIO_WINC1500 AdafruitIO_WiFi;

           ^

In file included from C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_769247\adafruitio_07_digital_out.ino:19:0:

config.h:57:3: error: 'AdafruitIO_WiFi' does not name a type

   AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);

   ^

adafruitio_07_digital_out:27:28: error: 'io' was not declared in this scope

 AdafruitIO_Feed *digital = io.feed("digital");

                            ^

C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_769247\adafruitio_07_digital_out.ino: In function 'void setup()':

adafruitio_07_digital_out:41:3: error: 'io' was not declared in this scope

   io.connect();

   ^

C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_769247\adafruitio_07_digital_out.ino: In function 'void loop()':

adafruitio_07_digital_out:68:3: error: 'io' was not declared in this scope

   io.run();

   ^

exit status 1
'AdafruitIO_WiFi' does not name a type



I don't really know how to continue... Do I have to include those libraries? If no, what am I doing wrong?

lorenzo_1025
 
Posts: 9
Joined: Tue Apr 23, 2019 4:01 am

Re: IO Basics: Example 07_digital_out. With Winc1500 & Ardui

by brubell on Thu May 09, 2019 9:22 am

I tried to replicate this issue on my-end with no compile-errors for the WINC1500 when attached to a Feather M0.

1) Are you using Adafruit IO Arduino v3.1.0?
2) Are you using Adafruit MQTT V1.0 or higher?
3) What board are you connecting the WINC1500 breakout to? Could you provide a product page or link?

Could you try using example_07_digital_out, and post your config.h along with the errors in a reply as a code block?

This will help me narrow down the issue. Thanks!

brubell
 
Posts: 402
Joined: Fri Jul 17, 2015 10:33 pm

Re: IO Basics: Example 07_digital_out. With Winc1500 & Ardui

by lorenzo_1025 on Thu May 09, 2019 10:47 am

Hi Brubell

Thank you for your guidance

1) Adafruit IO arduino, version 3.1.0
https://ibb.co/GC98Yg3

2) Adafruit MQTT, version 1.0.1
https://ibb.co/GC98Yg3

3) Arduino Uno, Art n° AA000066
https://store.arduino.cc/arduino-uno-rev3

3.1) IDE version 1.8.9

3.2.) Winc 1500, Art n° 3060
with uFL connector, Firmwire version 19.4.4 (checked with WiFi101 library)

To the Code (config.h)

Code: Select all | TOGGLE FULL SIZE
************************ Adafruit IO Config *******************************/

// visit io.adafruit.com if you need to create an account,
// or if you need your Adafruit IO key.
#define IO_USERNAME   ""
#define IO_KEY        ""

/******************************* WIFI **************************************/

#define WIFI_SSID   ""
#define WIFI_PASS   ""

// uncomment the following line if you are using airlift
// #define USE_AIRLIFT

// uncomment the following line if you are using winc1500
#define USE_WINC1500

// comment out the following lines if you are using fona or ethernet
#include "AdafruitIO_WiFi.h"

#ifdef USE_AIRLIFT
  // Configure the pins used for the ESP32 connection
  #if !defined(SPIWIFI_SS) // if the wifi definition isnt in the board variant
    // Don't change the names of these #define's! they match the variant ones
    #define SPIWIFI SPI
    #define SPIWIFI_SS 10  // Chip select pin
    #define SPIWIFI_ACK 9  // a.k.a BUSY or READY pin
    #define ESP32_RESETN 6 // Reset pin
    #define ESP32_GPIO0 -1 // Not connected
  #endif
  AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS, 8, 7, 4, 2);
#else
  AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
#endif
/******************************* FONA **************************************/

// the AdafruitIO_FONA client will work with the following boards:
//   - Feather 32u4 FONA -> https://www.adafruit.com/product/3027

// uncomment the following two lines for 32u4 FONA,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include "AdafruitIO_FONA.h"
// AdafruitIO_FONA io(IO_USERNAME, IO_KEY);

/**************************** ETHERNET ************************************/

// the AdafruitIO_Ethernet client will work with the following boards:
//   - Ethernet FeatherWing -> https://www.adafruit.com/products/3201

// uncomment the following two lines for ethernet,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include "AdafruitIO_Ethernet.h"
// AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY);


Error Code

Code: Select all | TOGGLE FULL SIZE
In file included from sketch\config.h:30:0,

                 from C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_138662\adafruitio_07_digital_out.ino:19:

C:\Users\Laurent\Documents\Arduino\libraries\Adafruit_IO_Arduino\src/AdafruitIO_WiFi.h:28:11: error: 'AdafruitIO_WINC1500' does not name a type

   typedef AdafruitIO_WINC1500 AdafruitIO_WiFi;

           ^

In file included from C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_138662\adafruitio_07_digital_out.ino:19:0:

config.h:44:3: error: 'AdafruitIO_WiFi' does not name a type

   AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);

   ^

adafruitio_07_digital_out:27:1: error: 'AdafruitIO_Feed' does not name a type

 AdafruitIO_Feed *digital = io.feed("digital");

 ^

adafruitio_07_digital_out:75:20: error: variable or field 'handleMessage' declared void

 void handleMessage(AdafruitIO_Data *data) {

                    ^

adafruitio_07_digital_out:75:20: error: 'AdafruitIO_Data' was not declared in this scope

adafruitio_07_digital_out:75:37: error: 'data' was not declared in this scope

 void handleMessage(AdafruitIO_Data *data) {

                                     ^

C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_138662\adafruitio_07_digital_out.ino: In function 'void setup()':

adafruitio_07_digital_out:41:3: error: 'io' was not declared in this scope

   io.connect();

   ^

adafruitio_07_digital_out:47:3: error: 'digital' was not declared in this scope

   digital->onMessage(handleMessage);

   ^

adafruitio_07_digital_out:47:22: error: 'handleMessage' was not declared in this scope

   digital->onMessage(handleMessage);

                      ^

adafruitio_07_digital_out:50:23: error: 'AIO_CONNECTED' was not declared in this scope

   while(io.status() < AIO_CONNECTED) {

                       ^

C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_138662\adafruitio_07_digital_out.ino: In function 'void loop()':

adafruitio_07_digital_out:68:3: error: 'io' was not declared in this scope

   io.run();

   ^

C:\Users\Laurent\AppData\Local\Temp\arduino_modified_sketch_138662\adafruitio_07_digital_out.ino: At global scope:

adafruitio_07_digital_out:75:20: error: variable or field 'handleMessage' declared void

 void handleMessage(AdafruitIO_Data *data) {

                    ^

adafruitio_07_digital_out:75:20: error: 'AdafruitIO_Data' was not declared in this scope

adafruitio_07_digital_out:75:37: error: 'data' was not declared in this scope

 void handleMessage(AdafruitIO_Data *data) {

                                     ^

exit status 1
'AdafruitIO_WiFi' does not name a type



To the Wiring:

The wiring is done correctly, since I was able to compile and use every example from the "WiFi101" library that I've downloaded here:
https://github.com/adafruit/Adafruit_WINC1500

lorenzo_1025
 
Posts: 9
Joined: Tue Apr 23, 2019 4:01 am

Re: IO Basics: Example 07_digital_out. With Winc1500 & Ardui

by brubell on Fri May 10, 2019 10:26 am

Arduino Uno, Art n° AA000066
https://store.arduino.cc/arduino-uno-rev3


The Arduino Uno (or Adafruit Metro) is not compatible with the ATWINC1500 breakout and Adafruit IO Arduino, it doesn't have enough flash memory.

I removed the conditional define for SAMD boards (the library only compiles for the WINC1500 for these boards) and got the following error while compiling for Metro:
Sketch uses 34678 bytes (107%) of program storage space. Maximum is 32256 bytes.

Global variables use 1687 bytes (82%) of dynamic memory, leaving 361 bytes for local variables. Maximum is 2048 bytes.
Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.
Error compiling for board Adafruit Metro.


You may want to try using an Adafruit Metro Express M0 (https://www.adafruit.com/product/3505) or any other SAMD (non-AVR) board with this library. I'll be releasing an update which produces a more verbose error when you try to use a AVR board with the WINC1500 or AIRLIFT class.

brubell
 
Posts: 402
Joined: Fri Jul 17, 2015 10:33 pm

Re: IO Basics: Example 07_digital_out. With Winc1500 & Ardui

by lorenzo_1025 on Fri May 10, 2019 11:33 am

Thank you for your answer.
I would like to stick to the arduino products, do you think an Arduino Mega (https://store.arduino.cc/mega-2560-r3) would do the job? The flash memory is heavily increased from 32 to 256 KB.

brubell wrote:The Arduino Uno (or Adafruit Metro) is not compatible with the ATWINC1500 breakout and Adafruit IO Arduino, it doesn't have enough flash memory.


I'm quite troubled by the statement. Images of an Arduino Uno are to be seen in the WINC1500 guide. (https://cdn-learn.adafruit.com/download ... eakout.pdf). Can I thus understand that the Uno is compatible with the WINC1500 but not with anything that requires high flash memory (like the example 07 of the Adafruit IO library)?

I will keep you informed as soon as I have the Mega ready.

lorenzo_1025
 
Posts: 9
Joined: Tue Apr 23, 2019 4:01 am

Re: IO Basics: Example 07_digital_out. With Winc1500 & Ardui

by adafruit2 on Fri May 10, 2019 12:25 pm

you can use metro/uno/328 for some basic example, but not adafruit.io which is more complex

adafruit2
Site Admin
 
Posts: 18395
Joined: Fri Mar 11, 2005 7:36 pm

Re: IO Basics: Example 07_digital_out. With Winc1500 & Ardui

by lorenzo_1025 on Sun May 19, 2019 6:39 am

Hello

I've recieved my Mega 2560 (see link above) and wired my Winc1500 to it. Ran the scan network program from the WiFi101 library and got signal from the WiFi I want to use.

I wired the Hardware as follows:

SCK: 52
MISO: 50
MOSI:51

CS:49
IRQ: 48
RST:47
EN to VCC (set as 22 but isnt wired to 22)

I thus opened the adafruitio_07_digital_out example again but wasn't able to compile it

Config.h:

Code: Select all | TOGGLE FULL SIZE
/************************ Adafruit IO Config *******************************/

// visit io.adafruit.com if you need to create an account,
// or if you need your Adafruit IO key.
#define IO_USERNAME   ""
#define IO_KEY        ""

/******************************* WIFI **************************************/


#define WIFI_SSID   ""
#define WIFI_PASS   ""

// uncomment the following line if you are using airlift
// #define USE_AIRLIFT

// uncomment the following line if you are using winc1500
#define USE_WINC1500

// comment out the following lines if you are using fona or ethernet
#include "AdafruitIO_WiFi.h"

#ifdef USE_AIRLIFT
  // Configure the pins used for the ESP32 connection
  #if !defined(SPIWIFI_SS) // if the wifi definition isnt in the board variant
    // Don't change the names of these #define's! they match the variant ones
    #define SPIWIFI SPI
    #define SPIWIFI_SS 10  // Chip select pin
    #define SPIWIFI_ACK 9  // a.k.a BUSY or READY pin
    #define ESP32_RESETN 6 // Reset pin
    #define ESP32_GPIO0 -1 // Not connected
  #endif
  AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS, 49, 48, 47, 22);
#else
  AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
#endif
/******************************* FONA **************************************/

// the AdafruitIO_FONA client will work with the following boards:
//   - Feather 32u4 FONA -> https://www.adafruit.com/product/3027

// uncomment the following two lines for 32u4 FONA,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include "AdafruitIO_FONA.h"
// AdafruitIO_FONA io(IO_USERNAME, IO_KEY);

/**************************** ETHERNET ************************************/

// the AdafruitIO_Ethernet client will work with the following boards:
//   - Ethernet FeatherWing -> https://www.adafruit.com/products/3201

// uncomment the following two lines for ethernet,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include "AdafruitIO_Ethernet.h"
// AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY);


Error Code:

Code: Select all | TOGGLE FULL SIZE
In file included from sketch\config.h:30:0,

                 from C:\Users\Laurent\Dropbox\99_Pers\FHNW\Semester 8\mfls\Pmfls_Leitwertmessung_IoT\30_Test_und_Aufbau\10_Programme\IO_API\1_LED\adafruitio_07_digital_out\adafruitio_07_digital_out.ino:19:

C:\Users\Laurent\Documents\Arduino\libraries\Adafruit_IO_Arduino\src/AdafruitIO_WiFi.h:28:11: error: 'AdafruitIO_WINC1500' does not name a type

   typedef AdafruitIO_WINC1500 AdafruitIO_WiFi;

           ^

In file included from C:\Users\Laurent\Dropbox\99_Pers\FHNW\Semester 8\mfls\Pmfls_Leitwertmessung_IoT\30_Test_und_Aufbau\10_Programme\IO_API\1_LED\adafruitio_07_digital_out\adafruitio_07_digital_out.ino:19:0:

config.h:44:3: error: 'AdafruitIO_WiFi' does not name a type

   AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);

   ^

adafruitio_07_digital_out:27:1: error: 'AdafruitIO_Feed' does not name a type

 AdafruitIO_Feed *digital = io.feed("digital");

 ^

adafruitio_07_digital_out:75:20: error: variable or field 'handleMessage' declared void

 void handleMessage(AdafruitIO_Data *data) {

                    ^

adafruitio_07_digital_out:75:20: error: 'AdafruitIO_Data' was not declared in this scope

adafruitio_07_digital_out:75:37: error: 'data' was not declared in this scope

 void handleMessage(AdafruitIO_Data *data) {

                                     ^

C:\Users\Laurent\Dropbox\99_Pers\FHNW\Semester 8\mfls\Pmfls_Leitwertmessung_IoT\30_Test_und_Aufbau\10_Programme\IO_API\1_LED\adafruitio_07_digital_out\adafruitio_07_digital_out.ino: In function 'void setup()':

adafruitio_07_digital_out:41:3: error: 'io' was not declared in this scope

   io.connect();

   ^

adafruitio_07_digital_out:47:3: error: 'digital' was not declared in this scope

   digital->onMessage(handleMessage);

   ^

adafruitio_07_digital_out:47:22: error: 'handleMessage' was not declared in this scope

   digital->onMessage(handleMessage);

                      ^

adafruitio_07_digital_out:50:23: error: 'AIO_CONNECTED' was not declared in this scope

   while(io.status() < AIO_CONNECTED) {

                       ^


https://ibb.co/Pm8FRKS

The error code looks quite similar to the one I had with my Uno. What am I doing wrong with the program...?

Thanks alot
Last edited by brubell on Mon May 20, 2019 10:01 am, edited 1 time in total.
Reason: remove io config secrets!

lorenzo_1025
 
Posts: 9
Joined: Tue Apr 23, 2019 4:01 am

Re: IO Basics: Example 07_digital_out. With Winc1500 & Ardui

by brubell on Mon May 20, 2019 10:01 am

The mega is powered by a ATmega2560. Adafruit IO Arduino does not support this chip with the WINC1500 breakout, it's only been tested with the newer ATSAMD-based boards. We don't currently sell boards with this chip, so I am unable to test this.

You may want to try Adafruit MQTT (https://github.com/adafruit/Adafruit_MQ ... nc1500.ino)'s WINC1500 sketch to try connecting to IO.

brubell
 
Posts: 402
Joined: Fri Jul 17, 2015 10:33 pm

Re: IO Basics: Example 07_digital_out. With Winc1500 & Ardui

by lorenzo_1025 on Tue May 21, 2019 5:17 am

MQTT worked with the Mega & Winc1500. Am able to connect and control the LED via your API.

I will try modify the program to find my needs.

Thanks alot for your help

lorenzo_1025
 
Posts: 9
Joined: Tue Apr 23, 2019 4:01 am

Please be positive and constructive with your questions and comments.