Is there a possibility the connection plates WEMOS D1 R2

Hello. As the topic is there a possibility the connection plates WEMOS D1 R2

Hi,
I think that is possible. This board is an Arduino UNO with ESP8266. Right?
You can use a Cayenne code for ESP8266 standalone. Try and post your results. Thank’s :wink:

Something does not work. I use this code

#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space

#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneWiFiClient.h"

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "<your_token>";
// Your network name and password.
char ssid[] = "<your_ssid>";
char password[] = "<your_pwd>";

void setup()
{
  // initialize digital pin 2 as an output.
  pinMode(2, OUTPUT);
  Serial.begin(9600);
  Cayenne.begin(token, ssid, password);
}

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

// This function will be called every time a Dashboard widget writes a value to Virtual Pin 2.
CAYENNE_IN(V2)
{
  CAYENNE_LOG("Got a value: %s", getValue.asStr());
  int i = getValue.asInt();
  
  if (i == 0)
  {
    digitalWrite(2, LOW);
  }
  else
  {
    digitalWrite(2, HIGH);
  }  
}

Everything there looks good, what are you seeing in the serial output?

Just a thought but, have you modified the above code to include your Cayenne token, SSID and password? (don’t post those private things here, but sometimes people miss them when using the example code).

Otherwise yeah, I’m interested in the Serial Monitor output.

As a newbie myself I got stuck on the same problem I think,

I initially did not remove the <> tags around token, ssid and password… that caused everything to make a full stop :slight_smile:

…I just named my WiFi “YourSSID”, using the password “YourPassword”.

Bwahahahha!
(humor…heheheh…lighten up! :slight_smile:

Hi,

I am trying to connect same WeMos D1 Mini R2 to cloud but what board I should select in Arduino IDE ? I changed port & buad rate relevantly but still see below error :

ets Jan 8 2013,rst cause:4, boot mode:(3,5)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v3de0c112
~ld
ø

Vamsi

This is the code I’m using on my WiMos D1 Mini R2 (with the private details replaced with XXX).

I (think) I selected an Arduino Uno, WiFi Shield. And then added some button widgets in the web interface tied to virtual port V0, V1 and V2.

This is the code I used from the latest Arduino IDE.

/*
Cayenne ReceiveData Example

This example sketch shows how a value can be sent from the Cayenne Dashboard to the Arduino on a Virtual Pin.

The Cayenne Library is required to run this sketch. If you have not already done so you can install it from the Arduino IDE Library Manager.

Steps:
1. Create a Generic Digital Output Actuator attached to Virtual Pin 4 in the Cayenne Dashboard.
2. Set the token variable to match the Arduino token from the Dashboard.
3. Compile and upload the sketch.
*/

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

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "XXX";

char ssid[] = "XXX";  //  your network SSID (name)
char pass[] = "XXX";       // your network password


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

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

// This function will be called every time a Dashboard widget writes a value to Virtual Pin 4.
CAYENNE_IN(V0)
{
  CAYENNE_LOG("Got a value 0: %s", getValue.asStr());
  // You can also use:
  // int i = getValue.asInt() or
  // double d = getValue.asDouble()
}
CAYENNE_IN(V1)
{
  CAYENNE_LOG("Got a value 1: %s", getValue.asStr());
  // You can also use:
  // int i = getValue.asInt() or
  // double d = getValue.asDouble()
}
CAYENNE_IN(V2)
{
  CAYENNE_LOG("Got a value 2: %s", getValue.asStr());
  // You can also use:
  // int i = getValue.asInt() or
  // double d = getValue.asDouble()
}

Not sure why the code you posted is not working for you, but I can confirm this does work for me.

The only thing I can think of is that there is invalid info somewhere, either token, SSID, or password. ESP devices have to have a delay or loop finish every x seconds for the watchdog to reset and if it does not get that delay you will see the wdt resets in the serial output. Somewhere in the code it’s getting hung up.

Hi,

I am still getting “Waiting for board to connect…”, here is my context :

  • Used same above code from trentd with my network details
  • Added few delays into code to make WDT reset is not happening
  • I see it is connecting to my MIFI hotspot (I don’t wanna use WIFI used by my laptop to verify it can connect remotely). Of course it is connected to my laptop via USB cable for powering it
  • I have Arduino Uni & WIFI shield in mydevices portal and WeMos D1 Mini R2 in Arduino IDE

Pls help, not sure what is causing it to stuck with “Waiting for board to connect…” but no more WDT errors in serial monitor.

Vamsi

Mine started working after resetting board and flashing sketch again. Thanks guys for help.

Vamsi

1 Like