0

latest Adafruit IO Arduino library - examples don't compile
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

latest Adafruit IO Arduino library - examples don't compile

by caycay on Mon Apr 30, 2018 5:42 am

Hi,

I have an Adafruit Feather M0 with Winc1500 and I'm trying to make a get request to Adafruit IO to be able to get the latest stored value.

Since the Adafruit IO Arduino library has recently gotten a get() function with version 2.7.3 , I would love to use it. However, the sketches don't compile for me. I keep running into:

Code: Select all | TOGGLE FULL SIZE
/Users/carinasauter/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_Feed.cpp: In member function 'bool AdafruitIO_Feed::get()':
/Users/carinasauter/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_Feed.cpp:128:30: error: call of overloaded 'publish(unsigned int)' is ambiguous
return _get_pub->publish('\0');


I have the latest firmware & certificate.

Can anyone help, please?

caycay
 
Posts: 2
Joined: Sun Feb 11, 2018 8:48 pm

Re: latest Adafruit IO Arduino library - examples don't comp

by jwalter on Thu May 10, 2018 12:12 pm

I am having a similar problem. I can't compile the adafruitio_15_temp_humidity example sketch for a Adafruit Feather M0 WiFi - ATSAMD21 + ATWINC1500 board using the 2.73 version of the Adafruit IO library. Using earlier versions of the library, the sketch will compile but won't connect to Adafruit IO. The sketch will compile for boards (e.g. a Feather Huzzah ESP8266) using version 2.73 of the library and have no problem making a stable connection to Adafruit IO. The error messages generated when I try to compile the sketch for the Feather MO board are pasted below.

As you will see, some of the errors are similar to the one you reported. I tried doing a clean install of the Arduino IDE and reinstalled all the libraries but it didn't help. Any advice or help would be greatly appreciated. Thanks!


Arduino: 1.8.5 (Mac OS X), Board: "Adafruit Feather M0"

/Users/jwalter/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_Feed.cpp: In member function 'bool AdafruitIO_Feed::get()':
/Users/jwalter/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_Feed.cpp:128:32: error: call of overloaded 'publish(char)' is ambiguous
return _get_pub->publish('\0');
^
/Users/jwalter/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_Feed.cpp:128:32: note: candidates are:
In file included from /Users/jwalter/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_Feed.h:16:0,
from /Users/jwalter/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_Feed.cpp:12:
/Users/jwalter/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:259:8: note: bool Adafruit_MQTT_Publish::publish(const char*)
bool publish(const char *s);
^
/Users/jwalter/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:260:8: note: bool Adafruit_MQTT_Publish::publish(double, uint8_t)
bool publish(double f, uint8_t precision=2); // Precision controls the minimum number of digits after decimal.
^
/Users/jwalter/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:262:8: note: bool Adafruit_MQTT_Publish::publish(int32_t)
bool publish(int32_t i);
^
/Users/jwalter/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:263:8: note: bool Adafruit_MQTT_Publish::publish(uint32_t)
bool publish(uint32_t i);
^
exit status 1
Error compiling for board Adafruit Feather M0.

jwalter
 
Posts: 25
Joined: Sat May 07, 2011 5:46 pm
Location: Santa Cruz, California

Re: latest Adafruit IO Arduino library - examples don't comp

by abachman on Fri May 11, 2018 9:03 am

The sketch will compile for boards (e.g. a Feather Huzzah ESP8266) using version 2.73 of the library and have no problem making a stable connection to Adafruit IO. The error messages generated when I try to compile the sketch for the Feather MO board are pasted below.


Hi all, we can confirm the same on our end.

I've pushed an updated version of the library that uses `publish("\0")` in place of `publish('\0')`, which compiles successfully for the WICED, M0, ESP8266 Huzzah, and MKR1000.

If you update libraries in the Arduino app, you should see Adafruit IO Arduino version 2.7.4, or you can download that release here: https://github.com/adafruit/Adafruit_IO_Arduino/releases/tag/2.7.4.


- adam b.

abachman
 
Posts: 242
Joined: Mon Feb 01, 2010 12:48 pm

Re: latest Adafruit IO Arduino library - examples don't comp

by jwalter on Fri May 11, 2018 9:41 am

Thanks for modifying the library! The sketches now compile, but unfortunately they do not post data to Adafruit IO. For example, when the example sketch adafruitio_15_temp_humidity compiles and can be uploaded to my Feather MO, but does not proceed beyond "Connecting to Adafruit IOAdafruitIO::connect()" in setup. There is no problem with the sketch since I successfully used it in the past before this problem arose (I currently have four different feathers with this sketch posting data to Adafruit IO). So, there appears to be a problem specific to these libraries and the Feather M0 WiFi - ATSAMD21 + ATWINC1500 board. Can you confirm that you've been able to post data using this sketch and the latest versions of the library? Any help would be greatly appreciated! Thanks.

jwalter
 
Posts: 25
Joined: Sat May 07, 2011 5:46 pm
Location: Santa Cruz, California

Re: latest Adafruit IO Arduino library - examples don't comp

by abachman on Fri May 11, 2018 9:45 am

Yeah, I'll take a look. Thanks for the heads up.


- adam

abachman
 
Posts: 242
Joined: Mon Feb 01, 2010 12:48 pm

Re: latest Adafruit IO Arduino library - examples don't comp

by abachman on Fri May 11, 2018 2:53 pm

jwalter, because I just spent an hour wrestling with the same issue (code builds now, tries to connect, never connects), are you able to confirm that you have the current io.adafruit.com SSL certificate on the device? That ended up being my problem. We updated our SSL certificate about 3.5 months ago, and the ATWINC1500 update process is a lot more involved than most others. I have a few devices I use for testing so this one must not have been updated. Long shot, but the resulting condition (everything builds fine, just _never_ connects) is what you describe.

ssl-certs-arduino.png
ssl-certs-arduino.png (18.35 KiB) Viewed 381 times


I followed the instructions at https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500/updating-ssl-certificates with the pictured certificate settings and am able to get past the io.connect(); while(io.status() < AIO_CONNECTED) { Serial.print("."); } step in setup() and publish / subscribe again.


- adam

abachman
 
Posts: 242
Joined: Mon Feb 01, 2010 12:48 pm

Re: latest Adafruit IO Arduino library - examples don't comp

by jwalter on Sat May 12, 2018 3:20 am

Thanks for pointing that out. I had forgotten to update the certificate. With the updated certificate and the updated library, everything is working fine now. Thanks again for all the help!

jwalter
 
Posts: 25
Joined: Sat May 07, 2011 5:46 pm
Location: Santa Cruz, California

Re: latest Adafruit IO Arduino library - examples don't comp

by haikusw on Sun Sep 09, 2018 10:03 pm

This updating of certificates (io.adafruit.com:443) on my Adafruit Feather M0 WiFi - ATSAMD21 + ATWINC1500 even though my board is only two weeks old fixed a failure to connect for me also (though I also updated all relevant libraries as well, again even though those were only two weeks old).

So even "new" boards may have old certs on them, potentially.

haikusw
 
Posts: 4
Joined: Sun Sep 09, 2018 8:48 pm

Please be positive and constructive with your questions and comments.