Moonlights and moonphase don't seem to be working

Do you have a question on how to do something.
Ask in here.
Post Reply
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Moonlights and moonphase don't seem to be working

Post 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!
Attachments
ReefAngel_Features.h
(14.61 KiB) Downloaded 465 times
RA_090911_0748.pde
(3.08 KiB) Downloaded 458 times
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post by rimai »

What time was it?
Roberto.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

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

Post by agentgreen »

rimai wrote:What time was it?
7:30am or so.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post by rimai »

is the time on RA correct?
Roberto.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

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

Post 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 :)
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post 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)
Roberto.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

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

Post 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!!!
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post by rimai »

You need to leave the else statement in there
Roberto.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

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

Post 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.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

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

Post 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
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

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

Post 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 :)
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post 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.
Roberto.
alexwbush
Posts: 327
Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA

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

Post 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:
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

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

Post 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
Post Reply