Quantcast
Viewing latest article 1
Browse Latest Browse All 9

Connecting to m2m.io

q.m2m.io

The q.m2m.io Broker allows the ability to connect your device and application clients using MQTT; a simple publish/subscribe protocol.  For more information about MQTT please visit http://mqtt.org

The m2m.io broker allows incoming connections to q.m2m.io on port 1883.  (If you’re licensed for SSL, use port 8883).  Any client connected is sandboxed within their “domain” level topic.  Only clients with authorization are allowed to connect to the broker. 

Here are the following steps in order to connect to our MQTT Broker.

Download a compatible 3.1 mqtt client.  We recomment the Eclipse Paho clients for Java or C.  The source can be downloaded from https://github.com/eclipse/paho.mqtt.java or https://github.com/eclipse/paho.mqtt.c

 Authentication

All clients connecting to q.m2m.io require a username and password.  Please request one at http://help.m2m.io

The client’s password must be sent as the md5sum of the password string.

Licenses

Licenses are given on a ‘domain’ level.  Each domain has a limited number of licenses that are auto provisioned to clientID’s that connect.  When a new client connects to our broker the clientID is checked for a license and allocated if needed.  Random clientID’s are not recommended since it will allocate a new license for each randomly created clientID.

Subscribing and Publishing

Subscribing is based on a TOPIC string.  By default your client will have access to public/# and <domain>/#  Any clients my publish and subscribe on public/# and only authorized clients can publish on your <domain>/#

Data is stored in m2m.io if the following 3 level topic is defined.  <domain>/<stuff>/<thing>  where <domain> is your domain, <stuff> is a grouping of things and <thing> is a unique identifier for a device.  Payload data must be in JSON object format to be parsed and saved to the datastore.  Any single or nested JSON object is allowed.  All other topic patterns or payload structure would not be stored but are allowed for pub/sub.  

Payload

This is an example of a valid payload that would be stored in the m2m.io datastore:

{
  "report": {
    "gps": {
      "latitude": "39.702610038220882",
      "longitude": "-104.97231300920248"
    },
    "temp": {
      "celsius": "252",
      "fahrenheit": "76"
    }
  }
}

Viewing latest article 1
Browse Latest Browse All 9

Trending Articles