Bring back the old way of controlling actuators and sensors


#1

Hi. I wish you could just bring back the old ways of bringing up the actuators and the sensors just with the use of authentication tokens instead of MQTT. For beginners like me, I found it very easy to use. I tried upgrading the from legacy to the new one but I have been struggling to bring up the actuators and sensors online. It would be better if we have those two options to choose from.


#2

what is the problem you are facing?


#3

Iam using the arduino uno with W510 ethernet shield. I was able to enter the dashboard using MQTT credentials. But I cannot put up on the dashboard neither an actuators or a sensor. After I upload the sketch on the IDE, the Add Widget button is still grayed out.


#4

can you try adding a new device using "Bring Your Own Thing"
this will give you MQTT credential. then add this in your code and upload.
next add a custom button widget and see if it works.


#5

I used BYOT. I got in the dashboard but when I addedd a custom widget, copied the sketch file but when I uploaded, I got this error from IDE:

Arduino: 1.8.5 (Windows 8.1), Board: “Arduino/Genuino Uno”

C:\Users\gygonzales\Documents\Arduino\sketch_feb20a\sketch_feb20a.ino:7:31: fatal error: CayenneMQTTClient.h: No such file or directory

#include “CayenneMQTTClient.h”

                           ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Does this mean I am missing a library?


#6

add a new device using BYOT and copy your MQTT credential into the below code. next add a custom widget with channel 1 and check your serial monitor.

//#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTEthernet.h>

// 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() {
	Serial.begin(9600);
	Cayenne.begin(username, password, clientID);
}

void loop() {
	Cayenne.loop();

	//Publish data every 10 seconds (10000 milliseconds). Change this value to publish at a different interval.
	if(millis() - lastMillis > 10000) {
		lastMillis = millis();
		//Write data to Cayenne here. This example just sends the current uptime in milliseconds.
		Cayenne.virtualWrite(0, lastMillis);
}
}

CAYENNE_IN(1)
{
int x = getValue.asInt();
Serial.println(x);
}