Weather Simulation for Dimming expansion module

Share you PDE file with our community

Posts: 293
Joined: Tue Oct 25, 2011 7:39 am
PostPosted: Thu Aug 16, 2012 12:47 pm
Just an FYI for anyone considering this, the sunrise and sunset calculations as well as the time handling parts of my code have been adopted by another user who is putting it on the main (no clouds/weather etc) and its working for them using lat lon pairs from yet another place on the globe.

At this point, I am pretty much willing to say that the code works, period. If its not working for you, you did something wrong. Its actually not super hard to do something wrong as it requires a few things... so please post Q's and we will get you working. If your reading this, you know to beware of setups that are externally being given time settings... I myself was unaware that this could/would be an issue... so my recommendation would be to run this off your dimming module UNPLUGGED from the main (unplug the USB mini from the side) and use the USB/pinout cable plugged into the board to load your configured code, then simply LEAVE it plugged into a power up computer and let it run for a day or two until your sure its working..... and it really should be... if its not triple check your LATITUDE and LONGITUDE. It seems like EVERYONE gets this wrong at least one time. Then run it again and see how its going.

It has been run independently by numerous people, code works, so far NO BUGS have been identified for quite some time.

Posts: 293
Joined: Tue Oct 25, 2011 7:39 am
PostPosted: Sat Sep 01, 2012 6:11 am
Ok.... so following up a post saying no bugs have been detected for some time.. with this..... is pretty funny.



I woke this morning to my tank blinking like a strobe. I reloaded software, still doing it, I reset controller, still doing it, I loaded a very simple PWM PDE that just sets lights to steady intensity- thats it... and at least thats working. But... I have no idea whats up- is there something evil about Sept 1 2012 because I cannot even get serial output from my dimming module when I try to load the weather package... so odd... Its been basically perfect but for one (again very recent- like 2 days ago) issue with very low lights on at night, and now its freaking. OUT>

????????????????????????????????

2-3 months of ZERO issues and suddenly it pukes?????
User avatar
Posts: 5392
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Sep 01, 2012 12:59 pm
When i get some time again Im going to try and compile this in a standalone binary and run it through a loop of date times to see if I can see what's up.

Posts: 293
Joined: Tue Oct 25, 2011 7:39 am
PostPosted: Mon Sep 03, 2012 3:26 pm
that looks to be required at this point. arduino is if nothing else a huge pain in the a.. To troubleshoot. let me know if I can help. I tried to do this once and bailed out as I was in a program with way to many reef angel specific calls but just the date stuff should be revisited. I don't get it at all.... Makes no sense that changing a few 84,600 seconds every day would do anything at all in terms of riseset dying....
User avatar
Posts: 5392
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Tue Sep 04, 2012 1:32 pm
Ok, I did manage to run the algorithms through as a standalone binary and the output worked great. I did find one bug in my code that I'll discuss in the other thread where I'll specify my corrections, but even looking a few years into the future, the dates all look stable with nothing out of whack. There were some variable casting issues that I had to address which may lead to problems on the arduino that may not be checking as strictly, but I doubt that's getting in the way.... the issue that I had was pretty obvious (I hope that you didn't copy some of mine and introduce the same bug... :) )

Anyway, just wanted to assist in your sanity and the fact that the actual calculations look good. The only big difference now is whether or not to leave that rotation code (but I think we talked about it in the other thread, and I'll leave the discussion there.)

Lee

Posts: 293
Joined: Tue Oct 25, 2011 7:39 am
PostPosted: Wed Sep 05, 2012 9:30 am
Ok... awesome. Using your thread for the port to the main I had a question to ensure I understand how that global declaration was FUBAR the calculation. Once I clarify I will post here the fixed code- If you have tried this code and ran into issues I apologize- but thanks to lnevo helping out and taking an interest we appear to have figured out a very strange behavior.. and it would appear to have arisen through a very unlikely seemingly standard call. Watch here for new code to be loaded and PLEASE try it again if you had issues. It may be a few days but I will be working on this now and get something out ASAP.

My bad- but much THANKS to lnevo! This is what makes open source so awesome!!!!!!!! He stepped in with an interest in what I started and used his skill set to really help out! Very very cool. Thanks again and Congrats! Great things are happening on ReefAngel- no way you get this functionality out of other controllers and this much testing!

My fish miss the storms... so I gotta get this fix done!

Also, have some plans to write in an algorithm that enforces a Minimum day length for those of us using local lat lon but that live in regions with substantial yearly variation in rise and set.... cause my tank is starting to notice the shorter days as we have lost over 1 hour of light all ready. This will be invisible to the end user but for the addition (I think... just planning this) of a single variable specifying the minimum desired day length (probably in total seconds). I think I will just distribute the day extension equally so that the tank rises and sets earlier/later by 1/2 of the total difference in actual v.s. minimum day length. Didn't know I would need this, but its becoming apparent that I/we (depending on your Lat/Lon choice) probably do.
User avatar
Posts: 5392
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Wed Sep 05, 2012 9:50 am
rufessor, not sure if the issue I had was the same as what you experienced...unless you copied something from my code. I'll post the explanation on the other thread in a moment what was going on...

Posts: 293
Joined: Tue Oct 25, 2011 7:39 am
PostPosted: Thu Sep 06, 2012 1:17 pm
Negative on that... unsure why my dimming module went whacky.

Re loading current working code to see if it was just a random thing. The error you found was indeed specific to how you had coded in the Lat/Lon conversion and could have produced exactly what you found, because on the second calculation run through you would have basically been using some mythical location with a very very large number... Your fix seems to be working, congrats on figuring that out. I had not gone through it step by step like a processor would so I missed that it would calculate the conversion using the prior result of that calculation. They way I originally coded it does not do that... and thus there is no apparent reason for it to have freaked out.

For those interested, I will update here when I reinstall and see what happens. I guess its just possible that after 2 months continuous running the processor simply finally lost track of memory and I need to do a complete reload of the code, and a good power off (for a minute or something) cycle to truly clear all memory etc. If thats all it takes and I am up and running, then I am just going to chalk this up to random crap, especially now that the Lat Lon code has been validated completely independently of my saying its working just fine.

Sorry for the confusion, I initially had read the error report thinking he had caught something in my code when he ported it, but it was an introduced error and is NOT part of the code attached to this thread. Which is nice- since I thought it was OK.

I guess were back to square one, the code should work for you, post here if its not.

I will reinstall on my own module and get it up and running using the actual code from this thread as a further test since I want to re-load anyhow.
User avatar
Posts: 5392
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Thu Sep 06, 2012 4:44 pm
Why not leave your code and pick a location closer to equator and more conducive to corals rather than mess with your already good functions :)

Posts: 293
Joined: Tue Oct 25, 2011 7:39 am
PostPosted: Sun Sep 16, 2012 8:52 am
I like having real sunrise and sunset but the short winter kinda requires zi think either editing of the choffset array, which is how I am running it now, but it is super easy to justdistributethe minimum day length so I will add it and make it so if you enter a zero it's ignored.

I am tying it on my system but my pmw board clock is now wrong, never has been before so this must have caused it. Gotta figure out how to set it without main working....
PreviousNext

Return to My PDE/INO file

Who is online

Users browsing this forum: No registered users and 1 guest

cron