[Oc-pm] FYI : Raspberry Perl :-)

Ramana V Mokkapati mvr707 at gmail.com
Sat Jun 29 11:27:43 PDT 2013


Sharing for your amusement.

As we all know "Pi" part of Raspberry Pi comes from Python as it is deemed
the right language for high school kids can experiment and learn. I have
been using Perl on RPi and it seems to do well with many automations I did.

Sharing a recent example FYI...

---------- Forwarded message ----------
From: Ramana Mokkapati <mvr707 at gmail.com>
Date: Sat, Jun 29, 2013 at 11:13 AM
Subject: Raspberry Perl
To: "Mr. Ramana Mokkapati" <mvr707 at gmail.com>


Just coming back from my dentist visit, reminded of Perl based home
automation. Sharing the story and geeky details. :-)

Dentist told me she forgot to switch of AC at home. I quickly pulled my
iPhone to show how the my living room lights can be switched from cell
phone,
and how my home lights go on at sunset (yes based on season it adjusts
automatically). Needless to say, dentist was impressed and wanted more
details
for her high school kid interested in programming. :-)

Coming to geeky stuff...

One can use a power switch connected to GPIO of Raspberry Pi, or better
still use a WeMo switch from Belkin ($40) that can control upto 1800W of
load. iPhone app would let you control the switch.


Use Perl modules
WebService::Belkin::WeMo::Discover
WebService::Belkin::WeMo::Device

And control the switch - this is a cool way to control UPnP devices via
Net::UPnP module.

Net::Sunrise is another cool module to find the sunrise and sunset times,
once you have the latitude and longitude info. The cron job wakes up at 5am
and calculates the sunrise time and spawns the actual job via "at" command.

Of course, we may use Astro::MoonPhase if you have to fire a job only on
new/full moon night. :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/oc-pm/attachments/20130629/4b595c1d/attachment.html>


More information about the Oc-pm mailing list