Small program to switch lights on and off at sunrise and sunset
May 13, 2011 17 Replies
J
Jan Panteltje
For my ethernet based LED controller
formatting link
See bottom of that page. I wrote a small program to switch the LED lights on at one hour before sunset, and off again one hour after sunrise. You can enter your location as coordinates, and the color of the lights. Commands are send over UDP, three tries for every change, as UDP packets may get lost.
It can very easily be modified to control other lights via other ways of I/O. Code is C, released under the GPL.
formatting link
It is based on the 'sunrise' program, and needs that installed, sunrise is copyright somebody else, you can find that here:
formatting link
Didn't find your answer? Ask the community — no account required.
S
Spehro Pefhany
I bid $25 USD ppd for the original of that schematic.
J
Jan Panteltje
On a sunny day (Fri, 13 May 2011 14:46:34 -0400) it happened Spehro Pefhany wrote in :
Sold
S
Spehro Pefhany
Cool. e-mail sent.
J
John KD5YI
I like it. Especially the reference to Netcat. I didn't know anything like that was available.
John
J
Jan Panteltje
On a sunny day (Fri, 13 May 2011 17:29:19 -0500) it happened John KD5YI wrote in :
Netcat is one of the coolest programs, I use it all the time for testing, even worldwide.
man netcat does not say very much, but refers to /usr/share/doc/netcat/README.gz gunzip it, absolutely worth reading.
A
amdx
All the criticism about the poor quality of his schematics and he seems to have made this one even worse than the rest.
It is a shame you taint your fine work and interesting projects with such poor documentation. You should be ashamed of yourself! Shame on you, shame, shame, shame!
Jan, how about a mea culpa and I'll find a way to produce schematics that are easily readable on my webpage.
Mikek
J
John KD5YI
sunset,
formatting link
worldwide.
Hey, Jan -
I tried to turn off your leds just now. Did it work?
John
J
Jan Panteltje
On a sunny day (Sun, 15 May 2011 19:04:36 -0500) it happened John KD5YI wrote in :
sunset,
I/O.
formatting link
even worldwide.
You would need to know my IP address for that! Try echo R0 G0 B0 | netcat -u -q 0 86.81.55.74 1024
Replace the '0' zeros by 0-255 for any light color for Red Green and Blue I have opened that port 1024 now just for fun. Anyone can try, I will give feedback, but of course I cannot easily see who does what.
P
Paul Hovnanian P.E.
Looks like a little piece of aluminum foil stuck under the daughter board on the RHS. And its (almost) lying on top of another DIP's pins.
Will that be a silent failure? Or a Phhhhht! complete with magic smoke?
Paul Hovnanian mailto: snipped-for-privacy@Hovnanian.com
------------------------------------------------------------------ When in danger, or in doubt, run in circles, scream and shout.
-- Xavier Onassis, Director of Emergency Preparedness
J
Jan Panteltje
On a sunny day (Mon, 16 May 2011 10:58:26 -0700) it happened "Paul Hovnanian P.E." wrote in :
That is tape, IIRC it prevenst some axial electrolytics from touching the PIC pins in case a heavy shock like a mars landing bends the boards.
I am not Joerg.
J
John KD5YI
sunset,
I/O.
formatting link
even worldwide.
does what.
Your address and port is shown on your Web page.
I just sent R50 G50 B50 to you.
J
Jan Panteltje
On a sunny day (Sun, 15 May 2011 19:04:36 -0500) it happened John KD5YI wrote in :
Dunno if it was you, but it just worked:-) I was fast enough to start the ethernet logging:
130.149.226.96.in-addr.arpa domain name pointer pool-96-226-149-130.dllstx.fios.verizon.net.
J
Jan Panteltje
On a sunny day (Mon, 16 May 2011 14:51:13 -0500) it happened John KD5YI wrote in :
sunset,
I/O.
formatting link
even worldwide.
does what.
No, it says 10.0.0.157 1024 for all I know, link please? I would have to remove it as this IP address will be someone elses in a few days,
And that worked :-)
J
John KD5YI
days,
You are correct. My mistake.
J
Jan Panteltje
On a sunny day (Mon, 16 May 2011 14:51:13 -0500) it happened John KD5YI wrote in :
No, it says 10.0.0.157 1024 for all I know, link please?
PS
10.0.0.xxx is a LAN address. Addresses in that range are not globally accesable, but are forwarded from the main IP by the router via a NAT (Network Address Translation) table.
For example I can set the NAT table in the router to translate incoming UDP packets for port 999 to 1024 10.0.0.157 on the LAN. That is a good protection, as somebody may find the posting later and start to play, Then packets to port 1024 will just get lost (of course I will not use 999, take a guess :-) )
Once could set up a script that sends R0 G0 B0 to all ports in sequence though. But then this IP changes in a few days....
J
John KD5YI
pool-96-226-149-130.dllstx.fios.verizon.net.
Yep! That's me. Now I'll turn them off.
J
Jan Panteltje
On a sunny day (Mon, 16 May 2011 20:11:27 GMT) it happened Jan Panteltje wrote in :
Another project, called IO_pic has a password protection, it will not even respond without having seen the password string. Something on the to do list for the color thing.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.