ThingsBoard sending particular ack on message receiving - iot

Using Ubuntu 20.04, ThingsBoard CE, v.3.3.2, Thingsboard IoT Gateway version 3.0.1-1.
After receiving the JSON data from the device to the Thingsboard, want to send response back to the device. The particular message is just a hex string ('0x81'). That will confirm that the message has been successfully received. Have read that Thingsboard IoT Gateway REST connector may solve this issue. But could not found how to approach.
note: Have installed TB IoT Gateway and the status is 'running'.

Related

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.

mqtt node-red iot platfform

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":""}]

Thingsboard CoAP Port opening

I am trying to send data from my NodeMCU to my local thingsboard installation on my computer. However, I don't know how to do it. I am really new at these stuff, I saw some fine examples with HTTP and MQTT, but there isn't any info about CoAP on thingsboard website.
There is a documentation about CoAP API Reference that says I need to send a post request to coap://localhost:5683/api/v1/........../telemetry but when i try to do it with Postman it says cant reach the following adress. I tried doing it with http://localhost:5683/api/v1/........../telemetry and it works. I saw my messages in Latest Telemetry Section in my Device on Thingsboard.
To connect to my Thingsboard installation I use localhost:8080 so I assume my thingsboard server is only started at port 8080 not 5683-> Coap. I would very much appreciate the help.
After enabling coap in thingsboard.yml file, you have to restart thingsboard service on your computer, to do that use
"sudo systemctl stop thingsboard" &
"sudo systemctl start thingsboard"

How to send message from mosquitto broker to azure IOT hub

I have installed mosquitto as a local broker. There are multiple devices which sends messages to the broker. I want that whatever message coming to mosquitto broker should be sent to azure IOT hub. Can anyone please refer to any document how to do that.
You have several approaches:
You can use one of the device client SDKs (depending on which
language you are using on your broker) to send data to IoT Hub
You
can use MQTT directly to communicate with IoT Hub, which will require
that you do specific things described in this document
(definitively recommend using the client SDK)

Allow access for MQTT on Ubuntu Server running on Azure

I have a Ubuntu Server 14.04 running on an Azure machine. I have installed MQTT broker on this Ubuntu Server. Moreover, I have multiple ESP8266 devices that are assumed to subscribe and publish to different MQTT topics via this broker. Now my problem is that when I connect two devices to Broker, one for receiving data and other for publishing, they work fine but as I try to connect one more device to broker all devices stop working and my ESPs just display this message "trying to connect Broker" over and over again.
(In endpoints of my machine I've added 1883 for HTTP, 443 for HTTPS and 22 for SSH)
My question is how I can allow multiple devices to communicate with MQTT broker running on Azure broker?
All client devices needs to have unique client ids. The situation you have described sounds exactly like what happens if all your esp8266 devices have the same hardcoded client id
MQTT clients get clientID as parameter before connection to provide uniqueness. ESP8266's has unique ChipID. So use it to hit the issue.
Here the example for Arduino firmware :
WiFiClient wifiClient;
PubSubClient mqttClient(wifiClient);
mqttClient.setServer(MQTT_BROKER, MQTT_BROKER_PORT);
String clientId = "IoTDevice-" + String(ESP.getChipId());
mqttClient.connect(clientId.c_str(), MQTT_USERNAME, MQTT_KEY);
Here is NodeMCU firmware example :
mqtt_cli:connect(MQTT_BROKER, MQTT_BROKER_PORT, 0, CALLBACK_FN);
mqtt_cli = mqtt.Client("IoTDevice-"..node.chipid(), 120, MQTT_USERNAME, MQTT_KEY);

Resources