Can not connect the remote device


#1

I am a newbie with Cayenne but not in IT. But it seems that I am to stupid to get a simple project running.

I am using an Arduino Meg 2560 which is connected via USB. The first Connection (with CAYENNE_OUT_DEFAULT()) was working and I saw a value.

But now I want to reproduce the Luminosity example. The connection is OK because I can see the Arduino colored under my devices. I add the slider to the desktop but I can not Change something. I tried it via the smartphone app and there I will get the Feedback “Can not connect the remote device.”

I tried different ways. Firts with custom widget. Next with Actuators -> lights -> Luminosity. Third via Actuators -> Generic -> PWM Output. Nothing works. So I can not write the LED value back to the device.

What I am doing wrong? What is the trick?


#2

Do you have any other way to connect to the internet with your device? The USB serial method can have lots of issues going thru your pc/mac.

Can you provide your sketch?


#3

ESP8266 is still on the road. Ethernet shield not an option because I do not have network cable in the house.

The sketch is the example from the cayenne website. Extrem simple - i thought.

/*

Cayenne Luminosity Example
*/

#include <CayenneMQTTSerial.h>

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = “myUser”;
char password[] = “myPassword”;
char clientID[] = “device-IDe”;

#define VIRTUAL_CHANNEL 1
#define ACTUATOR_PIN 3

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

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

// This function is called when data is sent from Cayenne.
CAYENNE_IN(VIRTUAL_CHANNEL)
{
int value = getValue.asInt(); // 0 to 255
CAYENNE_LOG(“Channel %d, pin %d, value %d”, VIRTUAL_CHANNEL, ACTUATOR_PIN, value);
// Write the value received to the PWM pin. analogWrite accepts a value from 0 to 255.
analogWrite(ACTUATOR_PIN, value);
}