๐ŸŽ„โ›„โ„๏ธ๐ŸŽ It's beginning to look a lot like ADABOX-mas! The next ADABOX from Adafruit ships soon! Get yours now, or give as a gift! ๐ŸŽ„โ›„โ„๏ธ๐ŸŽ
0

ESP8266-01 and adafruit.io
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.

ESP8266-01 and adafruit.io

by arduinojl on Sat Oct 19, 2019 8:06 pm

Has anyone tried using a plain old ESP8266-01 with the "Home Automation Lamp Control" sketches by adafruit? Not having a Huzzah board, I used an ESP32 with no problem, but then I wanted to create a smaller footprint project and the ESP8266-01 would be perfect. I cannot get it to connect to my network. I am using ESP8266WiFi.h. So, I started from scratch and removed all lines except WiFi.begin functions...everything OK and connection is established. Then I started adding lines. By the time I get to adding some of the MQTT commands in void setup is when everything went down hill. I'm only using 53% memory on compiling. I have not included the sketch here only because it is identical to adafruit sample with the exception of my ssid, password and AIO KEY, lamp_pin, etc. Suggestions appreciated in advance. Not the end of the world if I must use the ESP32, just a bit larger enclosure.

arduinojl
 
Posts: 4
Joined: Thu Feb 14, 2019 12:44 am

Re: ESP8266-01 and adafruit.io

by brubell on Mon Oct 21, 2019 10:35 am

You may want to use the Adafruit MQTT library instead of the Adafruit IO Arduino library, it has a much smaller footprint

https://github.com/adafruit/Adafruit_MQ ... sp8266.ino

- brent r

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

Re: ESP8266-01 and adafruit.io

by arduinojl on Tue Oct 22, 2019 11:29 am

Brent...thanks...I think that's what was used. As exactly from the Adafruit tutorial:

#include <WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"

arduinojl
 
Posts: 4
Joined: Thu Feb 14, 2019 12:44 am

Re: ESP8266-01 and adafruit.io

by brubell on Tue Oct 22, 2019 11:33 am

arduinojl wrote:Brent...thanks...I think that's what was used. As exactly from the Adafruit tutorial:

#include <WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"


53% of memory isn't too bad, how much flash do you use when you've compiled the whole project incl,. the sketch?

- brent r.

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

Re: ESP8266-01 and adafruit.io

by arduinojl on Wed Oct 23, 2019 10:01 am

Brent...OK on compile it says "233061 bytes (53%) of program storage space. Maximum is 434160 bytes." And "Global variables use 32500 bytes (39%) of dynamic memory"
So, I do not receive warnings re too much memory used. While there is no error on compile, there is apparently some conflict in the execution of the ESP8266WiFi.h and MQTT libraries or their variables when trying to connect to WiFi. With an ESP32 there is no conflict with WiFi.h and Adafruit_MQTT.h / Adafruit_MQTT_Client.h.

arduinojl
 
Posts: 4
Joined: Thu Feb 14, 2019 12:44 am

Re: ESP8266-01 and adafruit.io

by brubell on Wed Oct 23, 2019 10:33 am

arduinojl wrote:Brent...OK on compile it says "233061 bytes (53%) of program storage space. Maximum is 434160 bytes." And "Global variables use 32500 bytes (39%) of dynamic memory"
So, I do not receive warnings re too much memory used. While there is no error on compile, there is apparently some conflict in the execution of the ESP8266WiFi.h and MQTT libraries or their variables when trying to connect to WiFi. With an ESP32 there is no conflict with WiFi.h and Adafruit_MQTT.h / Adafruit_MQTT_Client.h.



Could you please post the error you're getting?

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

Re: ESP8266-01 and adafruit.io

by arduinojl on Wed Oct 23, 2019 4:44 pm

It is not an error per se. When looking at the Serial Monitor the ESP8266 keeps trying over and over to establish a WiFi connection and seems to be re-booting after every failed attempt. Identical code as with an ESP32 EXCEPT ESP8266WiFi.h in place of WiFi.h. I'll try to get a screen grab or cut and paste from the Serial and post that.

arduinojl
 
Posts: 4
Joined: Thu Feb 14, 2019 12:44 am

Re: ESP8266-01 and adafruit.io

by brubell on Tue Oct 29, 2019 10:55 am

arduinojl wrote:It is not an error per se. When looking at the Serial Monitor the ESP8266 keeps trying over and over to establish a WiFi connection and seems to be re-booting after every failed attempt. Identical code as with an ESP32 EXCEPT ESP8266WiFi.h in place of WiFi.h. I'll try to get a screen grab or cut and paste from the Serial and post that.

Thanks, a copy/paste from the serial would be very helpful for debugging.

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

Please be positive and constructive with your questions and comments.