Connecting Huzzah ESP8266 with Cayenne

Hi all,

Though I’ve seen several threads on the ESP8266, I’ve been having quite the trouble getting all the libraries working with the ESP8266. I’m using the Adafruit Huzzah breakout version, but I doubt this is why I’ve been unable to get up and running with it and Cayenne. I’ve tried following @kreggly’s amazing guide on the subject, but I get a lot of error messages regarding undefined things in various libraries. Can anyone point me in the direction of some code or a guide for getting the ESP8266 online with Cayenne?

Thank you so much for any help, it’s been bothering me for quite a while so I thought I might as well reach out for some assistance.

Ken

What errors are you getting? What libraries?

Did you get base Cayenne connectivity yet?

Cheers,

Craig

After some troubleshooting, I no longer get any errors when uploading to the board. However, I still haven’t achieved base Cayenne connectivity yet.

Could it be on my Cayenne setup side? I don’t specify a model of Arduino (I do still enter the correct ssid, password, and token), so could that be a problem?

Ken

Ken,

Take a look at your log in the Arduino IDE serial monitor and make sure you show Connected. If you are not getting anything, is GPIO15 still low, and GPIO0 floating? After programming, GPIO0 needs to go high again, and reset toggled. Also, is your CH_PD line high?

Some folks have really locked down routers and don’t allow outbound ports. Your device needs to get out to arduino.mydevices.com on port 8442. Most home routers allow all outbound ports, but most corporate networks lock stuff down pretty tightly.

Cheers,

Craig

In the Arduino IDE serial monitor, I get a constant stream of data (shown below), but no “Connected.” I can upload to the board without any issues by using the method Adafruit provides for toggling the bootloader and then resetting the board (a picture of the IDE console is below as well). Also, where can I find the CH_PD line?

Serial Monitor:

Console:

I don’t think my router is blocking any outbound ports as I have an Arduino Uno connected to a RPi 3 over serial, which is running a script to connect it to Cayenne, and it works perfectly.

Thanks,

Ken

The upload looks good and the board is putting out data, so your CH_PD line is high. I think the Huzzah takes care of this for you.

This looks like your ESP is throwing an exception. Let’s see your sketch now.

Cheers,

Craig

The ESP8266 package includes some modified version of libraries that are in the programfiles / Arduino / hardware folder … ( and these should be used )
I had a simulair problem with the DHT lib…

Here’s my sketch (note the token, ssid, and password are all normally entered with the correct credentials).

Thanks,

Ken

Set your serial to 9600, that’s probably the issue.

I don’t think the ESP can keep up at that speed.

Cheers,

Craig

Hmm. Tried setting the serial baud rate to 9600 with no such luck.

Hmmm, what setting are you using when setting up you board?

Looks like Huzzah wants 80 MHz, 512K(64 SPIFFS), 115200.

Also, try commenting out CAYENNE_DEBUG and see what happens.

Craig

Here are my current settings:

Under flash size, I’m not given 512K(64 SPIFFS) as an option. Perhaps because my version is new/has a larger flash storage? Also, I tried commenting out CAYENNE_DEBUG with no change in the output. I additionally experimented with both 115200 and 9600 baud rates with little difference. However, at 115200, every now and then the serial monitor pauses with this output:

Does any of that mean anything of use?

Thanks,

Ken

You can try programming as a generic ESP8266 with the above flash and speed settings.

I’ve seen the reset like this due to running on battery power, running too fast, a bug in code using the wrong I/O. The ESP modules are pretty finicky.

You can try installing the add on to decode the exception stack dump, then copy and paste the stack from your serial monitor and see what it says. I’m stumped.

Craig

No problem, Craig. I really appreciate your help. I tried various settings as the generic ESP8266 with no luck. I’ll see what I can do tomorrow.

Thanks so much,
Ken

Try adding in delay(100); below Cayenne.run();

The ESP is telling you that he can’t run the full code because of a chksum error…