Not receiving notifications from triggers

  • TI CC3200 Launchpad XL

  • Web and Android dashboard

  • We are no longer receiving text or email notifications when the triggers are run. The hardware has been deployed since August with no changes to the configuration. In September the triggers ran as intended and we were notified of the trigger going off via text and email. We recently discovered that notification are no longer working. The software was uploaded to a new set of identical hardware, on a different Cayenne account, with the same trigger settings, and it will no send notifications either. The triggers are still being counted for total times run but we do not receive notifications.

can you try creating a new trigger. also have a look at this topic Sending MQTT messages within notification limit

I have tested with a new trigger and still do not receive notifications. The current triggers all show as running when their threshold value is surpassed. The second account that I tried it on has not been used in months and has 8 triggers that ran today so no where near the limit.

Also, I am using the code you linked on our deployed hardware to avoid that limit. I tested both that trigger and the default one for the device and neither sends a notification, no matter the hardware or account used.

can you try sending an email notification to a different email_id (particularly a Gmail id)

I made a third account with my personal gmail and it will send text and email notifications. The notifications were working on the project account, both text and email, as of 9-10-19. It is also a tamu.edu account. My personal school account had not been used recently but did not send text or email notifications when I tested earlier today.

you dont need to make another account, but just replace the email_id with a new gmail_id. we have seen this issue, where some id, tend to block the emails when it is send at frequent rate.

My school email hit 90 this morning when testing the non-delayed trigger is why I made a new one. I added my gmail account to the project account and received a notification to gmail, but no text or email to tamu.edu account

tamu.edu won’t work, the reason is above. you need to implement the code in such a way that it only sends data once using the link i shared above.

The code is implemented that way. It was working as intended as of Sept 10, sending text and email notifications to myself and the customer, who has a tamu.edu account. I just tested by adding my gmail account. It sent to my gmail, but no texts or tamu.edu, even though it sent to them in the past.

I’ve removed all phone numbers and emails other than my gmail, tested and receive an email notification. I added the phone numbers back and only receive an email notification to gmail. When testing on the third account this afternoon I was able to receive email and text…same code, same hardware, same trigger settings, just a different Cayenne account

can you share the code you are using?

// Libraries for TMP006, BME280, OPT3001, Cayenne, and Local libraries
#include <Adafruit_TMP006.h>
#include <BlueDot_BME280.h>
#include <OPT3001_Revised.h>
#include <CayenneMQTTWiFi.h>
#include <WiFi.h>
#include <Wire.h>


// Core library for code-sense - IDE-based
#if defined(ENERGIA) // LaunchPad specific
#include "Energia.h"
#else // error
#error Platform not supported
#endif // end IDE


// define global terms to be referenced throughout entire code to will not change
// if global term gets used
// #define reference value
#define CAYENNE_PRINT Serial


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

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

// sensor variables
// float will not work with Cayenne.virtualWrite
int waterRead;
int waterCount;
int waterSum;
int waterAvg;
int waterHeight;
int waterTrigger=480;
int a;
int tmp_objtemp;
int tmp_inttemp;
int bme_temp;
int bme_hum;
int bme_presr;
int opt_light;
int runtime;
int alarmTime;

//Structure to configure sensors
Adafruit_TMP006 mytmp006(0x41); //needs to be told hex I2C address
BlueDot_BME280 mybme;
opt3001 myopt3001;

// Edit period_ms
const uint32_t period_ms = 8000;
uint32_t chrono = 0;


void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600); // Start Serial Monitor at baud rate of 9600
  Serial.println("COM Connected...");
  
  Cayenne.begin(username, password, clientID, ssid, wifiPassword); // Connect to internet and Cayenne
  Serial.println("Cayenne Connected...");
  
  Wire.begin();
  Serial.println("Wire Connected...");
  
  myopt3001.begin();
  Serial.println("OPT3001 Connected..."); //start communication with OPT3001 Sensor
  
  mybme.parameter.I2CAddress = 0x77; //set I2C address
  mybme.parameter.sensorMode = 0b11; //normal operation mode
  mybme.parameter.IIRfilter = 0b100; //less noise but less responsive
  mybme.parameter.humidOversampling = 0b101;
  mybme.parameter.tempOversampling = 0b101;
  mybme.parameter.pressOversampling = 0b101;
  mybme.init();
  Serial.println("BME280 Connected..."); //start communication with BME280 Sensor
  
  mytmp006.begin(); 
  Serial.println("TMP006 Connected..."); //start communication with TMP006 Sensor

}

void loop() {
  // put your main code here, to run repeatedly: 
  Cayenne.loop();
     
        //Read data
   
        // BME280 Data
        bme_temp = mybme.readTempF(); //conversion(mybme.temperature(), KELVIN, FAHRENHEIT); 
        bme_presr = mybme.readPressure();
        bme_hum = mybme.readHumidity();
        
        // TMP006 Data
        tmp_objtemp = mytmp006.readObjTempC();
        tmp_inttemp = mytmp006.readDieTempC();
        
        // OPT3001 Data
        opt_light = myopt3001.readResult();
        
        //Water at analog pin 2
        waterCount=0;
        waterSum=0;
        waterAvg=0;
        waterHeight=0;
 
        while(waterCount<50)
        {
          waterRead=analogRead(2);
          waterSum=waterSum+waterRead;
          waterCount++;
        }
        waterAvg=waterSum/50;

        //formula for water height
        waterHeight=waterAvg/1100;

  send_data();
  trigger();
        
}

void send_data()
{
  if (waterAvg < waterTrigger)
  {
    a=1;
    // Publish data every (period_ms) ms
    if (millis() > chrono)
    {
        chrono = millis() + period_ms;
        runtime=chrono/1000;
         // Send Data to Cayenne Dashboard
        Cayenne.virtualWrite(0, waterAvg, "ext_wleak", "Analog");
        //Cayenne.virtualWrite(1, waterHeight, "ext_wleak", "Analog");
        Cayenne.virtualWrite(2, waterAvg, "ext_wleak", "Analog");
        Cayenne.virtualWrite(3, bme_temp, "temp", "f");
        Cayenne.virtualWrite(4, bme_hum, "rel_hum", "Relative");
        Cayenne.virtualWrite(5, opt_light, "lum", "lux");
     
     //additional data
     //    Cayenne.virtualWrite(***, runtime); 
     //    Cayenne.virtualWrite(***, bme_presr, "bp", "pascal");
     //    Cayenne.virtualWrite(***, tmp_objtemp, "temp", "c");
     //    Cayenne.virtualWrite(***, tmp_inttemp, "temp", "c");   
        
        // Publish data to Serial Monitor
        Serial.print("Up time = "); Serial.println(runtime);
        Serial.print("Humidty = "); Serial.println(bme_hum); 
        Serial.print("Pressure = "); Serial.println(bme_presr); 
        Serial.print("BME Temp = "); Serial.println(bme_temp); 
        Serial.print("Tmp obj temp = "); Serial.println(tmp_objtemp); 
        Serial.print("Tmp int temp= "); Serial.println(tmp_inttemp); 
        Serial.print("Light = "); Serial.println(opt_light);
        Serial.print("Water = "); Serial.println(waterRead);
        Serial.print("Water Height = "); Serial.println(waterHeight);
        Serial.println("");
    }
  }
}
       
void trigger()
{
  if (waterAvg >= waterTrigger)
  {
    // Publish data every (period_ms) ms
  if (millis() > chrono)
    {
        chrono = millis() + period_ms;
        runtime=chrono/1000;

         // Send Data to Cayenne Dashboard
        Cayenne.virtualWrite(0, waterAvg, "ext_wleak", "Analog");
        //Cayenne.virtualWrite(1, waterHeight, "ext_wleak", "Analog");
        Cayenne.virtualWrite(3, bme_temp, "temp", "f");
        Cayenne.virtualWrite(4, bme_hum, "rel_hum", "Relative");
        Cayenne.virtualWrite(5, opt_light, "lum", "lux");
     
     //additional data
     //    Cayenne.virtualWrite(***, runtime); 
     //    Cayenne.virtualWrite(***, bme_presr, "bp", "pascal");
     //    Cayenne.virtualWrite(***, tmp_objtemp, "temp", "c");
     //    Cayenne.virtualWrite(***, tmp_inttemp, "temp", "c");
        
        // Publish data to Serial Monitor
        Serial.print("Up time = "); Serial.println(runtime);
        Serial.print("Humidty = "); Serial.println(bme_hum); 
        Serial.print("Pressure = "); Serial.println(bme_presr); 
        Serial.print("BME Temp = "); Serial.println(bme_temp); 
        Serial.print("Tmp obj temp = "); Serial.println(tmp_objtemp); 
        Serial.print("Tmp int temp= "); Serial.println(tmp_inttemp); 
        Serial.print("Light = "); Serial.println(opt_light);
        Serial.print("Water = "); Serial.println(waterRead);
        Serial.print("Water Height = "); Serial.println(waterHeight);
        Serial.println("");
    }
    if (a==1)
    {
      Serial.println("Sending Trigger");
      Serial.println("");
      Cayenne.virtualWrite(2, waterAvg, "ext_wleak", "Analog");
      a=0;
      alarmTime=runtime+360;
    }
    if (runtime >= alarmTime)
    {
      a=1;
    }
  }
}

//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");
}

That code worked as intended on the deployed hardware as of Sept 10 and would send notifications to two phone numbers and two @tamu.edu email addresses.

The three cases that I have tested. All are using the same hardware, same code other than account and device IDs, same trigger settings. All cases are showing the triggers as having run when I force the threshold value on the sensor.

Case 1: Project Cayenne account. Would send text and email notifications (two phone numbers, two @tamu.edu emails) as of Sept 10. As of now will not send text notifications, even when removing and adding the numbers. Will not send email notifications to @tamu.edu addresses. Will send email notifications to my gmail.

Case 2: Personal tamu Cayenne account. Will not send text or email notifications to @tamu.edu, was not tested with gmail. This account had not been used in months.

Case 3: Personal gmail Cayenne account. Will send text and email notifications to gmail.

case 1: can you create a new device on the same account and add the trigger?

Adding a new device to case 1 (project tamu account) will send text, gmail. and tamu.edu notifications…

Sms and email to gmail only. Your .edu has been blocked.

I’m saying the .edu is not blocked. The new device added to case 1 sent notifications to all 3. Changing the trigger of the old device will only send to gmail, not sms or .edu, even if I remove them and add again.

then you better keep on using this device. if in future if this issue occur, let me know.

Are you saying that those specific cayenne device IDs have been blocked on the cayenne side? Or that ATT, Tmobile, and TAMU email blocked the notifications? I can remove the devices and add new ones if this truly resolves the issue but we are trying to deploy 20+ devices and can not have the notifications blocked unknowingly some time down the road.