2013年3月13日星期三

Understand MQTT protocol internal (updating...)

   Regarding to MQTT, three most important references are:

  As Linus said, read the fucking source code to learn how it works. In the same way, let's read the fucking protocol specification to learn outline and detail.
  
  We are going to focus on topics below:
  1. What's MQTT?
  2. MQTT Features
  3. MQTT Use Cases
  4. MQTT Principle & Infrastructure
  5. MQTT Protocol Analysis
  6. MQTT Development
  7. MQTT Application Sample

In the following days, i'll expand each topic based on reading spec.

  1. What's MQTT?

  2.            Definition is described in Spec
      "MQ Telemetry Transport(MQTT) is a lightweight broker-based publish/subscribe messaging protocol designed to be open, simple, lightweight and easy to implement."
      
      "These characteristics make it ideal for use in constrained environments, for example, but not limited to:
       * Where the network is expensive, has low bandwidth or is unreliable
       * When run on an embedded device with limited processor or memory resources"


  3. MQTT Features
  4. * Provide network connectivity based on TCP/IP
    * Provide one-to-many message distribution based on publish/subscribe message pattern
    * Minimum overhead & protocol exchanges in transport layer to  reduce traffic
    * Provide three qualities of service for messaging delivery:
      # "At most once"
      # "At least once" 
      # "Exactly once"
    * Provide a complete mechanism for an abnormal disconnection notify

  5. MQTT Use Cases
  6. Application
    * Gaian DB a distributed database
    * Location Aware Messaging for Accessibility, LAMA an IBM Extreme Blue Project
    * Say It, Sign It (SiSi) an IBM Extreme Blue Project

    Home Automation
    * Andy SC's Twittering / Automated House
    * Power monitoring
    * Lighting control
    * Gardening
    * energy monitoring with an old-style analog ammeter
    * Android/TV/Burglar detection system
    * MQTT<>LLAP bridge example for the Ciseco OpenKontrol Gateway
    * WarmDirt project to control soil temperature for plants (like potatoes!)

    University/Research
    * Southampton University LEGO microscope controller
    * Messaging protocol applications research at CEIT, University of Queensland
    * FloodNet Southampton University
    * Smart Lab Southampton University

    Mobile
    * Facebook Messageer

    Technical
    * Filesystem sync
    * Linux desktop notification applet in GNOME 2
    * Ubuntu desktop notification using pynotify
    * OS X desktop notifications using Grow!
    * MQTT and Websocket thermometer

    Just for Fun
    * Christmas lights
    * Mind controlled taxis
    * Glowing rubber ducks

  7. MQTT Principle & Infrastructure
  8. Figure: Publisher-Broker-Subscriber Pattern
    Obviously, MQTT is built on TCP/IP and implement Publisher-Broker-Subscriber pattern. It means one publisher can easily achieve multicast functionality, which can be used in AD publish platform.

    Infrastructure in MQTT has three parts:
    * Broker Server. Basically, its job is to accept subscribers and re-transmit info from publisher to subscribers. In complex system, broker server can do more jobs related to data analysis and mining.

    * Subscriber Client. In most of time, it listens to broker after subscribing and ready for handling incoming message.

    * Publisher Client. In "Internet of Things" system, each device connected has the ability of sensor and can be triggered by events, which produces useful and important information to notify outside.

    If subscriber and publisher are both integrated in an app, then it can work in duplex mode, which can listen to and notify outside.


  9. MQTT Protocol Analysis
  10. ... ...

  11. MQTT Development
  12. ... ...

  13. MQTT Application Sample
  14. ... ...

2013年3月12日星期二

M2M Beginner: MQTT Tutorial

    MQTT is the first M2M protocol when i was involved in the realm of M2M. After consulting many references by Google, it's found that MQTT is reliable and easy to use. Following samples provided by Paho  a simple info publishing system can be finished in a day.
 
   What is MQTT? As official website said:
   "MQTT stands for MQ Telemetry Transport. It is a publish/subscribe, extremely simple and lightweight messaging protocol, designed for constrained devices and low-bandwidth, high-latency or unreliable networks. 

      The design principles are to minimise network bandwidth and device resource requirements whilst also attempting to ensure reliability and some degree of assurance of delivery. 

      These principles also turn out to make the protocol ideal of the emerging “machine-to-machine” (M2M) or “Internet of Things” world of connected devices, and for mobile applications where bandwidth and battery power are at a premium."

   Where is MQTT in use? As official website said:
   "MQTT has been widely implemented across a variety of industries since 1999. A few of the more interesting examples are listed on the projects list."
 
   Here lists useful MQTT reference link:


   In IBM Redbook "Building Smarter Planet Solutions with MQTT and IBM WebSphere MQ Telemetry", it refers to that "Instruments + Interconnection + Intelligent Analysis = Smart Planet". See diagram below:

The Three pillars of the Smarter Planet
   Oh, What a magic smarter planet someday!

   Next, we are going to talk about MQTT application in "Smarter Planet".
   Here are our focuses:

  • Understand MQTT protocol internal
  • Implement specific MQTT client in C/Java/Lua based on Paho
  • Integrate Mosquitto with MQTT Client as "Customized Message Push System"
  • Porting Mosquitto & Paho to specific Embedded ARM-Linux platform
  • Integrate MQTT Client into Windows/iOS/Android/WindowsPhone/Embedded Linux Client
  • Deploy from local service to cloud service

2013年3月11日星期一

M2M Cloud Journey

    Hi, this is M2MCloud, dedicated to M2M & Cloud integration. 
    
    From now on, let's start journey to magic M2M & Cloud world.

    M2M is the abbreviation for "Machine to Machine" technologies, which allow interconnected devices to communicate. See M2M_Wiki in detail.
    
    Let's see diagram below to understand classic M2M application.
Classic M2M Application Diagram
    As you see, devices integrated with basic M2M services (publisher & subscriber) can intercommunicate by networked M2M broker. Each M2M broker can provide specific services for many connected M2M udevs.

    Trend is inexorable for interconnection.

    Besides PC & Mobile, more devices are going to connect to cloud, such as car, robot and sensor with specific functionality. When these machine are integrated with Cloud and AI technology is developing, i believe that the power of machine will be boosted enormously someday.
  
    In the long term, M2M & Cloud technology will reduce the cost and release lots of workers for other meaningful jobs.

    That's why M2MCloud blog starts.