My Neptune Apex web interface compatible DIY reef controller

I just updated github with all the fixes, so you can just use that and see if it works. I think the orp reading part will work now.

Please let me know what other problem you see after loading the latest code.

thanks.
 
I just updated github with all the fixes, so you can just use that and see if it works. I think the orp reading part will work now.

Please let me know what other problem you see after loading the latest code.

thanks.

No problem I will test later today
 
No problem I will test later today

make sure to edit the end part of Sensors.ino to enable the SerialEvent2 and SerialEvent3 and pass the "data" variable for the sensor connected to the corresponding serial port.

I have to figure a way to automatically do this from #define so all edits are just done in config.h.

in your case, if Serial1 is connected to ph0, Serial2 to ph1, Serial3 to ORP

Code:
void serialEvent1() {
  atlasHandler(phdata[0]);
}

void serialEvent2(){
  atlasHandler(phdata[1]);
}

void serialEvent3() {
  atlasHandler(orpdata);
}
 
make sure to edit the end part of Sensors.ino to enable the SerialEvent2 and SerialEvent3 and pass the "data" variable for the sensor connected to the corresponding serial port.

I have to figure a way to automatically do this from #define so all edits are just done in config.h.

in your case, if Serial1 is connected to ph0, Serial2 to ph1, Serial3 to ORP

Code:
void serialEvent1() {
  atlasHandler(phdata[0]);
}

void serialEvent2(){
  atlasHandler(phdata[1]);
}

void serialEvent3() {
  atlasHandler(orpdata);
}

Thanks
 
Ok, now come to think of it, if the serialevents are not enabled, that will also cause the sensor reading to not update (Ph2 and ORP). You basically get the initial reading upon initialization. I think it should all work now.
 
Ok, now come to think of it, if the serialevents are not enabled, that will also cause the sensor reading to not update (Ph2 and ORP). You basically get the initial reading upon initialization. I think it should all work now.

I have the serial events enable in the code. The pH and the CalRX are changing a little, Orp is not. The pH is not right but it is changing it at 7.16 now from 2.86 and the Cal went from 6.77 to 6.75. Have to up the bubble count to bring it down to 6.5.
 
I just made one more github update. SerialEvents are now auto detected, so you do not have to edit Sensors.ino. All edits are now just in config.h as before.
 
I fixed a bug in email alert code and was testing it and found out the code is not working. I'm not sure why yet, but as soon as the controller connects to smtp.gmx.com, it immediately disconnects. I can manually telnet to gmx from a telnet program so I don't think it's an issue with gmx. Anyway, disable email alert for now.
 
Ok, now come to think of it, if the serialevents are not enabled, that will also cause the sensor reading to not update (Ph2 and ORP). You basically get the initial reading upon initialization. I think it should all work now.

Everything is working now thanks
 
ok I found the problem with my email alert. I recently changed my router, and it seems the router does not work as dns (does not do dns forwarding). If I explicitly defined the dns ip address, then email works fine. I'm going to add a new #defne DNS_IP. if it is not defined, it will just fall back to using the ROUTER_IP for dnsserver.

I just updated github with all the latest fixes.
 
Last edited:
ok, I finally figured out what's wrong in the email alert code.

apparently, if you use host name and a dns lookup is made, client.connect can actually return NEGATIVE values !!!!, which evaulates to TRUE !!!

so the proper code must be

Code:
if (client.connect("host",port)==1)

even the ethernet library does not do that, they all do

Code:
if (client.connect("host",port))

which will evaluate to true in case of dns error.

The fix I uploaded to github now tests if value returned is 1.
 
I received my Atlas and probe...got them working so far. My next question is about the ATO. I have the ultra sensor working and just one float switch which i see change open/closed. Now how can I get this to change an outlet state to turn on a pump. Is there a outlet name that should be used?
 
I received my Atlas and probe...got them working so far. My next question is about the ATO. I have the ultra sensor working and just one float switch which i see change open/closed. Now how can I get this to change an outlet state to turn on a pump. Is there a outlet name that should be used?

You need to edit InterruptsIO.ino file, checkATO() function.

a simple configuration would be something like this

Code:
  void checkATO(){
  if (conf.outletRec[ATO].mode == _auto) {
    if (!getATO2()&& !getATO1() && isOutletOn(Return)
        && sonaravg < conf.sonalertval*10) {
        _outletOn(ATO);
        return;
    }
    _outletOff(ATO);
  }
}
<conf.sonaralertval*10
<conf.sonalertval*10) {
you define your ATO pump connected to an outlet in OUTLETDEFS define.
if the ATO outlet is in "auto" mode, and float switch1 and 2 are both closed (omit 2 if you only have 1 float switch), and "Return" pump is on, and sonar avg reading (is in mm) is not less than your sonar alert level (in cm, hence the need to *10), then you turn on outlet ATO, otherwise, turn off ATO outlet. The sonar reading is used so it does not turn on ATO pump if water level is too low. The test if Return pump is On is so ATO does not come on say when you are doing water change and start draining your sump water, and forgot to turn your ATO outlet to manual off :).


you can basically define your own code on what condition you want to turn On/Off the ATO outlet.

BTW, since I am now using a two part doser, I'll be changing my checkATO to the above code since I will be removing my kalk stirrer. The current checkATO code controls Kalk outlet, and has condition to not turn on if ph is too high.
</conf.sonalertval*10)></conf.sonaralertval*10
 
Last edited:
Make sure you defined the ph sensors like this

#define PHDEF {{"pH",_ph,Serial1},{"CalRX",_ph,Serial2}}
#define PHALERT {{7.5,9.0},{6.0,7.0}}

is the reading the same in the lcd and in the web page?
 
Make sure you defined the ph sensors like this

#define PHDEF {{"pH",_ph,Serial1},{"CalRX",_ph,Serial2}}
#define PHALERT {{7.5,9.0},{6.0,7.0}}

is the reading the same in the lcd and in the web page?


I have them define like you have it and I don't have a lcd hook up, it showing it in the web
 
Back
Top