Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

cannot allocate an object of abstract type 'HTTPClient'
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.

cannot allocate an object of abstract type 'HTTPClient'

by DrChandra on Sun Jan 12, 2020 12:47 pm

I'm trying to get the example sketch "adafruitio_00_publish" from the Adafruit IO Arduino to compile using the Arduino Create Editor. I have made NO changes to the code provided but keep receiving the same error (cannot allocate an object of abstract type 'HTTPClient'). My hardware is an ESP8266 Huzzah Feather. I do have other favorite libraries for additional connected hardware (DS3231, BME680, Adafruit GFX Library, Adafruit MQTT Library, Adafruit 7735, Adafruit Seesaw, Adafruit IO Arduino).

I've searched for solutions but they are all in reference to the Arduino IDE versus web based Create.

Any help would be appreciated.

DrChandra
 
Posts: 3
Joined: Wed Jan 17, 2018 8:16 pm

Re: cannot allocate an object of abstract type 'HTTPClient'

by oesterle on Sun Jan 12, 2020 6:47 pm

Hi, DrChandra!

Welcome to the Forums!

I don't see support for the Adafruit Feather HUZZAH with ESP8266 in Arduino Create. I do see that more third-party boards seem to have support now, with a paid subscription. However, Create's support for third-party boards is much smaller than the Arduino IDE.

For that reason, I stick to the Arduino IDE (skip down to the Download section) for development. It's available for macOS, Windows, and Linux. I've even run it on a Raspberry Pi, plugging my Arduino-compatible board into one of Pi's USB ports. Is it possible for you to install and use that?

Cheers,

Eric

oesterle
 
Posts: 756
Joined: Tue Sep 17, 2013 11:32 pm

Re: cannot allocate an object of abstract type 'HTTPClient'

by DrChandra on Sun Jan 19, 2020 9:06 am

Thanks, dropping back to the Arduino IDE and making sure the required libraries are installed fixed the problem. I still have no idea why it didn't work with Arduino web based Create application.

DrChandra
 
Posts: 3
Joined: Wed Jan 17, 2018 8:16 pm

Re: cannot allocate an object of abstract type 'HTTPClient'

by brubell on Wed Jan 22, 2020 11:25 am

DrChandra wrote:Thanks, dropping back to the Arduino IDE and making sure the required libraries are installed fixed the problem. I still have no idea why it didn't work with Arduino web based Create application.

HTTPClient is part of the ArduinoHTTPClient library (https://github.com/arduino-libraries/ArduinoHttpClient). You may need to install that library along with supporting libraries (Arduino JSON, Adafruit MQTT Library) for compatibility with Adafruit IO Arduino.

I believe Create works with the ESP8266 (ESP8266 Huzzah Feather is an ESP8266 board), but haven't tested it yet.

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

Re: cannot allocate an object of abstract type 'HTTPClient'

by DrChandra on Wed Jan 22, 2020 3:07 pm

Thanks for your advice, it is appreciated.

Create does support ESP8266 Huzzah Feather and has worked with my design until I attempted to compile the Adafruit publish example. ArduinoHTTPClient and Adafruit MQTT were already installed. I did have to add Arduino JSON to the libraries but it still didn't fix the error.

DrChandra
 
Posts: 3
Joined: Wed Jan 17, 2018 8:16 pm

Please be positive and constructive with your questions and comments.