{"id":88295740,"date":"2020-05-31T23:09:09","date_gmt":"2020-05-31T23:09:09","guid":{"rendered":"http:\/\/www.mikehedman.com\/blog\/?p=88295740"},"modified":"2020-05-31T23:29:21","modified_gmt":"2020-05-31T23:29:21","slug":"moddable-meetings","status":"publish","type":"post","link":"https:\/\/mikehedman.com\/blog\/moddable-meetings\/","title":{"rendered":"Moddable Meetings"},"content":{"rendered":"\n<p>I&#8217;ve been working from home for a number of years, but the Coronavirus lockdown brought me a couple new &#8220;office&#8221; mates &#8211; my family!  But being a remote worker means I&#8217;m in a <strong><em>lot<\/em><\/strong> of video conferences.  With a day or two, it became obvious that we needed a way for the family to know when I&#8217;m on a call, and when&#8217;s a good time to chat.<\/p>\n\n\n\n<p>After a number of (failed) iterations, I settled on using a <a href=\"https:\/\/www.moddable.com\/moddable-two.php\">Moddable Two<\/a> programmable display.  The Moddable Two is a fully programmable (with JavaScript) device, with a color touchscreen, WiFi, Bluetooth, and a bunch of other goodies&#8230;&#8230;.for $25!!!<\/p>\n\n\n\n<p>Here&#8217;s how the final product came out:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/installed-768x1024.png\" alt=\"Display mounted on wall\" class=\"wp-image-88295741\" width=\"434\" height=\"579\" srcset=\"https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/installed-768x1024.png 768w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/installed-225x300.png 225w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/installed-1152x1536.png 1152w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/installed-1536x2048.png 1536w\" sizes=\"auto, (max-width: 434px) 100vw, 434px\" \/><figcaption>Busy Morning<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Software side<\/h3>\n\n\n\n<p>Just want to jump to the code? Github repository is <a href=\"https:\/\/github.com\/mikehedman\/moddable-meetings\">here<\/a>.<br>There are two software projects that make up this system: the display software, and a Chrome Extension to collect the meeting schedule from an MS Outlook web view.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Display<\/h4>\n\n\n\n<p>The display software implements a web server, and uses mDNS to publish a local URL that can be seen by my work computer.  It receives the schedule, and displays the meetings in a scrollable list.<\/p>\n\n\n\n<p>During meetings, the active schedule entry turns red.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/IMG_2789-685x1024.jpg\" alt=\"\" class=\"wp-image-88295749\" width=\"417\" height=\"623\" srcset=\"https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/IMG_2789-685x1024.jpg 685w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/IMG_2789-201x300.jpg 201w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/IMG_2789-768x1148.jpg 768w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/IMG_2789-1028x1536.jpg 1028w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/IMG_2789-1371x2048.jpg 1371w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/IMG_2789-scaled.jpg 1713w\" sizes=\"auto, (max-width: 417px) 100vw, 417px\" \/><\/figure>\n\n\n\n<p>So that family members can let me know if they&#8217;d like to see me, the display has a row of buttons.  Pressing one of the buttons triggers a notification to be displayed on my work computer.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"862\" height=\"274\" src=\"https:\/\/www.mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/notification.png\" alt=\"Computer notification\" class=\"wp-image-88295742\" srcset=\"https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/notification.png 862w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/notification-300x95.png 300w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/notification-768x244.png 768w\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" \/><\/figure>\n\n\n\n<p>The display has an auto-dimmer, that darkens the screen at the end of the workday, but clicking on the face wakes it up for a couple minutes.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Chrome Extension<\/h4>\n\n\n\n<p>The Chrome Extension loads only on a page that&#8217;s displaying an Outlook calendar view, eg: outlook.office.com\/calendar<\/p>\n\n\n\n<p>The Extension scrapes the web page and collects meetings, bundles up start and end times, and sends them off to the Moddable Two device.  These API calls return and pending message notifications (family member pushed one of the device buttons), which the Extension then displays on the work computer.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Hardware<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Moddable Two<\/h4>\n\n\n\n<p>The Moddable Two is a little wonder.  To get an idea of the kinds of things it can do, check out <strong><em>one of<\/em><\/strong> the <a href=\"https:\/\/github.com\/Moddable-OpenSource\/moddable\/blob\/public\/examples\/piu\/readme.md\">example pages<\/a>.  It&#8217;s not without its challenges though. The main difficulty is that while it&#8217;s fully programmable with JavaScript, it&#8217;s NOT browser\/web based.  The display is not implemented with HTML and CSS.  Learning the display framework is a bit of a chore. To make things easier, the folks at Moddable have provided the source code for a ton of examples. My project has nuggets of code (lovingly!) stolen from at least 4 of their sample projects.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Baseplate<\/h4>\n\n\n\n<p>The back of the Moddable Two is basically just a circuit board, so it&#8217;s not something you can just stick to a wall.  And, since this is an ongoing hobby project, I wanted to be able to easily be able to remove it from the mount to deploy\/test new software features.<\/p>\n\n\n\n<p>The answer was a 3D-printed baseplate, that can be semi-permanently attached to the wall, but allows the display to slide in and out.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"607\" src=\"https:\/\/www.mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/baseplate-2-1024x607.png\" alt=\"Printed baseplate.\" class=\"wp-image-88295745\" srcset=\"https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/baseplate-2-1024x607.png 1024w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/baseplate-2-300x178.png 300w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/baseplate-2-768x455.png 768w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/baseplate-2.png 1364w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The printable model, OpenSCAD model file, and addition images are available on <a href=\"https:\/\/www.thingiverse.com\/thing:4414309\">Thingiverse<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Early iterations<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">micro:bit<\/h4>\n\n\n\n<p>The first version of this project used a <a href=\"micro:bit\">micro:bit<\/a>.  During an active meeting<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/microbit-841x1024.png\" alt=\"\" class=\"wp-image-88295746\" width=\"291\" height=\"354\" srcset=\"https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/microbit-841x1024.png 841w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/microbit-247x300.png 247w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/microbit-768x935.png 768w, https:\/\/mikehedman.com\/blog\/wp-content\/uploads\/2020\/05\/microbit.png 1208w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/figure>\n\n\n\n<p>The micro:bit doesn&#8217;t have the networking capabilities of the Moddable Two.  The device used USB for power, and to receive &#8220;on&#8221; and &#8220;off&#8221; messages when meetings begin and end. During meetings, the LEDs would pulse in a starburst pattern.<\/p>\n\n\n\n<p>On the work computer, the schedule was being scraped by a NodeJS app, using Puppeteer to interact with a Chromium window.<\/p>\n\n\n\n<p>Managing the USB connection when the computer went to sleep was a pain. It also meant that the device needed to be directly tethered to the computer.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Adafruit<\/h4>\n\n\n\n<p>The second iteration used the Moddable Two, and used <a href=\"https:\/\/io.adafruit.com\/\">Adafruit IO<\/a> as a data &#8220;middleman&#8221;.  The work computer would send schedule info up to Adafruit, and the Moddable would pull it down.  Message notifications went the other direction.<\/p>\n\n\n\n<p>After reading <a href=\"https:\/\/blog.moddable.com\/blog\/clock-project\/\">this blog post<\/a> by one of the engineers at Moddable, I had the pieces of the puzzle that allowed me to abandon the middleman, and added the webserver to the Moddable device, and used mDNS to make it easily findable.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Scraping<\/h4>\n\n\n\n<p>The web scraping isn&#8217;t the best.  I did go down the path of using Microsoft&#8217;s Graph to access the schedule, but couldn&#8217;t get it to work due to access restrictions on my work&#8217;s server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been working from home for a number of years, but the Coronavirus lockdown brought me a couple new &#8220;office&#8221; mates &#8211; my family! But being a remote worker means I&#8217;m in a lot of video conferences. With a day or two, it became obvious that we needed a way for the family to know [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-88295740","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8kdl1-5YtKQ","_links":{"self":[{"href":"https:\/\/mikehedman.com\/blog\/wp-json\/wp\/v2\/posts\/88295740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikehedman.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mikehedman.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mikehedman.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mikehedman.com\/blog\/wp-json\/wp\/v2\/comments?post=88295740"}],"version-history":[{"count":4,"href":"https:\/\/mikehedman.com\/blog\/wp-json\/wp\/v2\/posts\/88295740\/revisions"}],"predecessor-version":[{"id":88295752,"href":"https:\/\/mikehedman.com\/blog\/wp-json\/wp\/v2\/posts\/88295740\/revisions\/88295752"}],"wp:attachment":[{"href":"https:\/\/mikehedman.com\/blog\/wp-json\/wp\/v2\/media?parent=88295740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikehedman.com\/blog\/wp-json\/wp\/v2\/categories?post=88295740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikehedman.com\/blog\/wp-json\/wp\/v2\/tags?post=88295740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}