mqtt node-red iot platfform - mqtt

Read an event from a device in Watson IoTPlatform using node-red and occur following error missing broker configuration
Request Data
[{"id":"e045d0f1.7d3b6","type":"mqtt in","z":"128ab415.c6150c","name":"DHT22_001","topic":"iot-2/type/DHT22/id/DTH22001/evt/data/fmt/json","qos":"2","broker":"3a8caa38.c01576","x":162,"y":99,"wires":[["dd729941.33d4e8"]]},{"id":"dd729941.33d4e8","type":"debug","z":"128ab415.c6150c","name":"","active":true,"console":"false","complete":"false","x":421,"y":99,"wires":[]},{"id":"3a8caa38.c01576","type":"mqtt-broker","z":"","broker":"s16hxe.messaging.internetofthings.ibmcloud.com","port":"1883","clientid":"d:s16hxe:DHT22:DHT22_001","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""}]

Related

How to connect to open source emqx broker and build his own broker?

Protocol: mqtt
Version: 3.1.1
Gateway model: CloudGate Ethernet CG0102
I'm publishing json message from my gateway which is connected to an open source Emqx broker (broker.emqx.io) port 1883 for a test. I tried to consume the messages by connecting to it with MQTTX by giving the following informations: Name, Client_ID, Host, Port, Username and Password, and then giving my topic which is my_topic.
The problem is nothing appear in my MQTTX while the given broker informations are good and similar to those in my gateway. Why ?
Also I would like in the future to use my own mqtt broker mounted on my laptop ? Any simple references where I could start to make such thing ? I already use mqtt to consume messages with python from remote broker but never try to build one to receive messages from my remote gateway.
I'm working on a ubuntu bionic VM
Client_ID needs to be unique for every client, so you can not reuse Client_ID between clients.
The MQTT spec says that the broker should kick the oldest client off when a new client connects with the same Client_ID. This normally leads to a fight between the 2 clients as they both try and reconnect kicking each other off.

Mosquitto - subscribe to topics on a local bridge

I'm an MQTT newbie, so maybe this is obivous but I'm not getting it.
I've got IoT devices that publish data to a cloud MQTT broker. I can't change that. I want to be able to get the messages from the cloud broker and pass them to IoT Hub in Azure. Here's what I've done so far:
Configured a VM running CentOS to host my Mosquitto server
Installed Mosquitto and configured as a bridge to IoT Hub (IoTHubBridge)
Created a separate Mosquitto config to bridge to the cloud MQTT broker (CloudBridge)
Note that both Mosquitto bridge instances are running on the same VM.
So far, so good. IoT Hub can receive test messages that pass through IoTHubBridge and CloudBridge receives messages from the cloud broker. Here's where I'm stuck - how do I get messages to pass from CloudBridge to IoTHubBridge?
Thanks!
As hashed out in the comments.
There is no need for 2 MQTT brokers here. You should configure both bridges in a single broker, that way with the right topic declarations for the bridges messages should just flow between the IoT Hub and Cloud brokers.
This does assume that the topic/message structure for the cloud broker is compatible with what you need to send to IoT hub. The bridge will allow you to add/remove a prefix from the topic but not totally remap it. And there is no way to change the payload format.
If you need to make changes to the payload format or major changes to the topic structure then a bridge is not the right solution. You will need to create an application that subscribes to the cloud broker and then republishes the transformed message to the IoT Hub broker. There are many ways to do this in any number of languages but I might suggest you look at something like Node-RED if you are not already comfortable with an existing language/MQTT client combination.

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 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/

Resources