AT&T Smart Cities With M2X & Flow Designer Introduction ............................................................................................................................................................................................. 2 FASTEST Way to Get Started............................................................................................................................................................. 5 Getting Started – use Socket.io ......................................................................................................................................................... 6 Getting Started – Get Data / Polling ............................................................................................................................................... 9 Add a New M2X Device and Create your own Flow ............................................................................................................. 10 Add your own M2X Device into our Smart City Ecosystem.............................................................................................. 14 Testing a Device Trigger to an AT&T Smart City team device......................................................................................... 15 Example Test Application................................................................................................................................................................ 15 For Available Devices please see Devices Page...................................................................................................................... 15 AT&T Developer Forum Thread ................................................................................................................................................... 15 For Assistance Contact...................................................................................................................................................................... 15
15
Embed
AT&T Smart Cities With M2X & Flow Designer...type of node (such as a websocket node, etc.). Alternatively, you can connect directly to M2X using via a Flow Designer M2X node, or by
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
IntroductionWe have seeded our Smart City with various connected devices (people counters, fire hydrants, etc.). You can either use the sensor data from these devices or add your own devices. Traditionally in M2X, you add devices, connect the data streams, set up triggers, and deal mostly with devices using their individual unique device keys. For Smart City, we’ve expanded that model by allowing you to subscribe to data streams based on tags that might encompass multiple devices, even if you don’t know the specific device ids. You can get device data from multiple devices in our Smart City based on tags. Tags can be location based or subject based. If you choose to add your own devices then you decide.
Publish/SubscribeTo make life easier, we built a basic pub/sub architecture using Socket.io and Flow Designer. There is a Smart City node that contains a Socket.io server. You simply connect to this server, emit tags that you wish to subscribe to, and listen for events that come down the pipe. All of the devices we have set up in the model smart city funnel data through a Smart City node which you can connect to using Socket.io: http://run-east.att.io/f3d5e7227fb53/6ec7d0945763/32567042d798e81/in/flow/events If you would like more info about Socket.io, check out http://socket.io. If you don’t want to use Socket.io, that’s ok too. We’ve created a Smart City client node that you can drop into Flow Designer and hook up to any other type of node (such as a websocket node, etc.). Alternatively, you can connect directly to M2X using via a Flow Designer M2X node, or by connecting directly to the M2X APIs. We’re flexible.
The smart city client manages the Socket.io connection for you. Configure it to point to the URL of a smart city node, and enter tags you wish to subscribe to.