mqtt

nodeMCU TLS certificate error

Deadly 提交于 2019-12-24 08:08:12
问题 I am building realy simple IoT project, and I am stuck on nodeMCU TLS problem. I have MQTT broker on my Raspberry pi, all certificates are correctly inserted (everything working fine with Paho Client on same raspberry or with Mqtt.fx client on remote PC), but when I try to connect from my ESP8266 with nodeMCU I am getting SSL handshake error (yes, I am using same cert file for all mentioned clients). My ESP8266 code looks like this: tls.cert.verify([[ -----BEGIN CERTIFICATE----- -----END

Keep a MQTT Client Connection always active

瘦欲@ 提交于 2019-12-24 06:04:18
问题 I am using CloudMQTT as a MQTT broker in my Pub-Sub based application. I am using my publisher to publish data to the CloudMQTT server over a topic , and I plan to subscribe to the broker on my webpage to recieve the transmitted information. I am using this procedure to create a Client (subscriber): https://www.cloudmqtt.com/docs-php.html Code goes as follows: // subscribe.php require("phpMQTT.php"); $host = "hostname"; $port = port; $username = "username"; $password = "password"; $mqtt = new

Android MQTT unable to create client

﹥>﹥吖頭↗ 提交于 2019-12-24 03:08:53
问题 I am trying to create an mqtt client in my android service using the paho client library . The mosquitto broker is running on my local machine. I am getting an MqttPersistenceException exception when i try to create a new instance of the MQTTClient. //create client port=1883 mqttConnSpec="tcp://"+ipaddressOflocalMachine+":"+ port mqttClient = new MqttClient(mqttConnSpec, mqttClientId) the exception does not give any reason. I am successfully able to communicate using a java console app. Is

Mosquitto reload config file

微笑、不失礼 提交于 2019-12-24 01:26:05
问题 I want to reload the mosquitto password file when it is changed. Is possible to send SIGHUP ("signal hang up") or some equivalent to mosquitto server on windows? 回答1: It is possible to do so. First you have to set your mosquitto.conf to save the pid in a file by specifying the pid_file. pid_file your/pid/file Then you can call $kill -SIGHUP $(cat your/pid/file). Or else if you already know the PID of the mosquitoo, then you can do $kill -SIGHUP PID This will send sighup signal and reload the

share mqtt client object between files

二次信任 提交于 2019-12-23 22:19:55
问题 I connect to MQTT this way: //mqtt.js const mqtt = require('mqtt'); var options = { //needed options }; var client = mqtt.connect('mqtt://someURL', options); client.on('connect', () => { console.log('Connected to MQTT server'); }); I want to export the client object this way: //mqtt.js module.exports = client; So that I can import it in other files and make use of it this way: //anotherFile.js const client = require('./mqtt'); client.publish(...) However, we all know that this will not work!

MQTT over websocket for Android and iOS

你说的曾经没有我的故事 提交于 2019-12-23 16:31:12
问题 After a lot of research I settled on MQTT protocol for communication between devices. To take it a step further I thought it would be great to use MQTT over WebSockets. On the server side I'll be using Mosquitto which supports WebSockets. But for the client side, I'm not sure if there are any libraries available for Android and iOS. Any idea on how to implement it ? or may be any workaround ? 回答1: If you're using iOS, I would recommend to look at the excellent MQTT-Client-Framework library.

Paho MQTT Python Client: No exceptions thrown, just stops

半世苍凉 提交于 2019-12-23 09:50:27
问题 I try to setup a mqtt client in python3. This is not the first time im doing this, however i came across a rather odd behaviour. When trying to call a function, which contains a bug, from one of the callback functions (on_connect or on_message), python does not throw an exception (at least it is not printed), it just stops there. I tied together a short example, that reproduces that behaviour. Does someone has an idea? import paho.mqtt.client as mqtt import re import os.path import json from

esp8266自定义工程框架

丶灬走出姿态 提交于 2019-12-23 09:23:04
esp8266自定义工程框架 如何再起官方rtos sdk中规范的建立一个工程了,现在我们基于上一篇博客-esp8266对接阿里云平台做下规范。 首先将user_main.c中mqtt连接部分分离出来,写入user_mqtt.c中,分离是注意头文件包含,及一些全局变量设置。 user_main.c /* This example code is in the Public Domain (or CC0 licensed, at your option.) Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #include <stdio.h> //#include "esp_system.h" //#include "freertos/FreeRTOS.h" //#include "freertos/task.h" #include <stddef.h> #include <stdio.h> #include <string.h> #include "esp

ApplicationMessageProcessed event is not firing in managed MQTTnet client

本小妞迷上赌 提交于 2019-12-23 05:22:59
问题 MQTTnet is a high performance .NET library for MQTT based communication. This is GitHub Link. https://github.com/chkr1011/MQTTnet . It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/. This is how I have created managed MQTT client. Here is the link https://github.com/chkr1011/MQTTnet/wiki/ManagedClient // Setup and start a managed MQTT client. var options = new ManagedMqttClientOptionsBuilder() .WithAutoReconnectDelay

Handling MQTT communication inside HTTP request in Node-Red

≡放荡痞女 提交于 2019-12-23 03:25:27
问题 In Node-Red, I would like to be able to send a message and wait for its response using MQTT, in between an HTTP input node and a response one. I think a picture is more relevant to explain this: The problem is an HTTP response node has to be directly linked to an input one somehow, so I thought of saving the whole message in context after receiving an HTTP input, then restore it before sending the response. The problem is that apparently, the structure of the message is circular, hence I can