This is the slides ProcessOne IoT Studio session #1.
At the core of the discussion is an introduction to Internet of Things protocols.
Here are the topics / questions that I have been addressing:
- What are the main classes of protocols for the Internet of Things ?
- What are the strengths of XMPP for the Internet of things ?
- What are the main XMPP Extensions for building the Internet of Things ?
- How can I leverage XMPP to build a real device / appliance ?
As such, the session ends with a hands-on demonstration of a Soundcloud connected Jukebox built with:
- Raspberry Pi 2
- Connected to ejabberd
- Client is developed in Go using Go XMPP library Gox
Video of the session is available on Youtube: https://www.youtube.com/watch?v=YtommTbCxCc
2. Questions
Connected Things
• What are the main classes of protocols for the Internet of Things ?
• What are the strengths of XMPP for the Internet of things ?
• What are the main XMPP Extensions for building the Internet of Things ?
• How can I leverage XMPP to build a real device / appliance ?
=> Tutorial / Demo
3. What are the Main Classes of Protocols for the Internet of
Things ?
• There are numerous protocols for the Internet of Things.
• They act at different levels and fill different needs.
• We can split IoT protocols into two classes:
• Infrastructure protocols
• Messaging protocols
4. IoT Infrastructure Protocols
• Infrastructure protocols focus on low level communications.
• Long range / Low power:
• Sigfox (Proprietary)
• LoRA
• LTE-M
• Wi-Fi HaLow
• Weightless, On-Ramp, …
• Short range communication:
• ZigBee
• NFC
• Bluetooth
• Wifi
• ...
5. IoT Messaging Protocols
• Messaging protocols are higher level and can be transported on various lower level
protocols.
• Most typical uses cases are:
• Sensors / metrics reporting (upstream)
• Control: Control device parameters and behaviours (downstream)
• Examples:
• MQTT for example over TCP/IP or MQTT-SN variant over UDP
• XMPP
• STOMP
• Statsd
• Riemann protocol
• ...
6. IoT Messaging Protocols
• An IoT Messaging platform typical speak several protocols.
• The underlying semantic is the same: Broadcast, control, reporting, …
• The platform act as a bridge.
• Over time, we are seeing a shift from lower level messaging protocols to higher
level protocols, as things are spreading and get more and more powerful.
• For example:
• Raspberry Pi Zero is demonstrating how a whole Linux computer is now going
down the stack to power smaller and smaller devices.
7. What are the Strengths of XMPP for the Internet of things ?
• XMPP is very good as a hub / platform for things. It can support both sensor reading /
reporting and access.
• However, its main strengths are very unique in the IoT protocol landscape. XMPP
natively and easily supports:
• Identity: Ability to manage things identity thanks to Jabber ID (global / universal
identity).
• Federation: Things from different manufacturer, plugged on different platform can
interoperate.
• Delegation: Ability to trust user ID on the network and this thus simplify provisioning /
delegation of rights to interact with devices.
8. What are the main XMPP Extensions for Building the
Internet of Things ?
• XMPP core contains features that play well with IoT:
• SASL Authentication
• Federation
• Encryption
• Synchronous (iq) and asynchronous messaging support (message / presence)
• Offline message store / delayed delivery
• ...
• Additionally, many general purpose extensions are very relevant to the IoT topic:
• XEP-0060: Pubsub
• XEP-0178: Best Practices for Use of SASL EXTERNAL with Certificates
• XEP-0050: Ad-Hoc Commands
• XEP-0004 and others: Data forms
• XEP-0115: Entity capabilities
• XEP-0184: Message delivery receipts
• XEP-0280: Message carbons
• ...
9. What are the main XMPP Extensions for Building the
Internet of Things ?
• An XMPP IoT Initiative is working on extending the protocol for the purpose of the Internet of Things.
• Some XMPP Extensions have been designed with the Internet of Things in mind, with the purpose of
supporting sensors or controllers:
• XEP-0322: Efficient XML Interchange (EXI) Format
• XEP-0323: Internet of Things - Sensor Data
• XEP-0324: Internet of Things - Provisioning
• XEP-0325: Internet of Things - Control
• XEP-0326: Internet of Things - Concentrators
• XEP-0347: Internet of Things - Discovery
• ejabberd also brings some important features to the table by supporting important feature to handle a
large number of devices:
• Clustering
• Massive scalability
10. How can I leverage XMPP to Build a real device /
appliance ?
• I have prepared a demo showing how to plug various things together.
• I will demonstrate building a Jukebox to play songs from SoundCloud by simply sending
control instruction to a Raspberry Pi 2 base device.
• I will use the following technologies:
• XMPP protocol.
• ejabberd as messaging platform.
• Go programming language with my Go XMPP Library (Gox) to write the Jukebox
software.
• Raspberry Pi 2 hardware running with our own custom minimal Linux image, with a
speaker connected to the analog sound output.
12. Client Control Operation
• Client can be a simple chat bot:
• It will play a URL when receiving it in chat message:
<message type="chat" to="test@localhost" id="aac9a">
<body>https://soundcloud.com/radiohead/spectre</body>
</message>
• It will stop the stream when receive the command “stop” in chat message:
<message type="chat" to="test@localhost" id="aacaa">
<body>stop</body>
</message>
13. Implementing IoT XMPP Control
• Our XMPP Jukebox is also able to play using IOT control operations as defined in XEP-0325:
<iq type='set'
to='test@localhost/jukebox'
id='2'>
<set xmlns='urn:xmpp:iot:control' xml:lang='en'>
<string name='action' value='play'/>
<string name='url' value='https://soundcloud.com/radiohead/spectre'/>
</set>
</iq>