My Neptune Apex web interface compatible DIY reef controller

Teslo,

I just tried loading the sketch to a mega with ethernet shield and sd card and ethernet connected, but without any other hardware and the webpage displays just fine.

All you need to do is comment out this section
//#define _TEMP //comment out if no temp probe
//#define _PH //comment out if no ph probe or ph stamp
//#define _HEATER
//#define _FAN
//#define _SONAR
//#define _FEEDER

You will know the program initialized if you see the mega LED start blinking once a second.
 
Hi Jerry!

I study your code and I don't understand how you create html file index.htm and controller code in Apex source file? You use some additional programs as code generators or you wrote both code manually?

Can you suggest me some web page where I coudl learn more about this .htm <-> json and controller connections?
So how to create htm code and transfer data from and to controller?

Thanks!
 
I use jquery mobile javascript library. Go to jquerymobile.com and they have samples and demo. I did not use any code generator. Everything is coded from scratch. If you are using firefox, install firebug javascript debugger, it will help a lot in stepping and debugging the javascript code. Start small, with a basic page, the just keep adding to it, and just look at my index.htm for example or reference. The jquery.com w3schools.com sites have some info on using ajax and json api.
 
Thanks a lot.

Great pwm solution!!

If you want to use full screen in the ios browser you can create a home icon and use it directly from home screen. Normaly works isolated and its fine.
If you want a personal icon you can put in the parent sd folder your own png.

Dit you think to control 5 pwm channels for the led lights? Now 5 its a normal number.
 
Thanks a lot.

Great pwm solution!!

If you want to use full screen in the ios browser you can create a home icon and use it directly from home screen. Normaly works isolated and its fine.
If you want a personal icon you can put in the parent sd folder your own png.

Dit you think to control 5 pwm channels for the led lights? Now 5 its a normal number.

The problem with safari is not the full screen, but it does not remember the login.

For now, 8 PWM pins available for LED.
I'm actually not sure if there will be enough arduino RAM memory to support that many LED lines. If it turns out it's not enough, then there is still room to optimize the current code to free up some memory.
 
d0ughb0y,
First I just want to say this is a awesome project! Second I have a Digix which is an Arduino Due hybrid and was wondering do you think your code would work with the DUE?
 
Sorry, I dont understanded your previous post correctly.
With safari on iPhone, it does not remember the login username and password. Or are you able to make safari on iOS remember the login when you access the controller web page?
Does the BRS ph probe work with the code as-is?
Any ph probe with bnc connection will work, so yes it will.

d0ughb0y,
First I just want to say this is a awesome project! Second I have a Digix which is an Arduino Due hybrid and was wondering do you think your code would work with the DUE?
I think the due has less memory and IO pins than a mega, so it will not work. The cost of mega is quite low now.
 
I think the due has less memory and IO pins than a mega, so it will not work.

Where?

Arduino Due

Microcontroller AT91SAM3X8E
Operating Voltage 3.3V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-16V
Digital I/O Pins 54 (of which 12 provide PWM output)
Analog Input Pins 12
Analog Outputs Pins 2 (DAC)
Total DC Output Current on all I/O lines 130 mA
DC Current for 3.3V Pin 800 mA
DC Current for 5V Pin 800 mA
Flash Memory 512 KB all available for the user applications
SRAM 96 KB (two banks: 64KB and 32KB)
Clock Speed 84 MHz

http://arduino.cc/en/Main/ArduinoBoardDue
 
It looks to me that the due has double the memory and a faster processor.
But runs at 3.3v instead of 5v, which is ok but if your using a 12v power supply its going to generate more heat at the voltage regulator.
Also the mega has more analog pins but the due can handle more current on the pins
Seems to me its a viable option for the mega 2560, I would compare the example code for each board and see if its the same or not. I'm sure you wouod have to change it here and there.
 
Thanks for the correction, I got that mixed up with the Duemilanove that came before UNO. Anyway, since it is using an ARM processor, and this controller's code modifies low level timer register values, then the answer is still it will not work. Since you said you want to save on cost and use the board that you already got, but spending the $20 or less will actually be more cost effective than going through the trouble of converting the program, which I take, will not be a trivial effort.
 
Thanks for the replies! I will continue to read a bit more to find a solution that that will work for the DUE..the main reason I purchased this board was because of the on board wifi, onboard eeprom, and the faster processor. This is a hybrid board and not the official DUE. That being said I don't want to hijack the thread:)
 
d0ughb0y,

I finally received my ethernet shield based on the 5100 chipset.

I'm getting the following error message when I tried to load apex.ino onto my Arduino mega2560 with the ethernet shield with NO other shields connected such as the ds1307, etc.

Arduino: 1.5.5 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Apex:9: error: 'time_t' was not declared in this scope
Apex:9: error: expected primary-expression before 'char'
Apex:9: error: expected primary-expression before 'char'
Apex:9: error: initializer expression list treated as compound expression
Apex:10: error: redefinition of 'char* date2file'
Apex:9: error: 'char* date2file' previously defined here
Apex:10: error: 'tmElements_t' was not declared in this scope
Apex:10: error: expected primary-expression before 'char'
Apex:10: error: expected primary-expression before 'char'
Apex:11: error: 'TinyWebServer' was not declared in this scope
Apex:11: error: 'webserver' was not declared in this scope
Apex:12: error: variable or field 'prelog' declared void
Apex:12: error: 'TinyWebServer' was not declared in this scope
Apex:12: error: 'webserver' was not declared in this scope
Apex:12: error: 'tmElements_t' was not declared in this scope
Apex:12: error: 'tm' was not declared in this scope
Apex:12: error: 'time_t' was not declared in this scope
Apex:12: error: 'currdate' was not declared in this scope
Apex:12: error: expected primary-expression before 'int'
Apex:13: error: 'TinyWebServer' was not declared in this scope
Apex:13: error: 'webserver' was not declared in this scope
Apex:14: error: 'TinyWebServer' was not declared in this scope
Apex:14: error: 'webserver' was not declared in this scope
Apex:16: error: 'TinyWebServer' was not declared in this scope
Apex:16: error: 'webserver' was not declared in this scope
Apex:17: error: 'TinyWebServer' was not declared in this scope
Apex:17: error: 'webserver' was not declared in this scope
Apex:18: error: 'TinyWebServer' was not declared in this scope
Apex:18: error: 'webserver' was not declared in this scope
Apex:18: error: expected primary-expression before 'const'
Apex:18: error: expected primary-expression before 'int'
Apex:18: error: initializer expression list treated as compound expression
Apex:19: error: 'TinyWebServer' was not declared in this scope
Apex:19: error: 'webserver' was not declared in this scope
Apex:20: error: 'TinyWebServer' was not declared in this scope
Apex:20: error: 'webserver' was not declared in this scope
Apex:20: error: expected primary-expression before 'long'
Apex:20: error: initializer expression list treated as compound expression
Apex:21: error: 'TinyWebServer' was not declared in this scope
Apex:21: error: 'webserver' was not declared in this scope
Apex:22: error: 'TinyWebServer' was not declared in this scope
Apex:22: error: 'webserver' was not declared in this scope
Apex:23: error: 'TinyWebServer' was not declared in this scope
Apex:23: error: 'webserver' was not declared in this scope
Apex:24: error: 'TinyWebServer' was not declared in this scope
Apex:24: error: 'webserver' was not declared in this scope
Apex:25: error: 'TinyWebServer' was not declared in this scope
Apex:25: error: 'webserver' was not declared in this scope
Apex:26: error: 'TinyWebServer' was not declared in this scope
Apex:26: error: 'webserver' was not declared in this scope
Apex:27: error: variable or field 'scantofirstline' declared void
Apex:27: error: 'Client' was not declared in this scope
Apex:27: error: 'client' was not declared in this scope
Apex:27: error: expected primary-expression before 'char'
Apex:27: error: expected primary-expression before 'int'
Apex:27: error: 'tmElements_t' was not declared in this scope
Apex:71: error: variable or field 'send_file_name' declared void
Apex:71: error: 'TinyWebServer' was not declared in this scope
Apex:71: error: 'web_server' was not declared in this scope
Apex:72: error: variable or field 'send_file_name' declared void
Apex:72: error: 'TinyWebServer' was not declared in this scope
Apex:72: error: 'web_server' was not declared in this scope
Apex:72: error: expected primary-expression before 'char'
Apex:73: error: 'TinyWebServer' was not declared in this scope
Apex:73: error: 'web_server' was not declared in this scope
Apex:74: error: 'TinyWebServer' was not declared in this scope
Apex:74: error: 'web_server' was not declared in this scope
Apex:75: error: 'TinyWebServer' was not declared in this scope
Apex:75: error: 'web_server' was not declared in this scope
Apex:76: error: 'TinyWebServer' was not declared in this scope
Apex:76: error: 'web_server' was not declared in this scope
Apex:77: error: 'TinyWebServer' was not declared in this scope
Apex:77: error: 'web_server' was not declared in this scope
Apex:81: error: 'EthernetClient' was not declared in this scope
Apex:81: error: 'client' was not declared in this scope
Apex:82: error: variable or field 'efail' declared void
Apex:82: error: 'EthernetClient' was not declared in this scope
Apex:82: error: 'client' was not declared in this scope
Apex:84: error: variable or field 'autoDST' declared void
Apex:84: error: 'time_t' was not declared in this scope
Apex:85: error: 'time_t' was not declared in this scope
Apex:86: error: 'EthernetUDP' was not declared in this scope
Apex:86: error: 'IPAddress' was not declared in this scope
Apex:86: error: initializer expression list treated as compound expression
Apex:87: error: variable or field 'logNetworkAccess' declared void
Apex:87: error: 'TinyWebServer' was not declared in this scope
Apex:87: error: 'web_server' was not declared in this scope
Apex:101: error: 'time_t' does not name a type
Apex:107: error: variable or field 'getpwmdata' declared void
Apex:107: error: 'Client' was not declared in this scope
Apex:107: error: 'client' was not declared in this scope
Apex:107: error: expected primary-expression before 'channel'
Apex:108: error: variable or field 'getpumpinfo' declared void
Apex:108: error: 'Client' was not declared in this scope
Apex:108: error: 'client' was not declared in this scope
Apex:109: error: variable or field 'getpumpinfo' declared void
Apex:109: error: 'Client' was not declared in this scope
Apex:109: error: 'client' was not declared in this scope
Apex:109: error: expected primary-expression before 'i'
Apex:110: error: variable or field 'getwavedef' declared void
Apex:110: error: 'Client' was not declared in this scope
Apex:110: error: 'client' was not declared in this scope
Apex:154: error: variable or field 'ptime' declared void
Apex:154: error: 'time_t' was not declared in this scope
Apex:169: error: expected ',' or '...' before 'thetime'
Apex:169: error: ISO C++ forbids declaration of 'time_t' with no type
Apex:171: error: expected ',' or '...' before 't'
Apex:171: error: ISO C++ forbids declaration of 'time_t' with no type
Apex:172: error: variable or field 'getfiles' declared void
Apex:172: error: 'Client' was not declared in this scope
Apex:172: error: 'client' was not declared in this scope
Apex:172: error: expected primary-expression before 'char'
Apex:7: error: expected constructor, destructor, or type conversion before '(' token
Apex:8: error: expected constructor, destructor, or type conversion before '(' token
Apex:9: error: expected constructor, destructor, or type conversion before '(' token
Apex:10: error: expected constructor, destructor, or type conversion before '(' token
Apex:11: error: expected constructor, destructor, or type conversion before '(' token
Apex:12: error: expected constructor, destructor, or type conversion before '(' token
Apex:13: error: expected constructor, destructor, or type conversion before '(' token
Apex:14: error: expected constructor, destructor, or type conversion before '(' token
Apex:15: error: expected constructor, destructor, or type conversion before '(' token
Apex:16: error: expected constructor, destructor, or type conversion before '(' token
Apex:17: error: expected constructor, destructor, or type conversion before '(' token
Apex:18: error: expected constructor, destructor, or type conversion before '(' token
Apex:19: error: expected constructor, destructor, or type conversion before '(' token
Apex:20: error: expected constructor, destructor, or type conversion before '(' token
Apex:21: error: expected constructor, destructor, or type conversion before '(' token
Apex:22: error: expected constructor, destructor, or type conversion before '(' token
Apex:23: error: expected constructor, destructor, or type conversion before '(' token
Apex:24: error: expected constructor, destructor, or type conversion before '(' token
Apex:25: error: expected constructor, destructor, or type conversion before '(' token
Apex:26: error: expected constructor, destructor, or type conversion before '(' token
Apex:27: error: expected constructor, destructor, or type conversion before '(' token
Apex:28: error: expected constructor, destructor, or type conversion before '(' token
Apex:29: error: expected constructor, destructor, or type conversion before '(' token
Apex:30: error: expected constructor, destructor, or type conversion before '(' token
Apex:31: error: expected constructor, destructor, or type conversion before '(' token
Apex:32: error: expected constructor, destructor, or type conversion before '(' token
Apex:33: error: expected constructor, destructor, or type conversion before '(' token
Apex:34: error: expected constructor, destructor, or type conversion before '(' token
Apex:35: error: expected constructor, destructor, or type conversion before '(' token
Apex:36: error: expected constructor, destructor, or type conversion before '(' token
Apex:37: error: expected constructor, destructor, or type conversion before '(' token
Apex:38: error: expected constructor, destructor, or type conversion before '(' token
Apex:39: error: expected constructor, destructor, or type conversion before '(' token
Apex:40: error: expected constructor, destructor, or type conversion before '(' token
Apex:41: error: expected constructor, destructor, or type conversion before '(' token
Apex:42: error: expected constructor, destructor, or type conversion before '(' token
Apex:43: error: expected constructor, destructor, or type conversion before '(' token
Apex:44: error: expected constructor, destructor, or type conversion before '(' token
Apex:45: error: expected constructor, destructor, or type conversion before '(' token
Apex:61: error: redefinition of 'char* date2file'
Apex:9: error: 'char* date2file' previously defined here
Apex:61: error: 'time_t' was not declared in this scope
Apex:61: error: expected primary-expression before 'char'
Apex:61: error: expected primary-expression before 'char'
Apex:67: error: redefinition of 'char* date2file'
Apex:9: error: 'char* date2file' previously defined here
Apex:67: error: 'tmElements_t' was not declared in this scope
Apex:67: error: expected primary-expression before 'char'
Apex:67: error: expected primary-expression before 'char'
Apex:95: error: redefinition of 'boolean apex_status_handler'
Apex:11: error: 'boolean apex_status_handler' previously defined here
Apex:95: error: 'TinyWebServer' was not declared in this scope
Apex:95: error: 'webserver' was not declared in this scope​


Any ideas what may be causing these error messages?

Thanks in advance!
 
From what I understand you need to comment out any peripherals your not using. I.E. if your not using a ph probe you need to comment out the ph probe portion of code by adding // in front of code
 
I've installed various versions of the Arduino on my laptop playing with the Hydra, Typhoon and various other reef controllers including the Reef Angel.

Needless to say, there's many version of the Arduino The new version of v1.5.5 now has a Windows installer.

Before continuing, I'll clean up the filesystem by removing all older versions of the Arduino software.

Is everyone placing the CHAUVET16 directory into \MY DOCUMENTS?

What about the libraries - DS1370RTC, OneWire, etc? Do I add them into \program files (x86)\arduino\libraries directory structure of put them into the \MY DOCUMENTS\CHAUVET16 directory?


From what I understand you need to comment out any peripherals your not using. I.E. if your not using a ph probe you need to comment out the ph probe portion of code by adding // in front of code

which INO file would I find the peripherals?

Thanks!
 
byee,

do this one step at a time.

first, make sure you followed the setup described in github main page. The errors you listed looks like the libraries cannot be found.

when you start arduino, go to File/Preferences menu. The first item tells you exactly where your sketcbook folder is.

In this folder, create a folder named libraries. It is in this folder where you copy the library files needed such as Time, sdfat, etc.

You need to quit and restart arduino for it to see the libraries.
In order to verify, go to Sketch/Import Libraries menu to see if you see the libraries you added (such as SdFat, Time, etc).

Next, you need to copy the Chauvet16 files into your sketchbook folder (you need to quit and restart arduino again).

As to testing the program with only the mega and ethernet shield, refer to post #201 of this thread.

The best way to proceed is to test each item (temp probe, relay board, etc) independently using the test program that comes with the item.

There are plenty of getting started with arduino write ups if you do a google search for anyone not familiar with arduino. Work slowly. It took me a couple years to get to this point.
 
Hi d0ughb0y, Sincerely I love this project.
Now in the temp an ph graph you can touch and it show the value at this point. I think that can be useful to include the date too.
I reviewed the code and not understand how write the sensor lines in the sd. I need more time. I want to add another temp sensor and l am thinking to change the ph value for the another temp sensor and after to include de ph prove too, but not now because the atlas ph prove deliver its so expensive.
Thanks another time.

Now I only need 3 peristaltic and 3 light channels to finish. ;)
 
Hi d0ughb0y, Sincerely I love this project.
Now in the temp an ph graph you can touch and it show the value at this point. I think that can be useful to include the date too.
I reviewed the code and not understand how write the sensor lines in the sd. I need more time. I want to add another temp sensor and l am thinking to change the ph value for the another temp sensor and after to include de ph prove too, but not now because the atlas ph prove deliver its so expensive.
Thanks another time.

Now I only need 3 peristaltic and 3 light channels to finish. ;)

The web page is generated dynamically based on the data returned by call to /cgi-bin/status.xml

meaning, if the response contains two temp sensors, then the page will display two temp sensors.

So what you need to do is get the code to work with two temp sensors, then you need to modify the code that responds to status.xml (apex_status_handler in apex.ino) so that it returns two temp sensor records. Then in the apex_status_json_handler, you will need to return two temp values.
 
Back
Top