My Neptune Apex web interface compatible DIY reef controller

PLS help me.
I can not upload index.htm to sdcard. I use the standard ethernet+sd shield.

Arduino 2560 program is OK. No any error.

But use curl command line :
* About to connect() to 192.168.1.208 port 8000 (#0)
* Trying 192.168.1.208...
* Adding handle: conn: 0x18bcd48
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x18bcd48) send_pipe: 1, recv_pipe: 0
* Connected to 192.168.1.208 (192.168.1.208) port 8000 (#0)
* Server auth using Basic with user 'admin'
> PUT /upload/index.htm HTTP/1.0
> Authorization: Basic YWRtaW46cGFzc3dvcmQ=
> User-Agent: curl/7.32.0
> Host: 192.168.1.208:8000
> Accept: */*
> Content-Length: 62972
>

Stop Here! Not run. The sdcard is 2GB. Format Fat32.
 
did you copy the index.htm file into the sd card first then try to see if the web server is working by going to http://192.168.1.208:8000

The curl upload is for when you box up your project and you don't have access to remove your sd card from the ethernet shield. You can use it, but at least test first of the webserver code works.

Note that the program will stop if it does not detect temp sensor and ph sensor. If you do not have any of these and you want to test the webserver, you can comment out that part of the code and test.

The program will sound one beep at the start. If you hear two beeps at the end, then everything started up ok.
 
Thank you very much, I'm not have other sensor.

I'm chinese man, english is very pool and I con not buy PH sensor. I will comment other code & test webserver.

thank you very mach too.
 
What's the current draw for the relays in the Chauvet SR8? I was thinking about using SSRs, but having a pre-made device like the SR8 is pretty attractive.
 
What's the current draw for the relays in the Chauvet SR8? I was thinking about using SSRs, but having a pre-made device like the SR8 is pretty attractive.

I did not measure it, but I'm pretty sure if you get a 12v 2a power supply, it will be able to handle 2 chauvets and the arduino circuit.

I know for the 8 channel relay board, the current draw for 12v relay is around 200ma with all channels on, and 500ma for 5v relay board with all 8 channels on.
 
d0ughb0y, got everything working but when trying to say something it get an error on the webpage

did you wire up all the hardware like in the connection diagram?

You must have temp and ph probe connected in order for the program to run.

in init sensors, you can see if the sensor initialization fails, it stops the program. So in case you did not get a temp or the atlas stamp and ph probe yet, you must comment out the corresponding code here, and temporarily change getTemp() and getph() to return a hard coded value like 79.0 and 8.0.

Code:
void initSensors() {
  if (initTemp()) {
    p(F("Temp OK.        "));
    logMessage(F("Temp sensor initialized."));
  } else {
    beepFail();
    p(F("Temp Init failed"));
    logMessage(F("Temp Init failed"));
    for(;;);
  }
  if (initPH()) {
    p(F("pH OK.          "));
    logMessage(F("pH sensor initialized."));   
  } else {
    beepFail();
    p(F("pH Init failed  "));
    logMessage(F("pH Init failed"));
    for(;;);   
  } 
}

I suggest testing the web page last until you complete the hardware. you can still load you test sketches to test each piece of the hardware (relays, temp sensor, atlas ph stamp, etc). You can find test sketches by doing google search or just write your own.

The web page is really of very limited use if you do not have the sensors.
 
Hello d0ughb0y, anymore updates on your controller. I have a question for you, Is it possible to add to the network, like adding more temp, ph control to it and changing the pump names.
 
The code I put out is how I use the controller for my own requirement. You will/must modify the code according to your requirement using my code as the starting point.

If you can understand the format I used to program the outlets in config.h, that is where you edit the outlet names, functions, schedule, etc. I can describe the format if needed.

I'm thinking of getting a jebao wp-25 and use the pwm to control the pump. The wp-25 takes 5v pwm so the op-amp in my connection diagram is not needed. The plan is to still use the signal from the jebao controller as is by passing through the signal with the option to override the signal, say to activate feed mode from the iPhone instead of having to manually press the feed button on the jebao controller.
 
Yes that what I want to do I have a 300 gallon tank and just got the new jebao wp-60 in yesterday and have the wp-40 since Feb. I change the names in the config.h in it still but the koralia in the web page. I will try again when I get home. I also got 2 atlas ph boards in, and going to add one more ph to the code.
Thanks for your help
 
I'll try to add a write up on how to modify the outlet program.

For temp probe code, the current code is optimized for one slave in the onewire bus. I use the ds.skip call (i.e., there can only be one temp probe). OneWire code is extremely slow, so adding a second temp probe, you have to split up the updating of temp readings to multiple loop cycles so it does not consume too much time per loop cycle. There is a trick to broadcast the convert command to all temp probes on the onewire bus, so you do not need to send the address of each probe and then send the convert command, Then just read the temp values of each probe in the succeeding loop cycle.

For the ph probe, you will need to make use of Serial2 for the second ph probe. The ph code is more straightforward to expand to support a second probe.

I configured the main loop to execute at 60hz or 60x per second, this means for each cycle, I have 16ms to complete all tasks. The current code takes only 1ms to complete all tasks in a loop cycle, so there is plenty of cpu cycles left for adding additional probes. Try to keep the normal loop cycle execution time under 3ms and everything should be fine. If the code is optimized properly, the 16mhz atmega has more than sufficient cpu power so there is absolutely no need to use an ARM 32bit cpu.

For the jebao, you can get by not using a controlled outlet, and just plug the jebao to your regular always ON outlet, and just use the pwm to control the on/off of the powerhead.

always test each component type (temp probes, ph, etc) individually to make sure the hardware and software works before merging in to the main code. it will be easier to troubleshoot any issues later.
 
ok, I just updated my program to enable the heater since its starting to get cold.

When you change the program in config.h, make sure to change the EEPROMSIG value to something else, it can be any value as long as it is different from the current value in your mega.

To change the program, you need to first define the "String" description of the devices in the exact order you are plugging to each outlet in #define OUTLET1 ... OUTLETn, the enter the same outlet names in #define OUTLETDEFS without the quotes.

Next the actual program goes into
#define OUTLETSDEFAULT
one line for each outlet.
There are 3 types of program,
outlets that are always on
outlets that are controlled by sensors
outlets that run on timed schedule

you specify 3 time values in seconds per outlet, initial off time, on time, off time
for always on, enter 0, SECS_PER_DAY,0
this means the outlet is on 86400 seconds.
for outlets controlled by sensor (like temp, ph or ATO), enter 0,0,0

for outlets on timed schedule, figure a cycle time for the schedule, that divides equally into 24 hours, say repeat a sequence every half hour. Then in that half hour, enter the number of seconds for initial off time, on time, then off time. The total number of seconds must equal half hour. That's it.

enter the active days (0xff for every day), and the mode (usually _auto)

active day value is bit mapped.
sun - bit 0, mon - bit 1, tue - bit 2, etc.
 
do you change the #define MAXOUTLETS 8 to 16 or leave it at 8. So I would use outlet9 and call it heater or use one of the outlets that you have available.
Thanks
 
I want use WIFI module, the WIFI module I was test other program is OK.
Where code can i change?

Thank you

If you are using the arduino wifi shield, I think you just need to change the code for initializing the EthernetServer and EthernetClient. If you look at the wifi library example, it has the exact equivalent of all examples for ethernet library. You need to change the code in TinyWebServer and in Network.ino.
 
do you change the #define MAXOUTLETS 8 to 16 or leave it at 8. So I would use outlet9 and call it heater or use one of the outlets that you have available.
Thanks

also do you uncomment #define_HEATER

yes that is correct.

set MAXOUTLETS 16 if you are connecting to two 8 channel relays (or chauvets). The Heater outlet can be assigned to any outlet number that is available. There is already code in Sensors.ino to turn Heater on or off, you just need to change the default temperature value to your preference. The high/low temperature to control heater (and fan) can be changed in the mobile app.
 
just updated the source on github with a fix to a bug in buzzer and PWM code. I had to move the buzzer from using timer3 to timer4 so it does not conflict with digital pins 2 and 3 PWM. I currently don't use the 10v PWM.

I just ordered a jebao wp-25. It is on sale now on ebay.

I plan to make the connection from the wp-25 controller pwm to arduino analog in, and then an arduino pwm out goes to the wp-25. This way, I can just pass through the pwm signal from the wp-25 controller to the pump, but can override the pwm signal if needed. The initial implementation will just be on/off so I can turn it off during feed mode. I'll see how well the stock wp-25 controller works to determine if I need to write my own pwm routine to control the wp-25.
 
Back
Top