Buttons after update

well if you found out the issue is with mangoose only then let’s find out why it is causing it.
i am not sure what your code is, but when you receive the data from the slider are you sending back the received data back to cayenne. have a look at this Cayenne Docs

Everything works in both the web and ios. Thank you very much!

Hmmm … interesting! That sounds like the feedback mechanism.

I’ll give that a try. Thanks.

Hi Everyone,
I have a home monitoring system running, Arduino-based. Read indoor/outdoor temps with DS18B20s, control a 4-relay optoisolated board.

Usually responsive, but sometimes when I activate a button for a relay I see the ‘waiting’ symbol spinning. Other buttons work but also hang in “waiting”… I need to reload the browser page to get control back.

Is this still a known problem? Any suggestions?

I will be travelling and remotely controlling two 5000W heaters so I really want this reliable!!

Other: The relay board has Active LOW signals. I had to write code to make sure of things:

  • Write the output pins HIGH
  • THEN set them as outputs (Otherwise relays clicked on/off at Arduino reset!)
  • Check the control data to get button logic correct, like
    ---------------------( COPY )---------------------
    CAYENNE_IN(V6)
    {
    if ( getValue.asInt() == 0)
    digitalWrite(HEATER5000_1_PIN, HIGH);
    else
    digitalWrite(HEATER5000_1_PIN, LOW);
    } // END V6
    -----------------( END COPY )----------------------

Has anyone else had these issues with relay boards?? IsThere a good place to document how to handle this?

Thanks!
Regards, Terry King
…In The Woods in Vermont, USA
terry@yourduino.com

hi sir! can you PM me your account email id. we had the issue with the button staying in waiting but it has been solved now,

Hi, Technical issue :slight_smile: What is "account email id. "

the email id you used for login in the cayenne platform.

Hi, OK couple things.

How-To pages and code for this project are here:
https://arduinoinfo.mywikis.net/wiki/Arduino-Project-Home-Monitor-Control

Should this be “submitted as a project” ?

The button ‘waiting’ problem seems to occur only if browser is left untouched for hours/overnight, OR if another local computer brings up the same screen. Hmmm…

THANKS!

1 Like

That is a nice project and great write up.

Sure, you can upload the project in Projects Made with Cayenne - myDevices Cayenne Community so all community users can view it and it can also help someone when doing a similar project like this.

thanks for the update.

Hello, I seem to be having a problem with button functionality again. Similar as before. I can push a button to activate a relay on for example, but when I press the button again it does not function on 2nd or any additional button presses. If I disconnect and reconnect to Cayenne dashboard the button press will only work once again. The button status does change but it doesn’t actually control the device after the first press of the button. Any help will be appreciated.

which mobile device are you are using?

iPad running iOS ver 12. Accessing Cayenne dashboard via safari browser. I also tried the Cayenne iOS app which does not function at all on my end. The devices show up but none of the buttons work.

we have fix for the IOS app which we will release soon.

Ok good, thx. Will the fix also make the dashboard function properly when accessed through safari browser?

not yet. you can use it on google chrome without any issue,

Logged in through Chrome and everything works good. Thank you!

Hi. As of today it appears Chrome isn’t working either. Same issue; buttons only work on 1st press. Any fixes for this on my end??

can you PM me your email_id.

Do you get a spinning circle? Could you share your code here.

Hi Adam, I get a spinning circle for 1 or 2 seconds and then the button state changes but my relays don’t function after the 1st press. sometimes after a long delay of 1 minute or more the relay state changes but not all the time. Any help is much appreciated.

Here’s my code:



//define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include <CayenneMQTTESP8266.h>

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

char username[] = "9721fad0-48e4-11e8-8927-*********";
char password[] = "3845f0f3d653c40eef8016e**********";
char clientID[] = "01e6c5c0-8c7a-11e8-9c22-***************";

#define VIRTUAL_CHANNEL21 21 //TiltP Button (Red)at Dashboard
#define ACTUATOR_PIN2 D2 //TiltP Red LED on Valve Board
#define VIRTUAL_CHANNEL22 22 //TiltS Button (Green)at Dashboard
#define ACTUATOR_PIN3 D3 //TiltS Green LED on Valve Board
#define VIRTUAL_CHANNEL23 23 //TiltF (White) Button at Dashboard
#define ACTUATOR_PIN1 D1 //TiltF White LED on Valve Board
#define VIRTUAL_CHANNEL24 24 //TiltF (Blue) Button at Dashboard
#define ACTUATOR_PIN5 D5  //TiltB Blue LED on Valve Board


void setup(){
  Serial.begin(9600);
  Cayenne.begin(username, password, clientID, ssid, wifiPassword);
  digitalWrite(ACTUATOR_PIN2, HIGH);
  digitalWrite(ACTUATOR_PIN3, HIGH);
  digitalWrite(ACTUATOR_PIN1, HIGH);
  digitalWrite(ACTUATOR_PIN5, HIGH);
  pinMode(ACTUATOR_PIN2, OUTPUT);
  pinMode(ACTUATOR_PIN3, OUTPUT);
  pinMode(ACTUATOR_PIN1, OUTPUT);
  pinMode(ACTUATOR_PIN5, OUTPUT);
}

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

// This function is called when data is sent from Cayenne.
CAYENNE_IN(VIRTUAL_CHANNEL21)
{
  // Write value to turn the relay switch on or off. This code assumes you wire your relay as normally open.
  if (getValue.asInt() == 0) {
    digitalWrite(ACTUATOR_PIN2, HIGH);
  }
  else {
    digitalWrite(ACTUATOR_PIN2, LOW);
  }
}

CAYENNE_IN(VIRTUAL_CHANNEL22)
{
  // Write value to turn the relay switch on or off. This code assumes you wire your relay as normally open.
  if (getValue.asInt() == 0) {
    digitalWrite(ACTUATOR_PIN3, HIGH);
  }
  else {
    digitalWrite(ACTUATOR_PIN3, LOW);
  }
}

CAYENNE_IN(VIRTUAL_CHANNEL23)
{
  // Write value to turn the relay switch on or off. This code assumes you wire your relay as normally open.
  if (getValue.asInt() == 0) {
    digitalWrite(ACTUATOR_PIN1, HIGH);
  }
  else {
    digitalWrite(ACTUATOR_PIN1, LOW);
  }
}

CAYENNE_IN(VIRTUAL_CHANNEL24)
{
  // Write value to turn the relay switch on or off. This code assumes you wire your relay as normally open.
  if (getValue.asInt() == 0) {
    digitalWrite(ACTUATOR_PIN5, HIGH);
  }
  else {
    digitalWrite(ACTUATOR_PIN5, LOW);
  }
}

CAYENNE_OUT_DEFAULT()
{
 // Write data to Cayenne here. This example just sends the current uptime in milliseconds on virtual channel 0.
  Cayenne.virtualWrite(0, millis());
}