Digital Signage with AT&T M2X and the wot.io Data Service Exchange

Digital Signage with AT&T M2X and the wot.io Data Service Exchange

Nov 2015/ Posted By: wotio team

<p>As with so many industries, the Internet of Things is changing the face of digital signage. With so much real-time, contextual data available, and with the ability to apply custom business logic and analysis in the cloud and send signals back to connected devices for a closed feedback loop, is it any surprise that the retail and advertising markets are taking notice? According to the <a href="http://www.idc.com/getdoc.jsp?containerId=prUS25633215">International Data Corp.</a>:</p>
<blockquote>
<p>Digital signage use in retail outlets will grow from $6.0 billion in 2013 to $27.5 billion in 2018</p>
</blockquote>
<p>Companies are already anticipating this trend. For example, our partners at <a href="http://bb-smartworx.com">B+B Smartworx</a> have designed an entire vertical <a href="http://bb-smartworx.com/simple-iot-technology-for-interactive-digital-signage/">digital signage solution</a> centered around their <a href="http://bb-smartworx.com/product-technology/iot-and-network-edge-platforms/wzzard/">Wzzard Intelligent Edge Node</a> and <a href="http://bb-smartworx.com/product-technology/cellular-routers-and-gateways/spectre/">Spectre Cellular/Internet Gateway</a> devices.</p>
<p>In this post, we use the <a href="http://wot.io">wot.io</a> data service exchange&trade; to combine the device management capabilities of the <a href="(https://m2x.att.com/)">AT&amp;T M2X</a> platform with publicly available NYC subway data and an instance of Elasticsearch to quickly build out an example end-to-end digital signage solution.</p>
<h2 id="aboutthemta">About the MTA</h2>
<p>According to its <a href="http://web.mta.info/mta/network.htm">website</a>, the MTA, or</p>
<blockquote>
<p>Metropolitan Transportation Authority is North America's largest transportation network, serving a population of 15.2 million people in the 5,000-square-mile area fanning out from New York City through Long Island, southeastern New York State, and Connecticut.</p>
</blockquote>
<p>And since</p>
<blockquote>
<p>MTA subways, buses, and railroads provide 2.73 billion trips each year to New Yorkers &ndash; the equivalent of about one in every three users of mass transit in the United States and two-thirds of the nation's rail riders. MTA bridges and tunnels carry more than 285 million vehicles a year &ndash; more than any bridge and tunnel authority in the nation.</p>
</blockquote>
<p>all those eyeballs seemed like a logical opportunity for our imaginary IoT digital signage company.</p>
<h2 id="mtaintegration">MTA integration</h2>
<p>In order for our digital signage company to maximize the revenue opportunity that these subway travelers represent, we realized that it would need to know when a given sign is approaching a given train station. That way, the ads displayed (and the advertising rates we charged!) could be contextualized for attractions at or near each stop in real time. In other words, we wanted to create an advertising-driven business model where we could sell ad-spots on our digital signs just as if they were commercials on television, displaying commercials for companies near specific train stops <em>as the trains approached those stops</em>.</p>
<p>Rather than spec out a costly greenfield hardware solution with additional sensors like GPS to enable the tracking of signs on the trains (especially considering the satellite reception to the subway trains would be far from ideal much of the time), we decided to support a hypothetical existing installed signage base and infer the train position based on the data available through the <a href="http://datamine.mta.info/">MTA Real-Time Data Feeds</a> service. A data service which was also, conveniently enough, already available as a feed on the wot.io data service exchange.</p>
<p>Interested readers may want to peruse the <a href="http://datamine.mta.info/sites/all/files/pdfs/GTFS-Realtime-NYC-Subway%20version%201%20dated%207%20Sep.pdf">GTFS-realtime Reference for the New York City Subway</a> for all the gory details, but we're sure that since you're reading this blog you have already realized that composing a solution out of existing data service integrations is much better than writing each of them yourself from scratch!</p>
<p>(Of course, combining web-based data feeds like the MTA and combining them with IoT device data is nothing new to wot.io. For another example in the Smart City space, see how we combined traffic disruption, traffic sign, and traffic signal data from <a href="http://data.london.gov.uk/">London Datastore</a> with <a href="http://www.thingworx.com">ThingWorx</a>, <a href="https://mbed.org/technology/device-server/">ARM mbed Device Server</a>, <a href="https://www.elastic.co/">Elasticsearch</a>, and several ARM-based devices from <a href="http://www.u-blox.com">u-blox</a>, <a href="http://www.nxp.com">NXP</a>, and <a href="http://www.multitech.com">Multitech</a> at <a href="/wot-io-with-arm-at-mwc-2015/">Mobile World Congress 2015</a>.)</p>
<h2 id="aboutattm2x">About AT&amp;T M2X</h2>
<p>Now that we decided that we would be modeling our digital signs as a virtual combination of web-based data and actual device connectivity, we needed to select a device management platform to provision and manage the digital signs themselves.</p>
<p><a href="https://m2x.att.com/">AT&amp;T's M2X</a> platform provides time-series data storage, device management, message brokering, event triggering, alarming, and data visualization for industrial Internet of Things (IoT) products and services. As such, it seemed like a good fit to function as either a device management platform (DMP) or data service provider (DSP), to use wot.io terminology. Throughout the balance of this post, we will show how we used it as both.</p>
<h2 id="aboutthewotioattm2xadapter">About the wot.io AT&amp;T M2X adapter</h2>
<p>wot.io's ability to integrate to multiple device management platforms is certainly no surprise to readers of this blog. For example, we have recently seen posts using <a href="/arm-techcon-preview-arm-based-devices-and-pubnub">ARM mbed Device Server</a>, <a href="/ship-iot-with-onempower-beagleboard-texas-instruments">oneMPOWER</a>, <a href="/wot-io-thingworx-extension">ThingWorx</a>, <a href="/ship-iot-with-beaglebone-black-ti-sensortags-and-devicehive">DeviceHive</a>, <a href="/ship-iot-with-kinoma-create-and-pubnub">PubNub</a>, <a href="/firebase">Firebase</a>, and even <a href="/shipiot-with-atmel-samd21-xplained-pro-winc1500-wifi-and-io1-sensors">bip.io</a>, just to name a few!</p>
<p>In a similar vein, we created an <a href="https://github.com/WoTio/opifex.m2x">adapter</a> to integrate M2X with wot.io. In order to streamline the process of getting connected to M2X, we also made it available through the <a href="https://m2x.att.com/developer/client-libraries">M2X developer website</a>.</p>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/Screen-Shot-2015-11-19-at-1-56-26-PM.png" alt="" /></p>
<p>This means that we can connect and manage devices using AT&amp;T's M2X platform and can allow them to communicate with other data services using the wot.io data service exchange--exactly the combination that we were after to allow us to model our digital signs as hybrid, or virtual devices that combine physical device data with other data feeds like the one from the MTA.</p>
<h2 id="technicaloverview">Technical Overview</h2>
<p>With the major building blocks for our digital signage solution thus identified, we were able to sketch out an overview of the system architecture:</p>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/m2xdemo-1.png" alt="" /></p>
<p>We decided to configure the GTFS adapter to fetch MTA data every 30 seconds using a scheduler. We would also provision a logical resource for each sign device to represent the current advertising lineup for that sign.</p>
<p>We were pleased to note that by modeling the data as virtual resources in the wot.io operating environment, we would be able to easily route data for specific devices or groups of devices to specific data services. For example, calculating advertising rates for different signs could be as simple as routing them to different "versions" of a data service implementing the pricing logic. In other words, the complex problem of dynamically changing the advertising lineups based on MTA updates occurring at different frequencies had been reduced to a series of simple routes and transformations of data streams within the wot.io operating environment.</p>
<p>While we were thinking along these lines, it occurred to us that we'd probably also want to be able to track and report on the number of times each ad spot was displayed and which sign on which train and at which location etc. It was easy to simply route all the same device notifications to be indexed in an instance of <a href="http://www.elastic.co">Elasticsearch</a>. We also needed a datastore to house our advertising lineups for each sign as they were sold, so we opted for the [No-SQL])<a href="https://en.wikipedia.org/wiki/NoSQL">https://en.wikipedia.org/wiki/NoSQL</a>) key-value store <a href="http://basho.com/products/">Riak</a> from <a href="http://basho.com/products/">Basho</a>. And we did all this without breaking or even affecting the rest of the solution.</p>
<p>Such is the power of the wot.io data modeling and routing facilities: it enables solution providers to <a href="https://en.wikipedia.org/wiki/Loose_coupling">decouple</a> the logical model of the data, <em>and the services operating on various subsets of that data</em>, from the implementation of the data services themselves. Nice.</p>
<h2 id="digitalsignprovisioningapplication">Digital sign provisioning application</h2>
<p>For the purpose of our simple example, a pair of web applications have been created to illustrate how custom applications can be created around device provisioning and signage data visualization. In a real scenario, we'd probably leverage another wot.io data service like <a href="http://www.thingworx.com">ThingWorx</a> or <a href="http://www.jboss.org">JBOSS</a> to build out our user interfaces. Or for that matter, we might want to use something like the <a href="https://github.com/attm2x/m2x-ios">iOS</a> or <a href="https://github.com/attm2x/m2x-android">Android</a> libraries to build a mobile app, for example.</p>
<p>The example train provisioning application uses a Web Socket connection to the wot.io operating environment to listen for and display the trains currently in service based on the MTA data feed.</p>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/image2015-5-12-14-32-26-1.png" alt="" /></p>
<p>Using an interface like this one, an operator from our digital signage company could provision which of our signs (if any) reside on a given train</p>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/image2015-5-12-14-39-1.png" alt="" /><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/image2015-5-12-14-42-32.png" alt="" /></p>
<p>resulting in the following display:</p>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/image2015-5-12-14-43-12.png" alt="" /></p>
<p>indicating in this case that a sign with a device ID of <code>1464a49ea6f1862bf6558fdad3ca73ce</code> is located on train <code>$4 1337+ UTI/WDL</code>. In order to accomplish this feat, the train provisioning application sent a message back to the wot.io operating environment over a Web Socket connection to request a train sign device be provisioned to the given train. A quick review of our architecture diagram above will show that in turn, that message was used to register the sign as a device in M2X.</p>
<p>Additionally, now that the device has been provisioned in M2X, any advertising lineups for this train and its next stop can be looked up in Riak. For example, in the following screenshot you can see that there are lineups provisioned for two signs on the <code>01 1450 SFY/242</code> train, and for one sign on the <code>01 1454 242/SFY</code> train.</p>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/image2015-5-12-14-57-50.png" alt="" /></p>
<h2 id="m2xasadevicemanagementplatform">M2X as a device management platform</h2>
<p>Recall that we said that our train provisioning application sent a message requesting that we register a sign as a device in M2X. You can see from the following screenshot that a sign device was, indeed, registered successfully (the device ID we used in M2X is a composition of the train id and sign id)</p>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/image2015-5-12-14-51-39-1.png" alt="" /></p>
<p>Now, as new messages with updated advertising lineups are determined by the <code>Request Signage Data</code> adapter and sent from the wot.io operating environment, we can see that they are, indeed, being received in the M2X interface for this sign:</p>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/image2015-5-12-15-4-25.png" alt="" /></p>
<h2 id="displayingthedynamicadsonourdigitalsigns">Displaying the dynamic ads on our digital signs</h2>
<p>In lieu of actual digital signs, we created a simple simulator application to demonstrate how the the advertising lineup from a sign on a given train changes as it approaches each station. Once again, the application leverages wot.io's Web Socket protocol adapter for near real-time notifications to keep the application's lineup synchronized just like a digital could.</p>
<p>For example, we can see that the lineup of ads that have been sold for the first sign on train <code>#01 1454 242/SFY</code> is one list while stopped at station <code>#106S</code></p>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/image2015-5-12-14-58-30.png" alt="" /></p>
<p>but changes once the train leaves the station and is approaching station <code>#107S</code></p>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/image2015-5-12-14-59-0.png" alt="" /></p>
<h2 id="m2xasadataserviceprovider">M2X as a data service provider</h2>
<p>Besides the obvious utility for managing and provisioning devices, as described above, the M2X platform can also be used as powerful data service.</p>
<p>For example, we could create dashboards for a simple overview of the advertising statistics for a given digital sign device</p>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/image2015-5-12-15-8-21.png" alt="" /></p>
<p>or we could display the number of ad impressions delivered, or number of distinct advertisers represented in a time-series graph</p>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/image2015-5-12-15-10-42.png" alt="" /></p>
<p>Of course, we have only scratched the surface in our simple example. There are <a href="https://m2x.att.com/about">many more features</a> of the M2X platform. And they become even more powerful when combined with the wot.io data service exchange&trade;.</p>
<h2 id="riakandelasticsearch">Riak and Elasticsearch</h2>
<p><img src="http://idfiles.leveelabs.com/55bd0288af0b0930ba599bd0c4b7ca38/resources/img_new/labs_wot_io/image2015-5-12-15-38-36.png" alt="" /></p>
<p>We have discussed Riak and Elasticsearch in <a href="/riak-and-wotio/">previous</a> <a href="/wot-io-with-arm-at-mwc-2015">posts</a>, so you can read more there to see details and other applications of those data services.</p>
<h2 id="flexibilityandfutureproofing">Flexibility and Future-proofing</h2>
<p>This prototype of a dynamic signage system demonstrates how a complex solution for a real, Industrial IoT vertical can be composed from a relatively small number of existing data services and declarative routing logic in the wot.io operating environment. This approach shows the flexibility and choice of working with an exchange containing multiple data services. You add components as you need them based on their fit and functionality.</p>
<p>And new components can be added in the future with only the work needed to add the new service. Get a new source for ad inventory? Add the API or data service as a provider with an adapter. Want to manage how much inventory comes from different providers? Add a data service that allows you to control the flow of ads based on the rules you set.</p>
<p>The wot.io data service exchange gives you choice during your initial design and provides flexibility going forward allowing you to continue to get the most from your initial investment and still add new products down the road.</p>