I have a blind uncle for whom we installed electric curtains for Christmas a couple of years ago as he doesn't know when it goes dark. Currently these are on a rather unreliable timer. Even if the timer were reliable, it doesn't account for the changing sunset time or the change from BST to GMT and back. Generally this hasn't been a problem as we visit and reset the timer monthly. But the COVID lockdown restrictions here in the UK have shown the problems in this arrangement.

Having looked at several other options I am considering building a controller using a Raspberry Pi Zero and a relay module. I have two choices for connecting the relay module to the RPI - USB or GPIO. My preference is USB but want to check what is involved in controlling the USB port with Perl. Is USB::LibUSB going to be sufficient to control two relays on a module like this one or are there pitfalls awaiting me with USB?

My plan is that the RPI will get sunset time for each day, open the curtains at 8:30am local time (GMT or BST) and close them at sunset (perhaps with a fixed offest if necessary). I've not used a Raspberry Pi before - any advice or suggestions?


In reply to Controlling USB on Raspberry Pi by Bod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.