Small program to switch lights on and off at sunrise and sunset

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

Reply to
Jan Panteltje
Loading thread data ...

I bid $25 USD ppd for the original of that schematic.

Reply to
Spehro Pefhany

On a sunny day (Fri, 13 May 2011 14:46:34 -0400) it happened Spehro Pefhany wrote in :

Sold

Reply to
Jan Panteltje

Cool. e-mail sent.

Reply to
Spehro Pefhany

I like it. Especially the reference to Netcat. I didn't know anything like that was available.

John

Reply to
John KD5YI

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.

Reply to
Jan Panteltje

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

Reply to
amdx

sunset,

formatting link

worldwide.

Hey, Jan -

I tried to turn off your leds just now. Did it work?

John

Reply to
John KD5YI

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.

Reply to
Jan Panteltje

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

Reply to
Paul Hovnanian P.E.

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.

Reply to
Jan Panteltje

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.

Reply to
John KD5YI

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:

05/16-21:49:44.820844 96.226.149.130:53953 -> 10.0.0.157:1024 UDP TTL:111 TOS:0x0 ID:12609 IpLen:20 DgmLen:42 Len: 14 52 35 30 20 47 35 30 20 42 35 30 20 0D 0A R50 G50 B50 ..

# ip_to_country -i 96.226.149.130 ip=96.226.149.130 (1625462146) "US" "UNITED STATES" # host 96.226.149.130

130.149.226.96.in-addr.arpa domain name pointer pool-96-226-149-130.dllstx.fios.verizon.net.
Reply to
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 :-)

Reply to
Jan Panteltje

days,

You are correct. My mistake.

Reply to
John KD5YI

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....

Reply to
Jan Panteltje

pool-96-226-149-130.dllstx.fios.verizon.net.

Yep! That's me. Now I'll turn them off.

Reply to
John KD5YI

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.

Reply to
Jan Panteltje

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.