I can't find the WifiSendAlert() function in the libraries.

Requests for new functions or software apps

Posts: 12327
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Tue May 28, 2013 8:56 pm
Ok, I've made the required changes.
Can you try again?
Roberto.
User avatar
Posts: 5364
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Tue May 28, 2013 10:21 pm
Working!

Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm
PostPosted: Tue May 28, 2013 10:46 pm
I don't think it is working for me. Where do I change the time interval with .SetDelay(int)? I can't find this anywhere.

Lee,
Did you have to change any of the original code to get it working?
User avatar
Posts: 5364
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Wed May 29, 2013 2:07 am
Its part of the object..so if you declared atoAlarm then atoAlarm.SetDelay(30);

I didn't change any of the code. The code was good :) i need to upload my version with the force option tomorrow and see if that part is working. That might make debug easier..

Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm
PostPosted: Wed May 29, 2013 10:35 am
Lee,
The problem that I am encountering now seems to be that it will not send the portal key with the request.

I have the portal key specified in the INO.

ReefAngel.Portal( "mudcat1","xxxxxxxxxx" );

When the float switch is triggered. This gets sent...

GET /status/wifialert.aspx?id=mudcat1&key=&msg=Sump_WaterLevel_too_high

The portal key is missing "&key=" How did you get past that issue?

Thanks,
John
User avatar
Posts: 5364
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Wed May 29, 2013 10:37 am
I didn't get that far...i don't use a key. Your using the copy/paste code above? I'll check in a little while if i missed something.

For the record, long term the second arg will be for force not for key...that will get stored in library when you do SendPortal
User avatar
Posts: 5364
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Wed May 29, 2013 10:39 am
Oh just re-read your post. If your doing copy / paste the. You will need to do

atoAlarm.Send("msg","key");

Edit: forgot the function :) syntax updated.
User avatar
Posts: 5364
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Wed May 29, 2013 2:56 pm
So, this is starting to seriously call for a class to manage all the dosing pumps and a class for each dosing pump with its characteristics (calibration volume, rate factor, timers, messages, etc.)

Anyway, here's my first run at a calibraton routine. The way it works is that I have a virtual outlet that I turn on to calibrate. This could just as easily be a menu mode... When that outlet is on, the calibration starts. For each pump defined it waits for the maskon to happen. when you turn it on it assumes you are filling a measuring cup to whatever amount you want. At that point it records the time. When the mask off happens it compares the times and gets the total running time. It then pages you with the result. If you need to turn the pump back on for a little more, it will track the running time. When your happy with the result, the last page you get will be the total time.

You can then put that time into a memory variable and that is used by my previous dosing pump routine to calculate the dosage. Since you've also stored the amount of liquid you are measuring we can properly calculate this. Also, the units can be whatever.. it could just as easily be 5 gallons in 200 seconds or 100ml in an hour.

What is now important is that you can now enter the number of ml or gallons or whatever you want and over how ever many doses you want per day and it's all calculated... :) Let's see how it tests out.

I'm also going to add logging that we started working on for kirkwood. What I would like a separate function that is logging the relay and storing the total time it is on and send me the total each hour.

Anyway, without further-ado. This code is compiled but not yet tested. It will be uploaded after this post :)

Code: Select all
// Run calibration routine,
void CalibrateDPumps() {
  const byte numPumps=2;
  byte pump[numPumps] = { DPump1, DPump2 };
  static time_t pumpTimer[numPumps];
  static WiFiAlert calibrateMsg;
  char msg[16];
 
  if (ReefAngel.Relay.Status(VO_Calibrate)) {
    for (int i=0;i < numPumps;i++) {
      if (ReefAngel.Relay.isMaskOn(pump[i])) {
        pumpTimer[i]=now()-pumpTimer[i];
        ReefAngel.Relay.Override(pump[i],2);
        ReefAngel.Relay.On(pump[i]);
      }
     
      if (ReefAngel.Relay.isMaskOff(pump[i]) && pumpTimer[i]>0) {
        ReefAngel.Relay.Override(pump[i],2);
        ReefAngel.Relay.Off(pump[i]);
        pumpTimer[i]=now()-pumpTimer[i];
        sprintf(msg,"Pump%d+:+%d",i+1,pumpTimer[i]);
        calibrateMsg.Send(msg,true);
      }
    }
  } else {
    for (int i=0;i< numPumps;i++) {
      pumpTimer[i]=0;
    }
  }   
}

Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm
PostPosted: Wed May 29, 2013 3:52 pm
lnevo wrote:Oh just re-read your post. If your doing copy / paste the. You will need to do

atoAlarm.Send("msg","key");

Edit: forgot the function :) syntax updated.


Lee,
That fixed it. I can now send SMS texts from the Reef Angel. :D

Thanks for all of your help and patience.

John

Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm
PostPosted: Wed May 29, 2013 3:56 pm
Lee,
One more question. What interval does the 30 specify in this statement?
atoAlarm.SetDelay(30);

Is it 30 minutes, 30 seconds or 30 milliseconds? And does this delay the interval between when it will send the alert? I just tested the Sump too hot code and it SPAMMED me with several messages. I need to tune something.

Thanks,
John
PreviousNext

Return to Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron