mqtt

Publishing commands to device in IBM IoT using MQTT in Java

你说的曾经没有我的故事 提交于 2019-12-11 02:15:10
问题 I am currently trying to publish a command to a specific topic in the IBM IoT Foundation MQTT Broker using a Java web application. My application is already able to listen to device events and act on them, however publishing commands to the device is a problem. I know for sure that my device is listening to the proper topic for commands, so what could be the problem? More specifically, here is the command I call to publish to the topic (from my Java app): publish("iot-2/cmd/" + MQTTUtil

MQTT Web Toolkit - MQTT 在线客户端及服务器测试

爱⌒轻易说出口 提交于 2019-12-11 02:09:40
MQTT Web Toolkit 是 EMQ 最近开源的一款 MQTT (WebSocket) 测试工具,支持线上 (tools.emqx.io) 访问使用。该工具采用了聊天界面形式,简化了页面操作逻辑,方便用户快速测试验证MQTT应用场景。 功能简介 支持通过普通或者加密的 WebSocket 端口连接至 MQTT 消息服务器; 链接的新建、编辑、删除以及缓存链接方便下次访问使用; 不同链接的订阅列表管理; 消息发布、接收、以及接收到新消息时提示,同时也支持按照消息类型过滤消息列表。 使用指南 创建/删除链接 使用浏览器打开地址 tools.emqx.io,点击左下角的 New Connection 按钮,在弹出框里输入链接信息创建链接。 鼠标 Hover 到左侧链接列表里的某一项时,会显示删除图标,点击该图标可删除该链接。 订阅管理 链接创建成功后,点击右上角的 Connect 按钮连接至 MQTT 服务器。连接成功后点击左上角的 New Sub 按钮弹出订阅列表框,在该页面可进行新建/取消订阅操作。 消息发布/接收 点击页面右侧底部的输入框,可弹出消息发布框,填写好 Topic 及 Payload 字段后点击右下角的发布图标可发布消息,发布成功后的消息将会显示在消息列表的右侧。 订阅主题所收到的消息将会显示在消息列表的左侧

mqtt async wait for messagse then respond to http post request

孤街浪徒 提交于 2019-12-11 00:23:42
问题 I am new to node.js am trying to make a webhook, where I get an HTTP post request and want to send a request over mqtt and wait for mqtt messages in reference to the MQTT message and then send these messages a response over HTTP var array = []; const client = mqtt.connect(MQTTServer) var count =0; client.on('message', (topic, message) => { array[count] = message count ++ } app.post('/tesr', function (request, response) { client.publish ('outTopic' , 'request '); client.subscribe('inTopic') /

How to build a system to handle MQTT broker and Django

穿精又带淫゛_ 提交于 2019-12-10 23:44:02
问题 I am planning to build a home automation system where IoT devices communicate with the MQTT broker.The system also involves a Django web server that serves API for ios/android devices. I will describe an example of what I want to implement. An API call is made from mobile app to Django server to turn ON a device. When such API request is made to Django, it should push 'Turn ON' data to IoT device via MQTT protocol. Also, IoT devices send some real time data to the MQTT broker. Upon receiving

MQTT上报电压值

不想你离开。 提交于 2019-12-10 23:33:23
添加标准功能 上报fmt const char * fmt = "/sys/%s/%s/thing/event/property/post" ; 在example_publish( )中获取电压值并上报 int example_publish ( void * handle ) { int res = 0 ; const char * fmt = "/sys/%s/%s/thing/event/property/post" ; //"/%s/%s/user/get"; char * topic = NULL ; int topic_len = 0 ; char * payload = NULL ; int fd , ret ; double vref = 3.36 ; double voltage , get_value ; char * data = NULL ; data = HAL_Malloc ( 20 ) ; memset ( data , 0 , 20 ) ; payload = HAL_Malloc ( 200 ) ; memset ( payload , 0 , 200 ) ; fd = open ( AI8_DATA_PATH , O_RDONLY ) ; if ( fd < 0 ) { perror ( "open AI8_DATA_PATH error" )

Spring MQTT: java.util.MissingResourceException: Can't find bundle for base name org.eclipse.paho.client.mqttv3.internal.nls.logcat, locale en_US

强颜欢笑 提交于 2019-12-10 23:32:26
问题 NOTE WELL: I am NOT running eclipse. I am running a standalone Spring application from the command line with maven. When I attempt to send a message to an outbound channel adapter created with IoC using spring-integration-mqtt 4.3.8, I get java.lang.ExceptionInInitializerError at org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory.getAsyncClientInstance(DefaultMqttPahoClientFactory.java:147) at org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler

bridge local mosquitto to cloud broker

笑着哭i 提交于 2019-12-10 18:25:38
问题 I'm trying to bridge local mosquitto (on raspberry pi) to some cloud broker so I can send data and control some devices using that data. I tried with Cloudmqtt and dioty, but with no success. In case of cloudmqtt I've been told that everything is ok with mosquitto.conf file and for dioty I've been told that it uses Mosca broker which doesn't support bridging (with I've been told I refer to cloudmqtt and dioty support service). Does anybody knows some remote broker that can be bridged to local

Vue中使用mqtt

佐手、 提交于 2019-12-10 18:22:47
官方文档: https://www.npmjs.com/package/mqtt 使用: let mqtt = require('mqtt');let client = {}; //开启mqtt链接client = mqtt.connect('ws://192.168.0.0/mqtt', { port: 8083, clientId: 'xxx', username: "xxx", password: "xxx", clean: false,});//订阅后端给你发的字段 在on里面接收client.on('connect', function () { client.subscribe('订阅的字段', function (err) { if (!err) { //DOSOMETHINGS } })});//接收消息client.on('message', (topic, message) => { console.log('in message'); if (topic === '订阅的字段') {    //DOSOMETHING }})//连接断开client.end() 来源: https://www.cnblogs.com/manong-xxf/p/12018281.html

Paho-mqtt callbacks in different classes android java

你说的曾经没有我的故事 提交于 2019-12-10 17:29:29
问题 I've just started Java Android programming, or even Java programming in general and I wanted to implement the Paho MQTT Android Service using a certain MqttHandler class and I want to set the callback as a parameter for the MqttHandler class. Other answers regarding callbacks in general suggested using an interface class but I don't know how that works. This is what I have tried: public interface InterfaceMqttCallback extends MqttCallbackExtended{ @Override public void connectComplete(boolean

AWS store MQTT message to DynamoDB

谁说我不能喝 提交于 2019-12-10 16:37:50
问题 I built a python script that sends MQTT message periodically. This is the JSON string sent to the backend: {"Id": "1234", "Ut": 1488395951, "Temp": 22.86, "Rh": 48.24} On backend side, I want to store the MQTT message into DynamoDB table. I followed an Amazon tutorial and the data contained into the MQTT messages are stored into the table. My problem regards the table columns. The table has only 3 colums: Id: Partition Key Ut: Sort Key Payload: contains the mqtt message. It is possible to