I can't find the WifiSendAlert() function in the libraries.
I can't find the WifiSendAlert() function in the libraries.
Could someone please tell me where the WifiSendAlert() function is located in the libraries? I would like to see if I can figure out how to add a few more custom alert messages beyond the few that currently exist which are:
WifiSendAlert(0)="Nothing"
WifiSendAlert(1)="Auto top-off timeout"
WifiSendAlert(2)="Water temperature too high"
WifiSendAlert(3)="Water temperature too low"
WifiSendAlert(4)="Lights temperature too high"
WifiSendAlert(5)="PH too high"
WifiSendAlert(6)="PH too low Alert"
Examples of a few messages that I want to add are:
WifiSendAlert(7)="ATO reservior is empty"
WifiSendAlert(8)="Sump water level is too low"
WifiSendAlert(9)="Sump water level is too high"
I would also like to see if it could send the SMS alerts faster (ex. within 1 minute).
Thanks,
John
WifiSendAlert(0)="Nothing"
WifiSendAlert(1)="Auto top-off timeout"
WifiSendAlert(2)="Water temperature too high"
WifiSendAlert(3)="Water temperature too low"
WifiSendAlert(4)="Lights temperature too high"
WifiSendAlert(5)="PH too high"
WifiSendAlert(6)="PH too low Alert"
Examples of a few messages that I want to add are:
WifiSendAlert(7)="ATO reservior is empty"
WifiSendAlert(8)="Sump water level is too low"
WifiSendAlert(9)="Sump water level is too high"
I would also like to see if it could send the SMS alerts faster (ex. within 1 minute).
Thanks,
John
Re: I can't find the WifiSendAlert() function in the librari
it's not in the libraries.
here's a post made by you with the code you need:
http://forum.reefangel.com/viewtopic.ph ... ert#p18083
here's a post made by you with the code you need:
http://forum.reefangel.com/viewtopic.ph ... ert#p18083
I can't find the WifiSendAlert() function in the libraries.
I dont think that function is in the libraries...i think it was a custom one...if i'm wrong though you can find it in the Doxygen docs.
http://www.easte.net/RA/html/
http://www.easte.net/RA/html/
I can't find the WifiSendAlert() function in the libraries.
Ahh yeah, looks like its happening in the portal...binder wrote:it's not in the libraries.
here's a post made by you with the code you need:
http://forum.reefangel.com/viewtopic.ph ... ert#p18083
Re: I can't find the WifiSendAlert() function in the librari
This is the code that I am using but I don't see where the alert messages are being defined.
I don't see where these ids are defined in the code.
WifiSendAlert(0)="Nothing"
WifiSendAlert(1)="Auto top-off timeout"
WifiSendAlert(2)="Water temperature too high"
WifiSendAlert(3)="Water temperature too low"
WifiSendAlert(4)="Lights temperature too high"
WifiSendAlert(5)="PH too high"
WifiSendAlert(6)="PH too low Alert"
Can someone explain how it works?
Thanks,
John
Code: Select all
// Setup SMS alerts
void WifiSendAlert(byte id, boolean IsAlert)
{
static byte alert_status;
if (IsAlert)
{
if ((alert_status & 1<<(id-1))==0)
{
alert_status|=1<<(id-1);
Serial.print("GET /status/alert.asp?e=3141234567@vtext.com&id=");
Serial.println(alert_status,DEC);
Serial.println("\n\n");
}
}
else
{
if (id==0)
{
alert_status=0;
delay(900);
}
else
{
alert_status&=~(1<<(id-1));
}
}
}
WifiSendAlert(0)="Nothing"
WifiSendAlert(1)="Auto top-off timeout"
WifiSendAlert(2)="Water temperature too high"
WifiSendAlert(3)="Water temperature too low"
WifiSendAlert(4)="Lights temperature too high"
WifiSendAlert(5)="PH too high"
WifiSendAlert(6)="PH too low Alert"
Can someone explain how it works?
Thanks,
John
I can't find the WifiSendAlert() function in the libraries.
This code is sending the alert to the portal...it's not happening in the library code.
That could solve having to use custom variables for alert flags and solve mudcat's issue, also enable faster alerting to make it RA triggered instead of possible 5 minute delay waiting for portal timer to trigger.
Roberto, maybe we can extend this to take some custom strings instead of just id=mudcat1 wrote:Code: Select all
alert_status|=1<<(id-1); Serial.print("GET /status/alert.asp?e=3141234567@vtext.com&id="); Serial.println(alert_status,DEC);
That could solve having to use custom variables for alert flags and solve mudcat's issue, also enable faster alerting to make it RA triggered instead of possible 5 minute delay waiting for portal timer to trigger.
Re: I can't find the WifiSendAlert() function in the librari
Yes, a 5 minute delay, if my sump is overflowing would be tragic.
I can't find the WifiSendAlert() function in the libraries.
If my sump starts overflowing, I have a float switch activate and turn off return pump... Something to consider no need to wait for disaster to strike.
Re: I can't find the WifiSendAlert() function in the librari
How can we restrict this to avoid anyone from maliciously use it to spam email with custom string?
Roberto.
Re: I can't find the WifiSendAlert() function in the librari
Actually, sleeping over the issue, I know what needs to be done.
I can create another page that takes portal username/key instead of email address.
This way, a malicious bot can only spam itself... lol
I can create another page that takes portal username/key instead of email address.
This way, a malicious bot can only spam itself... lol
Roberto.
Re: I can't find the WifiSendAlert() function in the librari
Cool. Can we get that WiFiSendAlert() added to the libs then to make it easy
Re: I can't find the WifiSendAlert() function in the librari
Ok, I created a new webpage wifialert.aspx
It will use the same email address set on your portal notifications.
Parameters:
id - your forum username
key - your portal key (optional)
msg= your custom message
Just be careful not to spam your own mailbox.
It will use the same email address set on your portal notifications.
Parameters:
id - your forum username
key - your portal key (optional)
msg= your custom message
Just be careful not to spam your own mailbox.
Roberto.
Re: I can't find the WifiSendAlert() function in the librari
Very cool!!! Tested this and it works. Now I can add this to my INO, get rid of my Custom Memory variables for flags and no more internal memory flags either with virtual relays... this will be my 5.x version Muahahah
Re: I can't find the WifiSendAlert() function in the librari
So Roberto,
I can work on a pull request if you want for the WifiSendAlert.. but I'm thinking we should put the portal user and keys in a variable in the ReefAngel class... I guess I'll wrap it in an ifdef to save memory... the function can take a char * as an arg and it will be pretty nice for people I think...
Sound good?
I can work on a pull request if you want for the WifiSendAlert.. but I'm thinking we should put the portal user and keys in a variable in the ReefAngel class... I guess I'll wrap it in an ifdef to save memory... the function can take a char * as an arg and it will be pretty nice for people I think...
Sound good?
Re: I can't find the WifiSendAlert() function in the librari
It's already there
char *portalusername;
Key is not though, but you can use the same thing I did for portalusername
char *portalusername;
Key is not though, but you can use the same thing I did for portalusername
Roberto.
Re: I can't find the WifiSendAlert() function in the librari
The only thing is we need the logic to lock it from being used over and over again and only send once/hour reminders or something, just like in the original code.
Roberto.
Re: I can't find the WifiSendAlert() function in the librari
Oh cool. Would you want that on your end or in the RA side? I would think on the RA side you'd only want to send if the status changes otherwise you could be calling that URL multiple times per second which would get ugly pretty fast. That part opens up a little can of worms... hmmm
Re: I can't find the WifiSendAlert() function in the librari
I'm thinking we could create an alert class. This way it could maintain it's state of what the status of the alert is. If the status changes it could trigger the alert and it could have a timer built in...
This way in code safely call the alert function every loop without fear and it would only call the URL when the status changes or the timeout is exceeded.
I'm thinking something along the lines of this.
if (condition is good) then alert(status_good) else alert (status_bad)
Need to think a bit more on this.
This way in code safely call the alert function every loop without fear and it would only call the URL when the status changes or the timeout is exceeded.
I'm thinking something along the lines of this.
if (condition is good) then alert(status_good) else alert (status_bad)
Need to think a bit more on this.
Re: I can't find the WifiSendAlert() function in the librari
Probably best to do it on both sides...that way even if there's a bug one one side or the other there's never a situation where a dozen people get 10,000 alerts...
Current setup:
60g 24" custom cube (fish and softies right now)
AI Sol Blue, Ecotech MP-10wES
Coralife skimmer
100% customer controller, transitioning to ReefAngel
60g 24" custom cube (fish and softies right now)
AI Sol Blue, Ecotech MP-10wES
Coralife skimmer
100% customer controller, transitioning to ReefAngel
Re: I can't find the WifiSendAlert() function in the librari
Roberto or Lee,
Did you ever finish the coding for WifiSendAlert that will allow me to add a few custom SMS alert messages? If so, will it be released in the next library version? Or is it available for download on github?
Did you ever finish the coding for WifiSendAlert that will allow me to add a few custom SMS alert messages? If so, will it be released in the next library version? Or is it available for download on github?
I can't find the WifiSendAlert() function in the libraries.
Havent had time to touch it yet, but you should be able to modify the url being called to hit the new page and then send whatever custom message you like
Re: I can't find the WifiSendAlert() function in the librari
Sorry Lee, I don't understand what you mean. Do you want me to copy these statements somewhere after my condition that determines when to send the SMS alert?lnevo wrote:Havent had time to touch it yet, but you should be able to modify the url being called to hit the new page and then send whatever custom message you like
Serial.print("GET /status/alert.asp?e=314123456@vtext.com&id=");
Serial.println(alert_status,DEC);
Serial.println("\n\n");
I need a little more to go on.
Thanks,
John
I can't find the WifiSendAlert() function in the libraries.
rimai wrote:Ok, I created a new webpage wifialert.aspx
It will use the same email address set on your portal notifications.
Parameters:
id - your forum username
key - your portal key (optional)
msg= your custom message
Just be careful not to spam your own mailbox.
You have to use this new wifialert.aspx
Change the line you have that calls alert.aspx to the new syntax above.
Maybe I'll have some time next week to play with this...
Re: I can't find the WifiSendAlert() function in the librari
Lee,lnevo wrote:rimai wrote:Ok, I created a new webpage wifialert.aspx
It will use the same email address set on your portal notifications.
Parameters:
id - your forum username
key - your portal key (optional)
msg= your custom message
Just be careful not to spam your own mailbox.
You have to use this new wifialert.aspx
Change the line you have that calls alert.aspx to the new syntax above.
Maybe I'll have some time next week to play with this...
Thanks for the clarification.
Re: I can't find the WifiSendAlert() function in the librari
I still can't figure out how to use wifialert.aspx. When I compile it says it has not been declared. Can someone please provide an example of how the wifialert.aspx is used in the sketch.
thanks,
John
thanks,
John
Re: I can't find the WifiSendAlert() function in the librari
Did you not have it working with the other page before?
Re: I can't find the WifiSendAlert() function in the librari
Yes, the WifiSendAlert() function was working, but I am not sure how to pass the parameters that you and Roberto suggested in this section of the code.lnevo wrote:Did you not have it working with the other page before?
Serial.print("GET /status/alert.asp?e=314123456@vtext.com&id=");
Serial.println(alert_status,DEC);
Serial.println("\n\n");
I am assuming that you wanted me to replace "alert.asp?" with "wifialert.aspx", but I am not sure how to specify the ID, Key and Message parameters.
I was hoping that you or Roberto could supply some sample code that I could modify.
Thanks,
John
Re: I can't find the WifiSendAlert() function in the librari
Try this:
Code: Select all
Serial.print("GET /status/wifialert.aspx?id=mudcat1&msg=ato_alert");
Re: I can't find the WifiSendAlert() function in the librari
You can comment the second line as well. I'm going to work on this soon where you can pass the alert string to the function.