🎁📬❄️📦 Holiday Shipping Deadlines are approaching! International customers and domestic ground - get your orders in 12/9/2020 📦❄️📬🎁
0

Feather M0 WiFi and sample code Adafruit_15_temp_humidity
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.

Feather M0 WiFi and sample code Adafruit_15_temp_humidity

by jlewisstockett on Mon Oct 26, 2020 11:35 pm

I'm trying to convert some code that worked beautifully on esp8266 HUZZAH to Feather M0 WiFi. I've been working on it for hours, simplifying further and further. I'm now down to just trying to get the example code "Adafruitio_15_temp_humidity" to work. No luck.

I can connect to wifi and Adafruit.io. The temperature and humidity values written to the serial monitor are exactly what I expect. I can even see data points written to the feed at 5 second intervals. However, instead of a value I see a "?" inside a diamond.

Things I've tried:
1. Updating firmware on the Adafruit Feather M0 WiFi - ATSAMD21 + ATWINC1500.
2. Adding Certificates.
3. Adding the line " WiFi.setPins(8,7,4,2);" to setup
4. Putting the DHT22 sensor on different pins
5. Writing hardcoded numbers instead of the output from the sensors.
humidity->save(42); instead of humidity->save(event.relative_humidity);
6. Deleting all dashboards and feeds on the Adafruit IO website and just creating the feeds again.
7. Harsh language.
8. Most permutations of the above.

Browser is Safari. Arduino 1.8.13

I'm clearly getting connected to wifi and Adafruit IO. Timestamps line up. Just no meaningful data.

It's been a few years since I played with Adafruit IO, so I'm probably missing something silly. Any idea what?

The code is the example code verbatim. Wiring is just the yellow wire from the DHT22 wired to pin 12, red wire to positive rail, black wire to negative rail.

Thanks in advance if you can help.

Kind regards,
Lewis

jlewisstockett
 
Posts: 10
Joined: Wed Feb 01, 2017 10:57 pm

Re: Feather M0 WiFi and sample code Adafruit_15_temp_humidit

by brubell on Wed Oct 28, 2020 11:52 am

he temperature and humidity values written to the serial monitor are exactly what I expect. I can even see data points written to the feed at 5 second intervals. However, instead of a value I see a "?" inside a diamond.


On the Serial Monitor, is your baud rate set to 115200?

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

Re: Feather M0 WiFi and sample code Adafruit_15_temp_humidit

by jlewisstockett on Wed Oct 28, 2020 12:43 pm

Thank you so much for your response and attention! I really appreciate you, the rest of the Adafruit team and the community.

Serial monitor is set to 9600, but it's getting the correct temp and humidity values.

Since I posted I tried swapping out the Feather M0 ATWINC board for my old friend the Feather ESP8266 Huzzah to see if it would work then. Things got worse. I wasn't able to get anything to compile for the Huzzah, and then for the M0. I think I've somehow gotten my Arduino environment messed up. I've wiped it and will reinstall and see what happens.

If you think of anything else that might help please feel free to share. I'll be sure to post updates on this little epic.

Kind regards,
Lewis

jlewisstockett
 
Posts: 10
Joined: Wed Feb 01, 2017 10:57 pm

Re: Feather M0 WiFi and sample code Adafruit_15_temp_humidit

by jlewisstockett on Thu Oct 29, 2020 7:30 pm

Great news. Wiping Aduino from my Mac (after backing up my precious sketches) seems to have fixed my M0 problems. For those at my skill level, you have can't just remove the app. You also have to clean up /Users/(username)/Library/Arduino15 on MAC. For good measure I also tarred up my sketch folder and only put back things I knew were mine after testing.

The ESP8266 Huzzah Feather is behaving better too. Examples compile now. Blink runs. It flatly refuses to connect to Adafruit IO though. It gets stuck in the "while io.status() < AIO_CONNECTED)..." loop and prints dots to the serial monitor forever.

I'm still using the sample code with no changes except my wifi info and of course my IO_USERNAME and IO_KEY, which I've carefully copied and pasted from a sketch that works great on my M0.

Any ideas on why my Feather Huzzah won't connect? Any tricks to debug?

I've read about certificate problems in older threads. I updated the certificates in my M0 board when I got it. Does the Huzzah Feather have certificates too? I haven't yet found info on how to update them. I know these are noob questions.

Thanks in advance if you have ideas. If I figure it out I'll be sure to share.

jlewisstockett
 
Posts: 10
Joined: Wed Feb 01, 2017 10:57 pm

Re: Feather M0 WiFi and sample code Adafruit_15_temp_humidit

by jlewisstockett on Thu Oct 29, 2020 8:40 pm

I see from reading the posts of others that including library versions is sometimes helpful. Here are mine for the post above:

Arduino version 1.8.13

Adafruit IO Arduino 3.9.1
Adafruit Unified Sensor 1.1.4
DHT sensor library 1.4.0

Should I try different library versions?

jlewisstockett
 
Posts: 10
Joined: Wed Feb 01, 2017 10:57 pm

Re: Feather M0 WiFi and sample code Adafruit_15_temp_humidit

by jlewisstockett on Thu Oct 29, 2020 10:46 pm

I have now tried many different combinations of library versions. The most recent:

Adafruit IO Arduino 3.2.2
Adafruit Unified Sensor 1.1.4
DHT sensor library 1.4.0
Adafruit MQTT Library 1.0.3

Exactly the same results. Any suggestions?

jlewisstockett
 
Posts: 10
Joined: Wed Feb 01, 2017 10:57 pm

Re: Feather M0 WiFi and sample code Adafruit_15_temp_humidit

by brubell on Fri Oct 30, 2020 9:54 am

The ESP8266 Huzzah Feather is behaving better too. Examples compile now. Blink runs. It flatly refuses to connect to Adafruit IO though. It gets stuck in the "while io.status() < AIO_CONNECTED)..." loop and prints dots to the serial monitor forever.

I'm still using the sample code with no changes except my wifi info and of course my IO_USERNAME and IO_KEY, which I've carefully copied and pasted from a sketch that works great on my M0.

Any ideas on why my Feather Huzzah won't connect? Any tricks to debug?


Thank you for including the library versions, there's a few things to check.

1) Do you ever see the board connect on: http://io.adafruit.com/monitor
2) Are you able to connect to IO using this sketch from the Adafruit MQTT library? https://github.com/adafruit/Adafruit_MQ ... llback.ino

Thanks, these problems are often difficult to debug and take some time. But we'll get you up and running :)

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

Re: Feather M0 WiFi and sample code Adafruit_15_temp_humidit

by jlewisstockett on Sun Nov 01, 2020 3:17 pm

No, I do not ever see the board connect on http://io.adafruit.com/monitor.

The sample you sent does not compile for me with my current combination of library versions. I get:

Arduino: 1.8.13 (Mac OS X), Board: "Adafruit Feather HUZZAH ESP8266, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, All Flash Contents, 230400"

debug_from_adafruit:55:5: error: 'int min' redeclared as different kind of symbol
int min;
^
In file included from /Users/lstockett/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/xtensa-lx106-elf/include/c++/4.8.2/algorithm:61:0,
from /Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Arduino.h:238,
from sketch/debug_from_adafruit.ino.cpp:1:
/Users/lstockett/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/xtensa-lx106-elf/include/c++/4.8.2/bits/stl_algobase.h:193:5: error: previous declaration of 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
min(const _Tp& __a, const _Tp& __b)
^
/Users/lstockett/Documents/Arduino/debug_from_adafruit/debug_from_adafruit.ino: In function 'void timecallback(uint32_t)':
debug_from_adafruit:68:7: error: overloaded function with no contextual type information
min = current % 60;
^
debug_from_adafruit:82:6: error: parse error in template argument list
if(min < 10) Serial.print("0");
^
debug_from_adafruit:82:14: error: cannot resolve overloaded function 'min' based on conversion to type 'bool'
if(min < 10) Serial.print("0");
^
debug_from_adafruit:83:19: error: no matching function for call to 'HardwareSerial::print(<unresolved overloaded function type>)'
Serial.print(min);
^
/Users/lstockett/Documents/Arduino/debug_from_adafruit/debug_from_adafruit.ino:83:19: note: candidates are:
In file included from /Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Stream.h:26:0,
from /Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/HardwareSerial.h:32,
from /Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Arduino.h:245,
from sketch/debug_from_adafruit.ino.cpp:1:
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:80:16: note: size_t Print::print(const __FlashStringHelper*)
size_t print(const __FlashStringHelper *);
^
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:80:16: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const __FlashStringHelper*'
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:81:16: note: size_t Print::print(const String&)
size_t print(const String &);
^
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:81:16: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const String&'
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:82:16: note: size_t Print::print(const char*)
size_t print(const char[]);
^
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:82:16: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const char*'
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:83:16: note: size_t Print::print(char)
size_t print(char);
^
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:83:16: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'char'
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:84:16: note: size_t Print::print(unsigned char, int)
size_t print(unsigned char, int = DEC);
^
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:84:16: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned char'
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:85:16: note: size_t Print::print(int, int)
size_t print(int, int = DEC);
^
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:85:16: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int'
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:86:16: note: size_t Print::print(unsigned int, int)
size_t print(unsigned int, int = DEC);
^
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:86:16: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int'
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:87:16: note: size_t Print::print(long int, int)
size_t print(long, int = DEC);
^
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:87:16: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int'
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:88:16: note: size_t Print::print(long unsigned int, int)
size_t print(unsigned long, int = DEC);
^
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:88:16: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int'
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:89:16: note: size_t Print::print(double, int)
size_t print(double, int = 2);
^
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:89:16: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double'
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:90:16: note: size_t Print::print(const Printable&)
size_t print(const Printable&);
^
/Users/lstockett/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/Print.h:90:16: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const Printable&'
exit status 1
'int min' redeclared as different kind of symbol


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

My next plan is to play around with different versions of the libraries and see if I can find a combination that works. Here's what just threw the compile errors:

Adafruit IO Arduino 4.0.0
Adafruit Unified Sensor 1.1.4
DHT sensor library 1.4.0
Adafruit MQTT Library 2.0.0

Is there a "known good" combination of libraries I could try? I'm looking for ways to rule out possible causes.

Kind regards and thanks,
Lewis

jlewisstockett
 
Posts: 10
Joined: Wed Feb 01, 2017 10:57 pm

Re: Feather M0 WiFi and sample code Adafruit_15_temp_humidit

by brubell on Wed Nov 04, 2020 12:06 pm

I provided the wrong example, my mistake. I meant: https://github.com/adafruit/Adafruit_MQ ... re_esp8266. This compiles for me and connects for Adafruit IO

It looks like I'm using the esp8266 board support package v2.7.2 and Adafruit_MQTT_Library 1.3.0

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

Re: Feather M0 WiFi and sample code Adafruit_15_temp_humidit

by jlewisstockett on Wed Nov 04, 2020 1:01 pm

Thanks very much! I can't wait to finish work and try it out. I really appreciate your help. You're gone beyond tech support here. You've given cool stuff to work on and learn about to keep my mind of unpleasant stuff that's going on right now. Adafruit and the community are awesome!

Thanks,
Lewis

jlewisstockett
 
Posts: 10
Joined: Wed Feb 01, 2017 10:57 pm

Re: Feather M0 WiFi and sample code Adafruit_15_temp_humidit

by brubell on Fri Nov 06, 2020 10:32 am

jlewisstockett wrote:Thanks very much! I can't wait to finish work and try it out. I really appreciate your help. You're gone beyond tech support here. You've given cool stuff to work on and learn about to keep my mind of unpleasant stuff that's going on right now. Adafruit and the community are awesome!

Thanks,
Lewis

No problem, Lewis. Let me know if it's working or not. I can test on my hardware...

There IS something I didn't ask: You added the Adafruit IO SSL certificate to the Feather M0 WiFi, correct? https://learn.adafruit.com/adafruit-fea ... rtificates

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

Please be positive and constructive with your questions and comments.