dreemgl
Version:
DreemGL is an open-source multi-screen prototyping framework for mediated environments, with a visual editor and shader styling for webGL and DALi runtimes written in JavaScript. As a toolkit for gpu-accelerated multiscreen development, DreemGL includes
1 lines • 5.16 kB
JavaScript
Ext.data.JsonP.iot({"guide":"<h1 id='iot-section-dreemgl-iot-guide'>DreemGL IoT Guide</h1>\n<div class='toc'>\n<p><strong>Contents</strong></p>\n<ul>\n<li>1. <a href='#!/guide/iot-section-homestar-setup'>Homestar Setup</a>\n <ul>\n<li>1.1. <a href='#!/guide/iot-section-install-node-modules'>Install Node Modules</a>\n </li>\n<li>1.2. <a href='#!/guide/iot-section-pair-to-iot-devices'>Pair to IOT devices</a>\n </li>\n</ul></li>\n<li>2. <a href='#!/guide/iot-section-using-iot-in-dreemgl'>Using IoT in DreemGL</a>\n <ul>\n<li>2.1. <a href='#!/guide/iot-section-iot-%22things%22-api'>IoT \"Things\" API</a>\n </li>\n<li>2.2. <a href='#!/guide/iot-section-live-example'>Live example</a>\n </li>\n</ul></li>\n</ul></div>\n\n<p>This document describes how to work with DreemGL's builtin IoT infrastructure.</p>\n\n<h2 id='iot-section-homestar-setup'>Homestar Setup</h2>\n\n<p>DreemGL leverages the <a href=\"https://github.com/dpjanes/iotdb-homestar\">Homestar</a> IOTDB and Open Source IoT Platform to\nimplement a semantic metastandard across all IoT devices. To get started first you'll need to install the Homestar\nbridge and pair it to your IoT devices.</p>\n\n<h3 id='iot-section-install-node-modules'>Install Node Modules</h3>\n\n<p>Be sure to run <code>npm install</code> in the IOT component directory:</p>\n\n<pre><code>cd ./classes/iot\nnpm install\n./node_modules/homestar/bin/homestar setup\n</code></pre>\n\n<p><strong>Windows Notes</strong>:</p>\n\n<ul>\n<li><p> You will need to specify homestar commands like this: <code>node ./node_modules/homestar/bin/homestar setup</code></p></li>\n<li><p>The symbolic link at the top of the dreemgl tree (called .iotdb) must be manually created. From the top of the repository, running as an Administrator:</p>\n\n<p><code>erase .iotdb</code></p>\n\n<p><code>mklink /d .iotdb .\\classes\\iot\\.iotdb</code></p></li>\n</ul>\n\n\n<h3 id='iot-section-pair-to-iot-devices'>Pair to IOT devices</h3>\n\n<p>Dreemgl makes it easy to pair to many different kinds of IOT devices. We've tested pairing to Philips Hue and Samsung Smart Things hubs, but many more should work including https://github.com/dpjanes/homestar-samsung-smart-tv, https://github.com/dpjanes/homestar-wemo and more. See https://homestar.io/about/things for more details on pairing a specific device.</p>\n\n<h4 id='iot-section-philips-hue'>Philips Hue</h4>\n\n<pre><code>./node_modules/homestar/bin/homestar install homestar-hue\n./node_modules/homestar/bin/homestar configure homestar-hue\n</code></pre>\n\n<p>Follow the prompts.\nNote that you may need to wait up to 30 seconds and/or unplug/replug the ethernet port on your Hue bridge followed by a browser refresh before the 'Pair' button appears.\nWhen finished, hit control-c until you've returned to the shell.</p>\n\n<p><strong>Windows Notes</strong>:</p>\n\n<ul>\n<li><p>Some dependencies can fail because of issues with <code>node-gyp</code>.</p>\n\n<ul>\n<li><p>You will need to have .NET Framework 4.5.1 installed (Windows 7)</p></li>\n<li><p>If you have multiple versions of Python installed, you can specify the version to use by:</p></li>\n</ul>\n\n\n<p><code>npm config set python python2.7</code></p>\n\n<ul>\n<li>The Visual Studio C++ compiler is needed. If you have multiple versions installed you can specify the version by:</li>\n</ul>\n\n\n<p><code>npm config set msvs_version 2015 --global</code></p></li>\n</ul>\n\n\n<h4 id='iot-section-smart-things'>Smart Things</h4>\n\n<pre><code>./node_modules/homestar/bin/homestar install homestar-smartthings\n./node_modules/homestar/bin/homestar configure homestar-smartthings\n</code></pre>\n\n<p>Follow the prompts which may be a lengthy process.\nWhen finished, hit control-c until you've returned to the shell.</p>\n\n<h2 id='iot-section-using-iot-in-dreemgl'>Using IoT in DreemGL</h2>\n\n<h3 id='iot-section-iot-%22things%22-api'>IoT \"Things\" API</h3>\n\n<p>The IoT service will continually populate it's <code>things</code> attribute with the current set of active and accessible devices.<br/>\nThis attribute can be watched via rpc wire to update client side UI. For example, the following composition will print\nout the names of all accessible devices:</p>\n\n<pre><code>define.class('$server/composition', function($iot$, iot, $ui$, screen, label) {\n\n this.render = function() {\n return [\n iot(),\n screen({render:function(){\n var things = [];\n var found = this.rpc.iot.things;\n for (var i = 0;i < found.length;i++) {\n var thing = found[i];\n things.push(label({text:thing.name}))\n }\n return things;\n }})\n ]\n }\n\n});\n</code></pre>\n\n<h3 id='iot-section-live-example'>Live example</h3>\n\n<p>Once the setup is complete, start the DreemGl server, and <a href=\"http://localhost:2000/examples/components/iot/\">the following example</a> should show a listing of all connected IOT devices.</p>\n\n<iframe style=\"border:0;width:900px; height:400px\" src=\"/examples/components/iot/\"></iframe>\n\n\n\n","title":"DreemGL IoT Guide"});