The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
LCD is functioning and useful, shows 'ATO' when the ATO is running, mode, (currently "Night") and Temp (77.56).
Used some command strips to pin everything down to a board for prototyping. Turns out turning the power supply for the LED's on and off wreaks havoc on my i2c communication. Tossing pauses all over to try to get things straitened out, but using i2c for two devices across 10 threads is getting interesting.
Logging temp every 30 min or so to reefin.net will get a few more items added to logging and get the logging routine straitened out. I think I'll log the status of the system (OK- Night Mode) Fairly frequently (15 min), then have a series of parameters that I only log once a day unless they get out of a 'normal' state (temp/pH/salinity) and then ones that get updated everytime they change (relay status, "System" status).
Added a webserver to the device, currently outputs status type stuff. Not sure which direction I'd like to go- I do know I want history graphs and what not because I'm nerdy like that and I don't want this device to make those/keep the records etc. So pulling that into another webserver is going to have to happen. It's just if I want to have one web site (reefin.net for instance) be a proxy to my device, what it knows/logs on it's own is there + pulls some info in real time... not sure yet. Was a bit reluctant to add a webserver but this one is pretty light weight and ignores most of the complications of handling things it won't have to.
Special Thanks to GREG ZIMMERS for the easy to understand web server example.
I can now send commands to the controller via URL so I can now override my light phase manually, then reset it, and within 60 seconds of resetting it starts fading to the proper light phase for the time of day.
Next? Adding a couple "Modes"- feed mode, water change mode. I'm also getting the ATO re-set-up with a better pump and water storage since I'll be gone for a week.
that's an example of one I might use for a blue channel: fading in starting as early as 5 AM with no significant light output until 7 AM, peaking at just over 2000 out of 4000 right at 1:30 in the afternoon and fading out to darkness at about 6:00 PM.
I have the code running, but not controlling the lights yet. Did add an LCD message telling me it's "Overriding" the lights when override is active, and that works well.
Realized last night laying in bed I approached the fade method poorly. I knew it had work to be done to make it the best it could be but my solving for step size is silly.
What i should be doing?
Solving for delay. I can fade from zero to 100% very quickly, in only very very special circumstances will I need to go faster than 1 unit per millisecond and I can handle those separately. I think I'll re-write my fadeto method to calculate delay and assume 1 unit step size.
I laid awake last night writing the code in my head, so there isn't much besides finding time in the next few days to get it onto a computer left.
[*]Added uptime to the XML status [*]Checking to see if SD Card is present and if so, launching SD thread (not saving anything to it, so the thread start is commented out still but it's the start of an intelligent SD card use, I think..) [*]Added a folder for "ProjectObjects" [*]Added a class: Heater (see details below) [/list]
Heater Class- I've always enjoyed the simplicity of this project's code but it was time to abstract a few things. First and foremost, I will want to be able to control multiple heaters and do some intelligent things (if it's VERY cold, turn them all on, alternate between them all, detect if one is possibly not heating, etc) and in order to do that I need to abstract the heating system a little further than just an output port. The heater class is designed to be consumed by a "heaters" class which can take in N number of heaters, and allows you to tell it to heat the tank, and keeps track of the 'advanced' bits.
A "Heater" consists of:
[*]output port (_relay) to control the heater on/off [*]dateTime (_onTime) to dictate when it was last turned on [*]bool _suspect to note the heater is suspect of being non-functioning [*]timespan totalTime to keep track of the total time this heater has ran [[currently volatile]] [*]bool heating to note if the heater is currently heating [*]one constructor which takes an outputPort and sets the heating status based on what that port is currently doing [*]Heat() which turns the heater on, sets the _onTime and returns [*]TurnOff() which turns off the heater, calculates how long it's been on this run and adds it to the total time and returns [/list]
Not using the Heater class yet, as I haven't the time to write the Heaters class.
Okay Project V2 is under way. I've started the hardware side, and I'm starting pretty fresh code wise, while pulling stuff from the current incarnation to get moving. Biggest steps are more stable hardware setup (IE no solderless breadboards).
The controller V2 is now running my 180 gallon tank:
Codeplex has been updated to reflect the following working in live:
Auto Top Off for Evaporation Control
Temp Sensor (though not currently in active use)
LCD Control using i2c Backpack (though not currently in active use)
I'm changing up how I want to wire for an 8 outlet power control, so that's not in the live build. LCD Support is there but not used, just like Temp.
I've observed much more stable behavior, though nearly everything on this version is soldered/better connected so that may be part of it, or the new firmware is better as this is running the latest while the previous is running slightly older version.
The old setup was on my now QT tank, I have converted it basically to ATO Duties only and will eventually swap it out for a cheaper board and have two boards for development.