Coder Social home page Coder Social logo

cmqtt's Introduction

CMQTT

NuGet

CMQTT - MQTT Broker and Client for Crestron S#Pro framework

This repository is port of GnatMQ for Crestron S#Pro framework

Description

A broker (server) for the MQTT protocol, an M2M Internet-of-Things communication protocol based on .Net Framework.

MQTT, short for Message Queue Telemetry Transport, is a light weight messaging protocol that enables embedded devices with limited resources to perform asynchronous communication on a constrained network.

Developed by IBM and Eurotech, the MQTT protocol is released as an open standard and being standardized by OASIS (Organization for the Advancement of Structured Information Standard), a non-profit consortium that drives the development, convergence and adoption of open standards for the global information society.

In general, the MQTT environment consists of multiple clients and a server, called broker.

This project is created to develop an MQTT broker. While there are other MQTT broker project, this project is created to provide additional resources to learn and engage in developing useful resources for the MQTT protocol, in conjunction with the M2Mqtt project, a .NET client library for MQTT that supports .NET Framework, .NET Compact Framework and .NET Micro Framework.

How to use:

nuget install CMQTT -OutputDirectory .\packages

Starting the server is simple:

using CMQTT;
namespace Server
{
    public class ControlSystem : CrestronControlSystem
    {
        MqttBroker broker;
        ...
        public override void InitializeSystem()
        {
            // create and start broker
            broker = new MqttBroker();
            broker.Start();
            //Once the broker is started, you applciaiton is free to do whatever it wants. 
        }
        ...
        void ControlSystem_ControllerProgramEventHandler(eProgramStatusEventType programStatusEventType)
        {
            switch (programStatusEventType)
            {
                case (eProgramStatusEventType.Stopping):
                    broker.Stop();
                    break;
            }

        }
        ...
    }
}

Please refer to the Server project for the full example with local client running in the same program

Supported Platforms:

  • Crestron 3-series controllers (see warning below)
  • Crestron 4-series controllers

3-series compatibility warning

While it compiles with VS2008 for 3-series controllers further tests showed that it takes almost 100% CPU on AV3 with a small number of clients connected. It gets especially worse (stack overflow with consequent reboot) if you try to run a local client in a separate program, so far we were not able to resolve the issue and advice against using this code in production

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.