SMQ is an easy to use machine-to-machine (M2M)/"Internet of Things" connectivity protocol that follows the publish subscribe design pattern.

Dependencies:   EthernetInterface mbed-rtos mbed

Introduction

The SMQ Architecture is an Internet of Things (IoT) publish subscribe end-to-end solution that is optimized for embedded systems to provide instantaneous Device Edge Node connectivity, 1 to 1 Communications, and Ease of Transcending Firewalls. The solution is ideal for resource constrained devices that require real-time dynamic control, analytic information, and firmware updates in both LAN and WAN environments.

Architecture Component List

  • SMQ C Client (Non-secure)
  • SharkMQ (Secure) C Client
  • SMQjs (Javascript)
  • SMQ JAVA
  • SMQ Broker

/media/uploads/wini/smq_architecture.png

SMQ Client-example

A (non-secure) C Client implementation of the SMQ protocol demonstrating device control over the on board LEDs via any modern (WebSocket enabled) Browser interface.

  • Code Size: 3kB

See Also

How to setup your own SMQ IoT cloud server

Most IoT cloud server solutions, whether they provide ready-to-use hosted services or not, are based on a standard Virtual Private Server (VPS). Most developers probably think of Amazon or Microsoft Azure's services when considering the server side of their IoT solution. These high-end services are great if you need to scale up to millions of connected devices. However, for most small-scale operations and DIY projects, a low-cost VPS is more than adequate.

main.cpp

Committer:
wini
Date:
2014-12-03
Revision:
0:bd3aeb15634e
Child:
1:734fa1459f69

File content as of revision 0:bd3aeb15634e:


#include "mbed.h"
#include "ledctrl.h"
#include "EthernetInterface.h"

DigitalOut  led1(LED1);

//PATCH CTX
extern "C" void mainTask(const char* uuid, int uuidLen, const char* devInfo);


static const LedInfo ledInfo[] = {
   {
      "LED 1",
      LedColor_green,
      1
   }
};


extern "C" int
ledState(int ledId, int on, int set)
{
   static int leds[sizeof(ledInfo)/sizeof(ledInfo[1])];
   baAssert(ledId >= 1 && ledId <= sizeof(ledInfo)/sizeof(ledInfo[1]));
   if(set)
      leds[ledId-1] = on;
   return leds[ledId-1];
}


const LedInfo* getLedInfo(int* len)
{
   *len = sizeof(ledInfo) / sizeof(ledInfo[0]);
   return ledInfo;
}

extern "C" const char* getDevName(void)
{
   return "mbed: Arch Pro";
}

extern "C" int setLed(int ledId, int on)
{
   led1 = on;
   ledState(ledId, on, TRUE);
   return 0;
}


extern "C" int setLedFromDevice(int* ledId, int* on)
{
   return FALSE;
}

extern "C" void setProgramStatus(ProgramStatus s)
{
}


int main()
{
   EthernetInterface eth;
   mainTask(eth.getMACAddress(), strlen(eth.getMACAddress()), getDevName());
   error("mainTask returned");
}