Connecting SparkFun Thing ESP8266 with Cayenne HELP


I’m trying to connect a SparkFun Thing ESP8266 to Cayenne. When I try to upload the attached code on the Arduino application on my Mac, I always get the error code: error: espcomm_upload_mem failed

I’ve tried changing ports and changing upload speeds, but nothing helped. I got the code from GitHub, through a link from instructions (on uploading a Sparkfun ESP8266 micro controller) on Cayenne’s own website. The stuff in “quotation marks” was substituted with the relevant details. Please someone help :confused :confused:

// This example shows how to connect to Cayenne using an ESP8266 and send/receive sample data.
// Make sure you install the ESP8266 Board Package via the Arduino IDE Board Manager and select the correct ESP8266 board before compiling.

#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>

// WiFi network info.
char ssid[] = “ssid”;
char wifiPassword[] = “wifiPassword”;

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = “MQTT_USERNAME”;
char password[] = “MQTT_PASSWORD”;
char clientID[] = “CLIENT_ID”;

unsigned long lastMillis = 0;

void setup() {
Cayenne.begin(username, password, clientID, ssid, wifiPassword);

void loop() {

// Default function for sending sensor data at intervals to Cayenne.
// You can also use functions for specific channels, e.g CAYENNE_OUT(1) for sending channel 1 data.
// Write data to Cayenne here. This example just sends the current uptime in milliseconds on virtual channel 0.
Cayenne.virtualWrite(0, millis());

// Default function for processing actuator commands from the Cayenne Dashboard.
// You can also use functions for specific channels, e.g CAYENNE_IN(1) for channel 1 commands.
CAYENNE_LOG(“Channel %u, value %s”,, getValue.asString());
//Process message here. If there is an error set an error message using getValue.setError(), e.g getValue.setError(“Error message”);


Sorry, I don’t have any definite idea of what the problem is.

espcomm_upload_mem failed is a very generic message, and a quick search shows it means several things; the most common seem to be old version of Arduino, old version of ESP8266 support libraries, or upload speed set too high for the serial cabling capacitance.

The Thing doesn’t have onboard USB to serial converter, which is why the hookup guide shows how to use the FTDI Basic module.

You’re using that method? I’ve often used jumper leads instead with the Thing.

Please check that you can upload a simple Blink sketch from the Arduino on your Mac to the Thing? That will help to exclude your Cayenne sketch from the problem and validate your setup.