mqtt

How to send objects instead of string in mqtt messages?

痴心易碎 提交于 2019-12-11 08:36:36
问题 I'm currently using mqtt to communicate between client and server and mqtt publish method takes message as bytes. I need to send latitude, longitude, address,etc in my single mqtt publish and be able to receive those on server side. How can I achieve it? I'm using wmqtt client library on client side (android) and paho client library on server side (jsp,servlets). deviceloc d=new deviceloc(); d.id="1234"; d.add="hyder"; d.lat=17.5; d.lon=78.5; try { ByteArrayOutputStream b = new

MQTT client in MVC application

早过忘川 提交于 2019-12-11 08:24:49
问题 I'm working on a MVC application that serves as a MQTT client. I'm using the C# library M2Mqtt from paho. Basicly every time someone presses a button on my website, I want a message to be published, and it will recieve an answer aswell (thus it subscribes to a topic aswell.) My question is: do I have to connect to the broker every time again when pressing the button (calling an ActionResult that publishes the message) or is there a way to keep the connection alive (f.e. initializing it in

Swagger like documentation for queueing and messaging like mqtt or sqs [closed]

假装没事ソ 提交于 2019-12-11 08:02:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 months ago . Is there any solution like swagger for documenting queueing and messaging like mqtt or sqs? 回答1: Check out AsyncAPI. GitHub repo: https://github.com/asyncapi/asyncapi AsyncAPI is an open source initiative that seeks to improve the current state of Event-Driven Architectures (EDA). Our long-term goal is to make

How to fix undefined MqttChannelInitializer constructor in HiveMQ Client?

大城市里の小女人 提交于 2019-12-11 07:48:51
问题 I was using HiveMQ Client version 1.0.1 but I decided to update to the recently released version 1.1. I completely started from scratch and imported the project as a Gradle project and tried to build. The build work only after ignoring a few failed tests. I'm getting 3 errors in 3 different classes. I realize this is likely related to the Dagger dependency injection tool and I had already successfully built the project and added the directory of build/generated/source/apt/main/ to my build

Regarding the MQTT fixed header structure?

回眸只為那壹抹淺笑 提交于 2019-12-11 07:44:41
问题 i am trying to implement a MQTT library. And according to a tutorial, the fixed header of the MQTT message should look like as shown in the posted picture. Also in the same tutorial, i found that the encodeing method of the fixed header is written as: mqtt.write((byte) ((retain ? 1 : 0) | qos << 1 | (dup ? 1 : 0) << 3 | type << 4)); My Question is, according to the fixed header specifications posted, the fields retain , qos , dup and the msg type should have 1 , 2 , 1 and 4 bits respectively.

Webpack UglifyJS fall in error for production build because of MQTT.js existance

拜拜、爱过 提交于 2019-12-11 07:33:25
问题 I have a react web app with server side rendering and I separate webpack configuration for development and production environment. For each environment, I set two side configurations, first client and second server . these configs are so complete and work awesome, but I need to have mqtt.js in this project, this library has #!/usr/bin/env node in first of its code sheet and using this library cause to running dev and build script fall in this error: ERROR in ./node_modules/mqtt/mqtt.js Module

TypeError: function takes 2 positional arguments but 3 were given

蓝咒 提交于 2019-12-11 06:28:01
问题 I'm trying to create a seperate class for MQTT subscribe and publish for a LoPy device, written in micropython. This is my code of main.py: import pycom import time import communicationmod pycom.heartbeat(False) if __name__ == '__main__': communication = communicationmod.Com() while True: communication.update() print (communication.getmessage()) time.sleep(1.00) And this is the code of communicationmod.py: import pycom import time from umqtt import MQTTClient import machine import ujson class

Getting AuthenticationException when connect M2Mqtt.MqttClient to Mosquitto broker with TLS

老子叫甜甜 提交于 2019-12-11 06:11:00
问题 I am new with MQTT protocol. When I searched for an MQTT server I found that Mosquitto broker is one of the most used one and therefore I have started using it. I have to develop an MQTT client on C#/.NET and I found only the M2Mqtt project and this C# MQTT client example. I managed to install Mosquitto broker on Windows 10 and change the access control list using topics. Using MqttClient I am able to connect to the broker with an username, subscribe to topics and publish them with the

HTTP API Rest Controller POST `/api/plugins/rpc/oneway/{deviceId}` RPC calls do not reach the gateway

倖福魔咒の 提交于 2019-12-11 06:05:36
问题 Currently, I have Thingsboard and Thingsboard-gateway running together through the token of the gateway device, I can synchronize extensions via Thingsboard UI and generate new devices through the Thingsboard-gateway in Thingsboard. The problem I have is that rpc calls on the server side by HTTP API Rest Controller POST /api/plugins/rpc/oneway/{deviceId} only post the message in the topic v1/devices/me/rpc/request/+ and they do not reach the Thingsboard-gateway topic for rpc calls on the

Qt's qmqtt comiplation issues on Windows 10

Deadly 提交于 2019-12-11 05:33:18
问题 I am trying to develop a simple POC using qmqtt but this module is not available in the Qt lib path. I have the latest Qt version installed, still it's not there. So, I am trying to compile it under Windows using mingw32 and I get undefined references from the qmqtt's source. Qt version:5.11.2 Below is the compilation log: E:\Xavier\qmqtt>mingw32-make cd src\ && ( if not exist Makefile E:\Xavier\Qt\5.11.2\mingw53_32\bin\qmake.exe -o Makefile E:\Xavier\qmqtt\src\src.pro ) && mingw32-make -f