Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

IO Basics - Digital Out Example - Compile Error
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

IO Basics - Digital Out Example - Compile Error

by bruce56 on Fri Mar 13, 2020 6:45 pm

Ref:
https://learn.adafruit.com/adafruit-io- ... tal-output
https://github.com/adafruit/Adafruit_IO ... igital_out

The adafruitio_07_digital_out sketch set up in the default (WiFi) mode compiles successfully with the
specified --> Tools --> Board: Adafruit FeatherHUZZAHESP8266. However, for the FONA option with the specified
Board: "Adafruit Feather 32U4", and unommenting/commenting the WiFi and FONA lines (per instructions in config.h.),
it won't compile. The following is the compile message. Any help would be appreciated.

Code: Select all | TOGGLE FULL SIZE
Arduino: 1.8.12 (Linux), Board: "Adafruit Feather 32u4"

In file included from /home/bruce/Sketchbook/adafruitio_07_digital_out/adafruitio_07_digital_out.ino:19:0:
config.h:59:18: error: cannot declare variable 'io' to be of abstract type 'AdafruitIO_FONA'
  AdafruitIO_FONA io(IO_USERNAME, IO_KEY);
                  ^~
In file included from sketch/config.h:58:0,
                 from /home/bruce/Sketchbook/adafruitio_07_digital_out/adafruitio_07_digital_out.ino:19:
/home/bruce/Sketchbook/libraries/Adafruit_IO_Arduino-master/src/AdafruitIO_FONA.h:33:7: note:   because the following virtual functions are pure within 'AdafruitIO_FONA':
 class AdafruitIO_FONA : public AdafruitIO {
       ^~~~~~~~~~~~~~~
In file included from /home/bruce/Sketchbook/libraries/Adafruit_IO_Arduino-master/src/AdafruitIO_FONA.h:15:0,
                 from sketch/config.h:58,
                 from /home/bruce/Sketchbook/adafruitio_07_digital_out/adafruitio_07_digital_out.ino:19:
/home/bruce/Sketchbook/libraries/Adafruit_IO_Arduino-master/src/AdafruitIO.h:136:16: note:    virtual void AdafruitIO::_disconnect()
   virtual void _disconnect() = 0;
                ^~~~~~~~~~~
exit status 1
cannot declare variable 'io' to be of abstract type 'AdafruitIO_FONA'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

bruce56
 
Posts: 4
Joined: Fri Mar 06, 2020 10:23 am

Re: IO Basics - Digital Out Example - Compile Error

by brubell on Tue Mar 17, 2020 11:01 am

Hi bruce56,

unommenting/commenting the WiFi and FONA lines (per instructions in config.h.),
it won't compile. The following is the compile message. Any help would be appreciated.


Could you please provide a snippet of your config.h file between [code][/code] tags?

Which FONA module/breakout are you using with Feather 32U4?

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

Re: IO Basics - Digital Out Example - Compile Error

by bruce56 on Tue Mar 17, 2020 3:41 pm

The github link in my original message has the config.h file that compiles for the WiFi option with: Tools --> Board: "Adafruit FeatherHUZZAHESP8266". The following is that same config.h file with commented/uncommented code (per the instructions in that config.h file) for the FONA option with: --> Board: "Adafruit Feather 32U4", and this won't compile.
Note: I couldn't fine any third party URL for the Adafruit Feather 32U4 FONA, only the Adafruit Feather 32U4. Might this be the problem?
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 "your_username"
#define IO_KEY "your_key"

/******************************* 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
//   - Adafruit AirLift Shield -> https://www.adafruit.com/product/4285
//   - Adafruit AirLift FeatherWing -> https://www.adafruit.com/product/4264

#define WIFI_SSID "your_ssid"
#define WIFI_PASS "your_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"

//#if defined(USE_AIRLIFT) || defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE) ||         \
//    defined(ADAFRUIT_PYPORTAL)
// 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 NINA_ACK 9    // a.k.a BUSY or READY pin
//#define NINA_RESETN 6 // Reset pin
//#define NINA_GPIO0 -1 // Not connected
//#endif
//AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS, SPIWIFI_SS,
//                   NINA_ACK, NINA_RESETN, NINA_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);


"Which FONA module/breakout are you using with Feather 32U4?"

My intention is to use this with an Adafruit Feather 32u4 FONA which includes the SIM800 module, but want to make sure it will compile before purchasing it. My ultimate goal is to first get this to work with the 32U4 FONA board and then use a FONA 800 or FONA 808 Shield with a Mega board.

bruce56
 
Posts: 4
Joined: Fri Mar 06, 2020 10:23 am

Re: IO Basics - Digital Out Example - Compile Error

by brubell on Thu Mar 19, 2020 9:57 am

The Feather FONA 32u4 is under Adafruit AVR Boards: https://learn.adafruit.com/adafruit-fea ... rduino-ide

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

Re: IO Basics - Digital Out Example - Compile Error

by bruce56 on Mon Mar 23, 2020 1:25 am

The instructions in the link say to install support for Adafruit AVR Boards but I previously did that. The list of installed boards includes the Adafruit Feather 32U4, but not the Adafruit Feather 32U4 FONA, and I don't see any reference to adding that third party board in the link information. Assuming that this is the problem, then it doesn't seem that there is information there to solve it. Also, it states "When you plug in the Feather, you'll need to possibly install a driver. Click below to download our Driver Installer." It wouldn't seem that this is the problem since I am not yet at the point of plugging in the board, and only trying to deal with the compile errors.
Might it be possible for you to follow the procedure that I stated in my original message and see if you get the same results as I did?

bruce56
 
Posts: 4
Joined: Fri Mar 06, 2020 10:23 am

Re: IO Basics - Digital Out Example - Compile Error

by brubell on Wed Mar 25, 2020 12:54 pm

Code: Select all | TOGGLE FULL SIZE









In file included from /Users/brent/Documents/Arduino/adafruitio_00_publish/adafruitio_00_publish.ino:18:0:
config.h:17: error: cannot declare variable 'io' to be of abstract type 'AdafruitIO_FONA'
 AdafruitIO_FONA io(IO_USERNAME, IO_KEY);
                 ^
In file included from sketch/config.h:16:0,
                 from /Users/brent/Documents/Arduino/adafruitio_00_publish/adafruitio_00_publish.ino:18:
/Users/brent/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_FONA.h:33:7: note:   because the following virtual functions are pure within 'AdafruitIO_FONA':
 class AdafruitIO_FONA : public AdafruitIO {
       ^
In file included from /Users/brent/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_FONA.h:15:0,
                 from sketch/config.h:16,
                 from /Users/brent/Documents/Arduino/adafruitio_00_publish/adafruitio_00_publish.ino:18:
/Users/brent/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO.h:136:16: note:    virtual void AdafruitIO::_disconnect()
   virtual void _disconnect() = 0;
                ^
exit status 1
cannot declare variable 'io' to be of abstract type 'AdafruitIO_FONA'


ok, I was able to replicate the same issue as you. It may be related to the ethernet issue with this library I saw pop up here earlier last week.

Could you please file an issue directly on the library's repository so someone can take a look at it: https://github.com/adafruit/Adafruit_IO_Arduino/issues

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

Re: IO Basics - Digital Out Example - Compile Error

by bruce56 on Thu Mar 26, 2020 2:13 am

I posted the issue and linked it to this present forum topic. (For some reason the forum topic link defaults to: https://github.com/adafruit/Adafruit_IO ... issues/url - so I posted the link again in a comment and made it work.)

bruce56
 
Posts: 4
Joined: Fri Mar 06, 2020 10:23 am

Please be positive and constructive with your questions and comments.