My Neptune Apex web interface compatible DIY reef controller

update on led controller build.
I got the second CC3000, and it definitely works better in client mode. However, I am still unable to get server mode to work. I can't get it to accept connection from a browser or from curl. The firmware version shows 1.24. I'm thinking of updating it to the latest 1.32. If this still does not work, my next option is to use the esp8266.

has anyone used cc3000 and get it to work in server mode?
 
Last edited:
You can use the pwm pump to control your LED.

Here's how:
You can define a 6 time intervals where mode will change. The default is

#define INTERVALS {0,6,9,12,18,22}

The value is time of day in hours. midnight, 6am, 9am, noon, 6pm, 10pm for above.

For each of the 4 pumps, you define the pump mode and level.
To control LED, you just need to use H1 mode.
So lets say you want to use channels 2 and 3 for LED. with channel 2 to control main LED and 3 to control moon light.

You can do something like this
#define PUMP2 {{_master,H1,0,0},{_master,H1,0,0},{_master,H1,192,0},{_master,H1,255,0},{_master,H1,255,0},{_master,H1,0,0}}
#define PUMP3 {{_master,H1,5,0},{_master,H1,5,0},{_master,H1,0,0},{_master,H1,0,0},{_master,H1,0,0},{_master,H1,5,0}}

The above will do the following:
for channel 2
midnight - 6am off
6am - 9am ramp from 0 to 75%
9am - noon ramp from 75% to 100%
noon - 6pm 100%
6pm - 10pm ramp down 100% to 0%
10pm - midnight off

for channel 3 moonlight
midnight - 6am 2%
6am - 9am - ramp down from 2% to 0%
9am - noon - off
noon -6pm - off
6pm - 10pm - ramp up from 0% to 2%
10pm - midnight - 2%


FWIW, this is exactly the same way you define a schedule on a Maxspect razor for its 2 channels.
that is awsome, thank you very much. once I get my board made and complete Ill post a pic. I essentially made a PCB that is an arduino shield plug in the arduino and ethernet up load the code and you prety much ready to go. I wish i could write code cause im good at making my own boards
 
I tested the CC3000 wifi on an arduino uno, and all server test programs work.
So I think there is something wrong with teensy version of the library.

I'm beginning to like the ARMv7-M4 chip used on the teensy, but not teensy libraries and the owner. seems a bit too much self promotion. I've examined the teensy libraries, and I don't think they are quite the same level as arduino libraries, granted arduino has a wider user base and software is very mature and stable.
 
I tested the cc3000 on mega, and it does not run stable.

I browsed through the adafruit cc3000 library code, and I see they use pin interrupt, and not sure why they have code that sits on a while loop waiting for the interrupt pin to change state. :headwallblue: It defeats the whole purpose of using interrupt.

on the teensy server code, I can see the spi bus hangs right after the server port is started.

not promising.

ok, I am returning the cc3000 module, and will start working on esp8266 code.
 
Last edited:
Any thoughts on why I can't take pump 2 out of sync mode for the first step using the web interface, I can do sync and anti-sync but when I select master and hit save it doesn't do anything.
 
pump 0 is the main pump of the group. slave operation is always with respect to pump0.
To use say pumps 2 and 3 for LED, you must set them to master so they run on program independently of pump0.

I have to check with 4 pumps to see if there is a bug there preventing pumps 2 and 3 from running as master.
 
d0ughb0y - I see the conveinece of WiFi, but why not keep it Ethernet for now, and once you get everything done to where your happy, start on Wifi? Just a thought.

This is the Ethernet I use on my Arduino Micros.
http://www.robotshop.com/en/w5100-ethernet-network-module.html

It's not the full shield but works just as good.

I might. wired ethernet is defintely more stable, hardware and software. your other suggestion to use raspberry pi is becoming a better option. considering it has a more powerful cpu (compared to teensy) so can do ssl, built in ethernet, and can use most any usb wifi dongle.

I got a refund on one cc3000. The second one is trying to get a 20% restocking fee out of me even though the ebay listing does not state anything about restocking fee.

I have read more on cc3000 from someone developing a library for it and abandoning it. I believe what this person says, as he has no vested interest like adafruit because adafruit is selling the module.
 
Last edited:
pump 0 is the main pump of the group. slave operation is always with respect to pump0.
To use say pumps 2 and 3 for LED, you must set them to master so they run on program independently of pump0.

I have to check with 4 pumps to see if there is a bug there preventing pumps 2 and 3 from running as master.
Ya i do have it set to master in the sketch, it is only pump 2 and only the first interval out of the 6 i have programed here is the code
Code:
//controls 1-2 pwm pumps                        
#define _PWMA //must be defined
//uncomment if you have 3 or 4 pumps
#define _PWMB
#if defined(_PWMB)
#define MAXPWMPUMPS 4
#elif !defined(_PWMB)
#define MAXPWMPUMPS 2
#endif
//change wavemode 6x per day at the following time (hours)
#define MAXINTERVALS 6
#define INTERVALS  {0,10,11,12,21,22}

//below are the settings I use on my pair of wp-25
//I set the default program to run pumps on H1 at 50% speed.
//change the program by specifying the {syncmode,wavemode,level,pulsewidth}
//in that order, 6x per pump. 
//valid level values are from 48-255, pulsewidth from 0-10
//if syncmode is not master, then the rest of the parameters don't need to be specified
#define PUMP0 {{_master,H1,115,0},{_master,W2,153,10},{_master,ELSE,153,10},{_master,W1,191,4},{_master,W3,191,10},{_master,H1,115,0}}
#define PUMP1 {{_sync},{_antisync},{_master,ELSE,153,10},{_antisync},{_antisync},{_sync}}
//#define PUMP0 {{_master,H1,128,0},{_master,H1,128,0},{_master,H1,128,0},{_master,H1,128,0},{_master,H1,128,0},{_master,H1,128,0}}
//#define PUMP1 {{_master,H1,128,0},{_master,H1,128,0},{_master,H1,128,0},{_master,H1,128,0},{_master,H1,128,0},{_master,H1,128,0}}
#define PUMP2 {{_master,H1,0,0},{_master,H1,0,0},{_master,H1,216,0},{_master,H1,216,0},{_master,H1,0,0},{_master,H1,128,0}}
#define PUMP3 {{_master,H1,0,0},{_master,H1,240,0},{_master,H1,240,0},{_master,H1,240,0},{_master,H1,240,0},{_master,H1,0,0}}
also I cant get my time to regester to east coast time, it will only do west coast time, is there something in the code i missed? i have the correct DNS and NTP info
 
Foggman -

To fix Timezone.. in Config.h change the following line.

#define STDTZOFFSET -7 (MST, default is -8)

to

#define STDTZOFFSET -5
 
Any thoughts on why I can't take pump 2 out of sync mode for the first step using the web interface, I can do sync and anti-sync but when I select master and hit save it doesn't do anything.

I have not looked into this yet, but I do remember fixing this problem before. The fix is in index.htm. You can try getting the latest, make sure you gzip it and upload it to the sd card and see if you still see the problem.

Anyone else using 4 pwm pumps not able to set pump2 to master?

I dismantled my test setup so I can't easily test this now.
 
i am using the most recent code but i will reload it to be sure, also is there an easy way to change the name of pump 2 and 3 or are they not able to be changed? Thank You
 
I have a question on the PWM pump settings, is the number of intervals adjustable from 6, I would like to add one or two more, what lines would I need to change other than the intervals them self and the max interval line?
 
Ok so it isn't working how I want it to, i probably missed something. I got the added intervals for pwm pumps, on the sketch, changed the max interval line to 8 and I edited index.htm line 2619 and changed the 6 to 8. On the web interface I can set all the values I want for the intervals, my intervals are 0,9,10,11,12,20,21,22 the idea is that my blue LED turns on at 9am and ramps up to 86% and stayes there till 9pm then ramps down to 0, the whites do the same except start at 10am for ramp up and 8pm ramp down. Any ideas? Thank you
 
The only thing I can add is to make sure the eeprom got initialized after your change, as the config struct will now be bigger with the 2 additional intervals.
 
I got refunded on the two cc3000 wifi module.
I started working on writing a library for esp8266 that is in the same model as the standard Ethernet library. As this will make it almost plug and play (with minimal chnages) to use the library with existing code that uses Ethernet library.

while working on esp8266 library, I found more issues with teensy to make me think the teensy is not all it's cracked up to be. I find the standard code to call Serial.begin from a C++ global object constructor does not work in teensy (it works on arduino). And the owner of teensy blames it on C++ language lol. I also found a few other code not ported correctly from arduino to teensy.

BTW, I also found something interesting with esp8266. It's sdk supports SSL client connection and someone already created a custom firmware that allows ssl client connection to get email that only allows ssl connection like gmail. I think this feature alone has lots of potential.
 
Last edited:
d0ughb0y -

I'm with you on the CC3000. I've been messing with it the past two weeks, and it's a big pain in the butt. I've also given up on my Teensy. The support out there for it is still too young. I will be curious to see what you come up with for the ESP8266. Until then, going to stay with my mini-w5100 ethernet modules.
 
still working on the esp8266 library. its doable, just a bit tricky to get multiple sockets working.

one of my jebao wp25 finally died after 14 months. I was thinking of getting either a propeller or a replacement body but thought I'd just get the rw8. I received it today. The connector is 100% compatible with wp25. The flow is definitely wider, not sure if it is stronger, maybe it is, or maybe it is because it clean and brand new. I am just running one for now.
 
Back
Top