<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div>So I've been hacking away at this, and it's gotten up to escaping onto github.<br><br><a href="https://github.com/frezik/Device-WebIO">https://github.com/frezik/Device-WebIO</a><br>
<br></div>This implements an interface that gives devices the same external API.  You register objects that implement one or more of the Device::WebIO::Device::* roles:<br><br></div>$webio->register( 'rpi', $rpi );<br>
</div>$webio->register( 'pcduino', $pcduino );<br><br></div>And then call pin functions using the names given above and their pins:<br><br></div>$webio->set_as_input( 'rpi', 0 );<br></div>$webio->set_as_output( 'rpi', 1 );<br>
</div>my $pin_0 = $webio->digital_input( 'rpi', 0 );<br></div>$webio->digital_output( 'rpi', 1, $pin_0 );<br><br></div>Roles for GPIO, ADC, and PWM are mostly set.  On the TODO list are I2C, SPI, 1-Wire, Serial, and Video streams.  Also to be done are implementing specific sensors for temperature, pressure, etc.<br>
<br></div>There's also a start on the WebIOPi REST interface:<br><br><a href="https://github.com/frezik/Device-WebIO-Dancer">https://github.com/frezik/Device-WebIO-Dancer</a><br><br></div>This implements most of the GPIO interface:<br>
<br>POST /devices/rpi/0/function/IN<br></div>GET /devices/rpi/0/value<br><br><br></div><br></div>Thanks,<br>Timm<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 22, 2014 at 8:34 AM, Timm Murray <span dir="ltr"><<a href="mailto:tmurray@wumpus-cave.net" target="_blank">tmurray@wumpus-cave.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>So I was thinking about doing a garage door opener with Raspberry Pi, and in Adafruit's tutorial, there was a link to WebIO:<br>
<br><a href="https://code.google.com/p/webiopi/" target="_blank">https://code.google.com/p/webiopi/</a><br>
<br></div>This provides a framework with a REST API for controlling the Pi's control pins from a browser.  It's written in Python, and the REST API is documented in the tutorial sections for the devices:<br><br><a href="https://code.google.com/p/webiopi/wiki/Tutorial_Devices" target="_blank">https://code.google.com/p/webiopi/wiki/Tutorial_Devices</a><br>

<br></div>I'd like to see a Perl equivalent with some improvements:<br><br></div>* Written with Mojo or Dancer (I'm partial to Mojo, but not strongly), plus Moose (Moo? Mo?)<br></div>* Supports cameras with an HTML5 video stream<br>

</div>* Plugable backends to support the Rpi, pcDuino, or any of the dozens of other single board computers that are coming out<br><br></div>It'll be a fair-sized project.  Is anybody else interested in working on this?<br>

<br>Thanks,<br>Timm<br></div>
</blockquote></div><br></div>