Triggers not working on Web or iOS


#1

I’ll preface this by stating that I am receiving accurate readings from my sensors and am able to control my servos using the slider from both the Web and iOS app.

  • Device & model you are using:
    Arduino Uno via USB Serial

  • What dashboard are you using?
    Web and iOS

  • Please describe the bug / issue as detailed as possible.
    I’ve configured my triggers to power on set some servos when a thermistor sensor reaches a certain point, then change them back again when it cools down. I’ve tried setting up the triggers from both the web and iOS app. The web doesn’t let me choose a temperature unit but the iOS app does so that was the first issue, however, I am yet to be able to get my triggers to work what-so-ever. I’ve attached some screenshots/code below. Any help is greatly appreciated.

#include <CayenneTemperature.h>
#include <CayenneSerial.h>
#include <Servo.h>

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

// Virtual Pin of the Thermistor widget.
#define VIRTUAL_PIN V1
#define SERVO_VIRTUAL_PIN V2
#define SERVO_1_DIGITAL_PIN 9
#define SERVO_2_DIGITAL_PIN 10

// Analog pin the thermistor is connected to.
const int thermistorPin = 0;

// Resistance of the resistor. Currently set to 10k but this can be set to the measured resistance of your
// resistor for greater accuracy.
const float resistance = 10000; 

Thermistor thermistor(thermistorPin, resistance);
Servo s1;
Servo s2;

int lastPosition = 0;

void setup() {
  Cayenne.begin(token);

  s1.attach(SERVO_1_DIGITAL_PIN);
  s2.attach(SERVO_2_DIGITAL_PIN);
}

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

// This function is called when the Cayenne widget requests data for the Virtual Pin.
CAYENNE_OUT(VIRTUAL_PIN) {
  Cayenne.celsiusWrite(VIRTUAL_PIN, thermistor.getCelsius());
}

CAYENNE_IN(SERVO_VIRTUAL_PIN)
{
  // get value sent from dashboard
  double currentValue = getValue.asDouble();
  int position = (int) currentValue;
  // actually move the servo to the specified position
  s1.write(position);
  s2.write(position);

  if (position > lastPosition) {
    for (int i = lastPosition; i <= position; i += 1) {
      s1.write(i);
      s2.write(i);

      delay(30);
    }
  } else if (position < lastPosition) {
    for (int i = lastPosition; i >= position; i -= 1) {
      s1.write(i);
      s2.write(i);

      delay(30);
    }
  }

  //update last position
  lastPosition = position;
}

#2

I’ve noticed that the text message notifications for scheduled events are not currently working. The text notifications seem to be working for trigger events like my garage door opening or closing.


#3

Odd, I’ll assume its the same phone number and entered correctly in both places? I’m seeing Schedule and Trigger SMS work OK in a quick test.

Just a thought, but is the event older than the new scheduler we just put into place? Those notes say June 12, but really it’s been in place since the 7th or 8th. We should have ported the events into the new system, but it’s possible there could have been an issue there. If it’s older than the 7th or so, might be a good test to delete and re-enter it. If that still doesn’t get the SMS coming as expected, let me know a little more detail about the events (what they are doing, settings, recurrence) and I’ll investigate.


#4

Gotcha, yeah i stopped receiving them on the 8th around noon CST. I’ll re-add them and let you know if there are any issues.

Thanks!