Esp8266

…I just KNOW somebody understood that.
I’m sure of it.
Perhaps, not me, …but someone…

How to connect WEMOS D1 Cayenne?

@tomixps

If you are ok with writing new firmware into your Wemos, the howto should work fine. Esp8266 - #20 by kreggly

You also may want to look at this Instructable for reference. Programming the ESP8266 WeMos-D1R2 Using Arduino Software/IDE : 15 Steps - Instructables

Working on using ESP8266 as shield, just haven’t got around to it yet.

Cheers,

Craig

Same to me with nodeMCU. Only get the sample code with onBoard LED running. When i add an sensor like DS18B20 i only get WDT resets.

#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneWiFiClient.h"
#include <OneWire.h>
#include <DallasTemperature.h>
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space

// Virtual Pin of the DS18B20 widget.
#define VIRTUAL_PIN V1

// Digital pin the DS18B20 is connected to. Do not use digital pins 0 or 1 since those conflict with the use of Serial.
const int tmpPin = 2;

OneWire oneWire(tmpPin);
DallasTemperature sensors(&oneWire);

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "oqkmrxxxx";
// Your network name and password.
char ssid[] = "xxxx";
char password[] = "xxx";

void setup()
{
  Serial.begin(115200);
  Cayenne.begin(token, ssid, password);
  sensors.begin();
}

void loop()
{
  Cayenne.run();
}

// This function is called when the Cayenne widget requests data for the Virtual Pin.
CAYENNE_OUT(VIRTUAL_PIN)
{
  // Send the command to get temperatures.
  sensors.requestTemperatures();
  // This command writes the temperature in Celsius to the Virtual Pin.
  Cayenne.celsiusWrite(VIRTUAL_PIN, sensors.getTempCByIndex(0));
  // To send the temperature in Fahrenheit use the corresponding code below.
  //Cayenne.fahrenheitWrite(VIRTUAL_PIN, sensors.getTempFByIndex(0));
}

Have you run the sensor code without Cayenne on your ESP?

Next, you can download an Arduino IDE extension to decipher the exception
stack. It’s not a watchdog issue. Even then, the results ate cryptic, but
it is a start.

For starters, I would drop the speed of your debug. Next disable it
completely.

Next, disable your calls in the loop and if it runs, bring the calls back
one by one.

Cheers,

Craig

1 Like

I tried the Dallas Temperature Simple sample sketch right now, without luck.

I’m not a coding pro, so cayenne in interessing for me. But i had the hope the simple sketches cayenne create will work out of the box, like the most arduino sketches do with ESP.

What do you mean with "disable your calls in the loop and if it runs, bring the calls back one by one.!"

If you put a // in front of sensors.requestTemperatures(); for instance, it will be disabled.

What you are trying to do is see if the program will run with these disabled, thus isolating the issue to stuff happening in the loop() function and not setup().

The ESP works fine with Cayenne. However, it is not officially supported, so any example sketch you find for another Arduino device may not work. The ESP is a workhorse, but it is not actually an Arduino, so some tweaks are needed.

Also double check you are using the right pin. NodeMCU maps things differently.

See that if you are using GPIO2, your device needs to be connected to D4. Personally, I would set tmpPin = 4 and stay connected to D2 as GPIO2 has other functions on the ESP that might be getting you into trouble.

Cheers,

Craig

thanks Kreggly
The code works fine for my ESP8266.
Thanks for sharing it

Cool. Did you just change the bit for the Onewire bus?

Cheers,

Craig

How to connect my ESP8266 12-E to cayenne MQTT API dashboard. Even though I included cayenne MQTT libraries , there is no separate connection example in the IDE for other than Arduino devices like ESP8266.
By this I am unable to connect to cayenne dashboard? Please help me out

ESP is not currently supported. I am currently modifying the source code to
make it work, but having an issue with some overload casting in the
publishing bits.

This is the real reason ESPs are not supported as they aren’t Arduinos. It
is brilliant that some smart cookie made them work at all with the IDE.

Cheers,

Craif

1 Like

I’m working on a write up on how to get an ESP talking to Cayenne with MQTT. Should have it ready tomorrow or Monday.

3 Likes

Okay- I pointed my Arduino library loader to my Download/CayenneMQTT.zip file.
I can see the CayenneMQTT library files in Arduino IDE.

Hi,
I don’t have any shield in particular to connect my arduino to the cloud. what i have is a ESP8266-01 module so could anyone help me how to connect my ESP8266-01 module to cayenne please and if possible please do send me the code

Thanks
Vivek

Hi @vivekgs27,

Check out this HowTo, and let us know how you make out.

Cheers,

Craig

Hi @kreggly,
I’m sorry that i dont have ESP8266-07 module. The one which i have is ESP8266-01 module
If anyone could help me with the code with cayenne please

The howto and code works for all ESPs. You just need to set GPIO zero to gnd and toggle RST/PD to get into programming mode on the ESP-01.

The 07 and 12 boards just have more flash space and I/O.

Cheers,

Craig

I am using ESP8266-01 with Arduino Uno. I want to send data to cayenne dashboard from my sensor connected to arduino board. Is it possible to use cayenne for this type of connection and if it is possible can anyone upload some example code?

Take a look at this post WifiShield with arduino uno compiling error - #11 by kreggly

hi
Is it possible to work with the ethernet 5100 and esp8266 ?
Want to develop the algorithm having the possibilty to transmitt data when ehernet cable available otherwise Wifi…