Page 1 of 1

Moonlights and moonphase don't seem to be working

Posted: Tue Sep 20, 2011 11:04 am
by agentgreen
I reeieved my two moon lights on Saturday and got right to work on getting them on the moon phase code.

Something isn't right.

This morning the moonlights should have been on, and they weren't. I went into the controller screen, and looked under Lights -> PWM (or whatever) and it showed that the Daylight and Actinics were at 100%.


I've attached my PDE and ReefAngel_Features.h files.

Could someone review and make sure I'm on the right path.

Thanks!

Re: Moonlights and moonphase don't seem to be working

Posted: Tue Sep 20, 2011 11:16 am
by rimai
What time was it?

Re: Moonlights and moonphase don't seem to be working

Posted: Tue Sep 20, 2011 11:18 am
by agentgreen
rimai wrote:What time was it?
7:30am or so.

Re: Moonlights and moonphase don't seem to be working

Posted: Tue Sep 20, 2011 11:33 am
by rimai
is the time on RA correct?

Re: Moonlights and moonphase don't seem to be working

Posted: Tue Sep 20, 2011 11:36 am
by agentgreen
rimai wrote:is the time on RA correct?
I'll double check this when I get home, but I'm pretty sure it is.

The moonlights never seemed to work right when using the moonphase() function, not sure why.

When I first got it 'working', the lights didn't come on, and I posted something in your moonphase thread about it. I checked the PWM then, and it was at 0% for both channels. I manually increased it to 100% for both Actinic and Daylight and the lights came on, but then stayed at 100% every night after that.

I made some changes to my PDE and re-uploaded, and now they don't seem to come on at all.

I really feel I'm doing something wrong :)

Re: Moonlights and moonphase don't seem to be working

Posted: Tue Sep 20, 2011 11:39 am
by rimai
Nevermind.
I found the problem
Change this:

Code: Select all

    if (hour()>22 && hour()<9)
To this:

Code: Select all

    if (hour()>22 || hour()<9)

Re: Moonlights and moonphase don't seem to be working

Posted: Tue Sep 20, 2011 11:41 am
by agentgreen
rimai wrote:Nevermind.
I found the problem
Change this:

Code: Select all

    if (hour()>22 && hour()<9)
To this:

Code: Select all

    if (hour()>22 || hour()<9)
Wow....DUH!!!!!!!!!!!!!!!! I shoulda figured that one out, stupid AND OR logic :P

Should I leave the else statement in there to reduce the PWM to 0? Or will it automatically turn off the moonlights outside the time window I specified?


Thanks!!!

Re: Moonlights and moonphase don't seem to be working

Posted: Tue Sep 20, 2011 12:06 pm
by rimai
You need to leave the else statement in there

Re: Moonlights and moonphase don't seem to be working

Posted: Mon Sep 26, 2011 5:18 pm
by agentgreen
If I reupload memory setting to the controller does it wipe out the old memory settings?

When I first got the controller I used ragen to build the memory's settings. I think I have memory settings that might contradict the moonphase stuff.

If I upload a new memory setting file that has less items listed than the original will it wipe out all of the others memory settings?

Thanks.

Re: Moonlights and moonphase don't seem to be working

Posted: Mon Sep 26, 2011 5:56 pm
by binder
agentgreen wrote:If I upload a new memory setting file that has less items listed than the original will it wipe out all of the others memory settings?
If you upload the memory file, only the values being written will be updated. So if your memory file only contains the values for the PWMD & PWMA and the On/Off times for StdLights, then only those will be updated. Nothing else will be touched.

Instead of reuploading the memory file, if you have the Client Suite installed (or my jStatus app but it only works over wifi), I would suggest using that to update the internal memory values instead unless you don't mind uploading the code and then reloading your pde file. It's completely up to you on what you do though. Just thought I'd make a suggestion.

curt

Re: Moonlights and moonphase don't seem to be working

Posted: Tue Sep 27, 2011 1:33 pm
by agentgreen
binder wrote:
agentgreen wrote:If I upload a new memory setting file that has less items listed than the original will it wipe out all of the others memory settings?
If you upload the memory file, only the values being written will be updated. So if your memory file only contains the values for the PWMD & PWMA and the On/Off times for StdLights, then only those will be updated. Nothing else will be touched.

Instead of reuploading the memory file, if you have the Client Suite installed (or my jStatus app but it only works over wifi), I would suggest using that to update the internal memory values instead unless you don't mind uploading the code and then reloading your pde file. It's completely up to you on what you do though. Just thought I'd make a suggestion.

curt

Thanks for this.

Is there anyway to revert the controller back to factory? Now that I'm more knowledgeable, I'd like to start over if possible :)

Re: Moonlights and moonphase don't seem to be working

Posted: Tue Sep 27, 2011 1:58 pm
by rimai
Everytime you upload a new code, the old code gets erased.
Only internal memory is kept.
By uploading a complete memory file, you are basically just starting over. You will be resetting all memory settings.

Re: Moonlights and moonphase don't seem to be working

Posted: Tue Sep 27, 2011 4:20 pm
by alexwbush
I don't even memory pdes. I just put it all into my main pde. Can you forsee any problems with this?

And thanks for posting your pde agentgreen... I pretty much used the moonlight code as my own! :twisted:

Re: Moonlights and moonphase don't seem to be working

Posted: Tue Sep 27, 2011 6:25 pm
by binder
agentgreen wrote: Is there anyway to revert the controller back to factory? Now that I'm more knowledgeable, I'd like to start over if possible :)
For the "fresh start" and the "factory defaults", inside RAGen, switch over to the Internal Memory tab and then goto "Edit -> Reset -> All / Defaults".

Or, you can use this PDE file:

https://github.com/curtbinder/SketchBoo ... Memory.pde


curt