Using Netty for building own socket communication for IoT Hub or use MQTT? - mqtt

I am creating an IOT hub with Kotlin/Spring Boot and weighing the options for the TCP socket communication with the devices. At the moment I am planning to use Netty and build the socket communication protocol myself. At the same time I am thinking that I am developing something same as MQTT with MQTT broker already offers.
What I am looking for is some kind of nudge or points why to use MQTT instead of rolling out my own protocol.

Related

Linking cloud based MQTT Broker and local MQTT Broker

I am quite new to MQTT implementations. I am managing to connect popular cloud based MQTT Brokers such thingsboard.io, Azure and AWS to send Sensor information to create dashboards for monitoring devices.
Problem
I have installed a local things-board broker to my local computer. But it is unable to reach other dashboards on the internet. Is it possible? Or is it only accessible within the local network?
It seems your doubt is more related to network connections. An MQTT broker will work in the same way, regardless it is working locally, in a fog server or in a cloud server. Obviously you will have to deal with access means: your clients/devices/applications must access the MQTT broker no matter where it is running. If you are running a local MQTT broker and it does not communicate directly with some cloud server, you can develop a specie of "gateway" only to send these data to the cloud or search for some tool that performs this task for you.
Below, you have some references regarding the working of MQTT and how to use it:
MQTT IoT Protocol complete tutorial - How it works with a demo
Using local MQTT broker for cloud and interprocess communication
MQTT Brokers/Servers and Cloud Hosting Guide
Creating an MQTT Broker With CloudMQTT
How to setup your own MQTT Broker

How to connect an existing MQTT broker with Thingsboard

I have a site using html, php, javascript and css in which I add my data from IOT devices using MQTT broker. Now I want to update it and I want to connect my MQTT broker with Thingsboard MQTT to manage the same data from both platforms. How can I succeed the communication between the two MQTT brokers?
You have to use the "Thingsboard IoT Gateway". In the Gateway you can set your external MQTT Broker and connect it over the Gateway to Thingsboard. I think thats the only solution. Just follow the instructions.

how to connect and subscribe from cumulocity to MQTT broker

I have an external broker us Apache Active MQ-MQTT.
I have a cumulocity IoT platform on the cloud.
I don’t understand how I can connect and subscribe my cumulocity application to broker MQTT.
There is no built in feature that would enable you to connect Cumulocity to an external MQTT broker. You could however create your own microservice that does this for you.

How to let ThingsBoard connect to an independent MQTT broker?

It seems that ThingsBoard implements its own MQTT broker and connector with Netty. We are trying to use an independent MQTT broker, how do we make ThingsBoard connect to that broker with minimum effort?
You should use ThingsBoard IoT Gateway project. It allows to connect to external MQTT broker and acts as an API bridge between your broker and ThingsBoard. For example, you can subscribe to custom topics and extract telemetry values or attribute updates from it. Similar with ThingsBoard RPC calls. Browse the following docs for an example of integration with AWS IoT:
https://thingsboard.io/docs/iot-gateway/integration-with-aws-iot/

using Azure IoT Hub as a MQTT broker

Our Current Deployment:
1) several back-end devices running an MQTT client connect to an opensource MQTT broker (Mosquitto)
2) Mosquitto is running on a Linux VM and acts as a broker and a communication point between back-end & front-end devices.
3) Several front-end devices (Mobile App / browser based GUI) connect to the broker. some of the front-end devices read & write to the broker (Sub & Pub) while some front-end only read (Sub)
4) Some front-end devices connect for a few minutes & some front ends are always connected.
5) Although the amount of data being transferred is a few kb, it is sometimes fast changing.
6) No TLS is used for the MQTT traffic & it cannot be enabled on the back-end devices.
This setup works for us, but I am looking for a way to scale up and was considering the azure IoT hub, but I am confused if the IoT hub can be used as a broker or I would need additional components to be deployed for acting as a MQTT broker ?
Azure IoT Hub is not a generic MQTT Broker. There is a built-in the device communications for MQTT protocol. More details can be found in the Using the MQTT protocol directly
For exploring the MQTT Devices (virtual devices) with the Azure IoT Hub (without the coding) can be used a small tool Azure IoT Hub Tester

Resources