Page 1 of 1

Why am I not receiving my WiFiAlert emails?

Posted: Mon Mar 16, 2015 11:18 pm
by gaberosenfield
I think I must be confused as to how the WiFiAlert class works...

I have an automatic water change system that works wonderfully. I'm going out of town for 10 days and I want to make sure I am notified immediately if my daily AWC fails. I have all kinds of failsafes that will shut down the AWC and future AWCs. I also have a boolean that triggers the following code if an AWC fails:

Code: Select all

//This function will send me an email alert if an AWC fails.
void AWCAlert()
{
  static WiFiAlert AWCReport;
  char msg[30];
  char h[2];
  char m[2];
  char s[2];
  
  dtostrf((float) hour(), 2, 0, h);
  dtostrf((float) minute(), 2, 0, m);
  dtostrf((float) second(), 2, 0, s);
  sprintf(msg, "The AWC at %s:%s:%s failed.", h, m, s);
  AWCReport.Send(msg);
}
To test whether my alert system is working properly, I set up the following code to email me every time an AWC occurs:

Code: Select all

static WiFiAlert tempAlert;
    char tempMsg[20] = "An AWC occurred.";
    tempAlert.Send(tempMsg);
Everything compiles fine, but I never receive an email. I know my email address is correct in my portal because the alerts I set there (like low temp, etc) send me emails. What gives? How am I screwing this up?

Thanks,
Gabe

Re: Why am I not receiving my WiFiAlert emails?

Posted: Tue Jun 02, 2015 5:42 pm
by binder
Someone else asked the same question about WiFiAlert in another thread and I'm looking into it too. I will try to post here if I figure something out.

Re: Why am I not receiving my WiFiAlert emails?

Posted: Tue Jun 02, 2015 8:16 pm
by rrodriguess
Hey everyone

Is it just me or we cannot have space in the string to be sent?

Instead of:
sprintf(msg, "The AWC at %s:%s:%s failed.", h, m, s);

try:
sprintf(msg, "The+AWC+at+%s:%s:%s failed.", h, m, s);


Tell us if it works...

Rafa

Re: Why am I not receiving my WiFiAlert emails?

Posted: Tue Jun 02, 2015 8:51 pm
by lnevo
As I mentioned in the other thread you can't have space. You can manually test a notification using the URL

Code: Select all

http://forum.reefangel.com/status/wifialert.aspx?id=login&key=portalkey&msg=1234
Make sure to change login and portalkey to their respective values. If you have no key you can leave out the &key=portalkey part.

Re: Why am I not receiving my WiFiAlert emails?

Posted: Wed Jun 03, 2015 7:33 am
by binder
lnevo wrote:
Make sure to change login and portalkey to their respective values. If you have no key you can leave out the &key=portalkey part.
the controller code does not leave it out, it always sends it even if it is empty. at least that was what I was noticing during my tests last night.

Sent from my Nexus 7

Re: Why am I not receiving my WiFiAlert emails?

Posted: Sun Jun 07, 2015 7:35 am
by lnevo
Well then it's not required to be a value :) I don't have a portalkey and I have no issues with the alerts. I haven't looked closely at this code. Any luck? still having same issues?