Start Presentation on Signal from External Event

  • 2
  • Question
  • Updated 3 years ago
I am interested in creating a presentation that is able to start and stop a slide show or video in response to a message from outside the Rise Vision context.  For example, suppose there is a big red "start" button mounted on the wall beside a signage display.  A patron presses the button and the "idle mode" presentation stops and the "active mode" presentation starts.

I have developed a node.js app that listens to the big red button (or other IOT device) and can either (1) emit messages via socket.io to notify other apps of the button click, or (2) send an HTTP request.  I am interested in using either of these two methods to send a message to Rise Vision to stop one presentation (or widget) and start another.

So my question is about communicating start/stop messages from my node app to RiseVision.  Is it better to (1 - socket.io) Make custom versions of widget_image and widget_video to open a socket and listen for messages, invoking the widget's play() and stop() methods, or (2 -
HTTP/REST) have my node app send HTTP messages to the Rise Vision APIs for Presentation and/or Widget to start/stop the presentations?

Or, is there a better way that I have not thought of?  I am relatively new to Rise Vision APIs and am struggling to understand the developer docs.  This community has been super helpful so far.

Thanks for any hints or ideas!
Photo of Steve Gregory

Steve Gregory, Champion

  • 1,186 Points 1k badge 2x thumb

Posted 3 years ago

  • 2
Photo of HSuarez

HSuarez

  • 11,896 Points 10k badge 2x thumb
Hi Steve,
I am wondering if you are able to build this all within a website page and link to within an iframe via the HTML Widget? For example the physical button is recognized as a button click which prompts the video (embedded within the website page) the play.

Also, are you using Raspberry Pi or Arduino for this?
Photo of Steve Gregory

Steve Gregory, Champion

  • 1,186 Points 1k badge 2x thumb
Hi Alan - Thanks for this tip!  I will continue studying the API docs.
Photo of Steve Gregory

Steve Gregory, Champion

  • 1,186 Points 1k badge 2x thumb
Hi HSuarez - Yes, my current draft works pretty much like that, i.e. a page of HTML + JavaScript inside the HTML widget receives messages through the socket from the node.js server and responds accordingly, but I haven't written any stuff to control a video or slideshow yet.  That's what makes me suppose that I might want to try making a custom version of widget-image and widget-video with the play() and stop() methods tied to socket events.

Also, this 2013 article on Multi-Page Presentations has some quite helpful information, but the links to the "gadget" API regarding play/pause behavior are no longer valid.

It's an Arduino.  :)
Photo of HSuarez

HSuarez

  • 11,896 Points 10k badge 2x thumb
Cool! I still have an Arduino Leonardo from a hackathon a few years ago (the project was called http://beemarker.tumblr.com/). I've like to do something with this merged with digital signage.

How are you learning to combine node.js with Arduino? I can only think of Nodebots http://node-ardx.org/
Photo of Steve Gregory

Steve Gregory, Champion

  • 1,186 Points 1k badge 2x thumb
I love it!  People here are very interested in bees.  I bet it would make a great signage display - e.g. you could have a screen with a "bee happiness indicator", a graphical display plus real time monitoring of temperature and humidity in the garden, greenhouse, or beehive.  I think that would make a fun, engaging display for a garden store or a nature center, and is a perfect project for exploring interactive signage technology.

Yes, that article from node-ardx is pretty much where I started, and it turns out that combining node.js with Arduino is super easy using the johnny-five library.  It comes with drivers for lots of common sensors and actuators (including temp and humidity, I think), so the coding is very simple once it's set up.
Photo of HSuarez

HSuarez

  • 11,896 Points 10k badge 2x thumb
Thanks, I'll take a look at the johnny-five directory.
Photo of Peter Cameron

Peter Cameron, Employee

  • 1,418 Points 1k badge 2x thumb
Hi Steve,

Thanks for your comment! Your idea of using a physical button to start a display is really interesting - we have been looking into using socket.io to allow a user to communicate with a display from their mobile, but hadn't thought of using a physical object adjacent to the screen before.

We are currently in the early stages of experimenting with socket.io, and will definitely share what we find over the coming weeks. It would be great to hear how your project is coming along in terms of what stage you are at with testing your communication with a display.

Thanks again for the post, and we look forward to hear from you.

Peter
Photo of Steve Gregory

Steve Gregory, Champion

  • 1,186 Points 1k badge 2x thumb
Hi Peter - Great!  I'm still experimenting too but have had success so far with this model:

  • A real world event triggers a sensor connected to Arduino
  • Arduino generates a serial message which triggers an event in a node.js program running in a local computer
  • node.js (with socket.io) relays sensor information by emitting a message through the socket
  • A page of HTML/JavaScript, hosted locally by node.js+express, receives sensor info via the socket and responds by doing something with the display.  Right now it just displays a message but ideally I would like to start a slide show or video at this point.
  • In my Rise Vision presentation, I use the HTML widget and the URL of the locally hosted page.  Now I can see the message in real time when the event happens!
So I've got the messaging working in real time between the node.js context and the browser context inside a Rise Vision presentation.
Photo of Steve Gregory

Steve Gregory, Champion

  • 1,186 Points 1k badge 2x thumb
Regarding interactions between socket.io and Rise Vision, I think it would be great if RV widgets could have the capability to respond to socket messages invoking play/pause/stop behavior where appropriate.  Maybe it would be possible for a presentation to send a synchronized "play" message to all the placeholders it contains.  

Feeding back the other direction, it would be great if widgets could send timing info like "play until done" messages back to the presentation manager, as well as "new data available" messages for widgets like RSS, Spreadsheet, and Emergency Alert.  I think these are some applications that people have asked about recently that might be solved with socket.io or similar real time messaging.

I will keep you posted as my project develops.
Photo of Peter Cameron

Peter Cameron, Employee

  • 1,418 Points 1k badge 2x thumb
Hi Steve,

It sounds like you are making great progress! We are working on updating our documentation to address the broken links issue, but in the meantime this article may be of some help regarding the method used to play and stop the widgets when a user navigates to a different 'page' of the display: https://community.risevision.com/rise_vision_inc/topics/building-a-multi-page-presentation

Thanks,

Peter
Photo of Steve Gregory

Steve Gregory, Champion

  • 1,186 Points 1k badge 2x thumb
Thanks - the new article on multi-page presentations describes the model that I had been visualizing for switching between "idle mode" and "active mode" with alternating play and pause actions.  I will study the section "Controlling the Widget Playback" carefully.

I hope to have a neat demo ready pretty soon.