Using Cayenne app - need help


#1

I’m new and started testing Cayenne. I have one small project running on a ESP12. I programmed Cayenne with the browser Firefox on a Linux PC and using the Cayenne website. On this way I can control the ESP.

Actually I have a lot of questions that I could not find in the forum and docs for the moment. Hope someone can give me some support to start…

  1. I cannot access the ESP by the browser when I go directly to the IP-address,

  2. I downloaded the Cayenne APP on my smartphone, but here I cannot not see my project. What do I have to do so that I can control my ESP12 with the phone ?

  3. Is it also possible to use the same project by different users (different smartphones)?

  4. Is it possible to use a static IP-address for the ESP ?

  5. Is it possible to access my project from internet and not only from the internal LAN ?

Many thanks in advance.


#2

I’m not sure what you mean by this. Did you previously have a sketch that was running a web server? If you you’ll have to merge that code in to your Cayenne sketch.

As long as you added the device as an Arduino device and not MQTT it should show up on your mobile device. If you are using the MQTT API hang in there, support was added for the iOS app and Android should be very soon.

Yes, but you will have to share your login info with them. This is a feature that has been requested a few times.

What method are you using to connect to the internet?

Your project should already be accessible from the internet, that’s what’s great about Cayenne!


#3

To control the ESP I have to login to the Cayenne website. There I see my project and can control it.
Is it necessary to go always via the Cayenne website or can I go directly to the IP-address, in my case 192.168.1.4.

Because I use a ESP, I added the device as MQTT. So I understand I have to wait for the Android APP. Is Could not find a way to add a ESP as an arduino. ( is not in the list)

Please find my actual sketch. Maybe it’s easier to answer your last questions :

// 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_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>

// WiFi network info.
char ssid[] = "Name network";
char wifiPassword[] = "passport network";

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "";
char password[] = "";
char clientID[] = "";

unsigned long lastMillis = 0;

void setup() {
  pinMode(4,OUTPUT);
	Serial.begin(115200);
	Cayenne.begin(username, password, clientID, ssid, wifiPassword);
}

void loop() {
	Cayenne.loop();

	//Cayenne.virtualWrite(0,analogRead(A0));
  //Cayenne.virtualWrite(1,0 );
  //Cayenne.virtualWrite(2, analogRead(A0));
  //delay(500);
}

//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_IN_DEFAULT()
{
	CAYENNE_LOG("CAYENNE_IN_DEFAULT(%u) - %s, %s", request.channel, getValue.getId(), getValue.asString());
	//Process message here. If there is an error set an error message using getValue.setError(), e.g getValue.setError("Error message");

  int i= getValue.asInt();
  if ( i==1) {
  digitalWrite(4,HIGH);
  Cayenne.virtualWrite(0,HIGH);
  delay (50);
  digitalWrite (4,LOW);
  Cayenne.virtualWrite(0,LOW);
  }
if ( i==0) {
  digitalWrite(4,HIGH);
  Cayenne.virtualWrite(0,HIGH);
  delay (50);
  digitalWrite (4,LOW);
  Cayenne.virtualWrite(0,LOW);
}
  


}

#4

Unfortunately there is no local interface so you will have to control it from the dashboard (and have a working internet connection)

You can add an ESP8266 to your dashboard just like an Arduino. Just select Arduino Uno for the device. There are lots of projects posted here, here’s one where I used a DHT11 sensor Battery Powered ESP8266 Temperature/Humidity Monitor with DHT11

It is possible to set a static IP address but I’m not sure on the process of getting it to work with Cayenne. I think you would have to choose the manual connection option. Maybe @kreggly has an answer there? Honestly would probably be easier to just set it in your DHCP server, that’s what I do.


#5

Totally, just look into your connected devices on your router pagw, grab
the mac of your ESP device, and assign that IP in your device.


#6

Many thanks


#7

I tried now with arduino uno and changed the sketch with the ESP drivers.
I can control the ESP with the Cayenne website, but not with the app.
The APP (Android 5.0) shows the title of my projects, but then I receive the message ’ No active widgets or sensors’.

 #include "CayenneDefines.h"
//#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space

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

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

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

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

#8

@rsiegel is this a bug in android 5? It works ok for me on 7.


#9

I don’t think it’s anything Android OS version related. My best guess would be that there is some data state in his account that the mobile app isn’t handling well. @guyc would you be comfortable sending me your login credentials via private message so I can have a look at the data on the account and see if this reproduces with our QA team?