我正在考虑将mosquitto作为MQTT经纪人.根据我的阅读,我意识到Mosquitto不支持水平缩放.
到目前为止,我的要求的所有其他标准都可以通过Mosquitto来满足.
我不确定这个问题是否过于通用或广泛,但我想知道的是,如果有任何方法可以实现扩展功能,还可以为Mosquitto实现负载平衡等.
我在Raspberry Pi上设置了MQTT,并为代理配置了Arduino Uno,但我在/var/log/mosquitto/mosquitto.log文件中看到以下条目:
New connection from 192.168.10.114 on port 1883.
Socket error on client <unknown>, disconnecting.
Run Code Online (Sandbox Code Playgroud)
Pi设置为ETH0连接到我的本地LAN,IP地址为192.168.1.50
Pi上还有一个WiFi AP设置.Arduino Uno通过WiFi连接发送/接收MQTT消息.WiFi AP的IP地址为192.168.10.1,并通过提供DHCP租约dnsmasq.
我尝试在本地MQTT代理服务器(Pi)上发布和订阅测试并得到相同的错误:
Command:
mosquitto_sub -h 192.168.10.1 -t topic
mosquitto.log:
New connection from 192.168.10.1 on port 1883.
New client connected from 192.168.10.1 as mosqsub/1837-raspberryp (cl, k60).
Socket error on client <unknown>, disconnecting.
Run Code Online (Sandbox Code Playgroud)
这是/etc/mosquitto/mosquitto.conf:
pid_file /var/run/mosquitto.pid
persistence true
log_dest file /var/log/mosquitto/mosquitto.log
allow_anonymous true
include_dir /etc/mosquitto/conf.d
Run Code Online (Sandbox Code Playgroud)
sudo服务mosquitto停止sudo服务mosquitto开始:
mosquitto version 1.4.8 terminating
mosquitto version 1.4.8 (build date Sun, 14 Feb 2016 15:06:55 …Run Code Online (Sandbox Code Playgroud) 我正在为之工作的公司评估了MQTT,并决定将其用作大规模系统的核心消息传递平台.主要原因是协议的紧凑程度以及实际实施的容易程度.我对MQTT有一个问题,我正在寻找以下问题的答案:
QoS1和QoS2消息需要客户端确认.接收PUBACK,PUBREC,PUBREL和PUBCOMP时,我唯一知道的消息(识别它)是messageId和clientId.消息ID是无符号的int16,因此最大值为65535.对于长时间运行的客户端,例如一年,每小时发送15条QoS2消息,它似乎不够大.
我不太确定是否还有其他方法来识别消息?我希望尽可能符合标准.
我在ubuntu上使用eclipse paho客户端,并尝试将纬度,经度和时间戳信息作为JSON格式发送到MQTT代理.我怎么做?
我找到了这篇文章,但它并不完整.
我想根据两种协议的一般特征比较OPC UA和MQTT,例如Overhead(数据包),安全性,信息建模和可靠性.我在哪里可以找到每个协议的Overhead和其他特征的一些示例数据,以便我对它们进行比较.我需要你的建议.您可以建议任何工具来比较这些协议.
我希望有一个简单的命令,就像我在bash中使用的那样,在AWS Lambda函数内的MQTT上发布一些主题.沿着这条线:mosquitto_pub -h my.server.com -t"light/set"-m"on"
背景:我想用Alexa打开和关闭一盏灯.Alexa可以启动一个Lambda函数,在这个Lambda函数内部我想开始一个MQTT发布,因为灯可以监听MQTT主题并对那里的消息作出反应.(也许有更简单的解决方案,但我们在复杂(大学)网络使许多其他方法更加困难)
我正在研究家庭自动化项目,我想将移动应用程序连接到ESP8266.
我可以将消息从移动应用程序发布到设置为代理的AWS服务器.(工作)
我可以将消息从AWS发布到Raspberry PI.(工作)
我还可以将Raspberry PI的Mqtt消息发布到NodeMCU/ESP8266.(工作).
但是当我试图将所有这些设置在一起时,问题就出现了.从AWS发布消息时,Raspberry PI会收到该消息,但它不会反映在NodeMCU/ESP8266上.
这就是我在ESP8266中使用的内容.当我从Raspberry PI发布时它工作正常,即使我在我的移动设备上连接PI将MQTT客户端应用程序正常工作.但是当我从AWS发布时,ESP8266没有任何反应,但PI能够接收消息.
在这里的OSX应用程序中,我可以将AWS MQTT与iOS9一起使用,但是当我尝试使用OSX10.11时,我收到此错误:
CFNetwork SSLHandshake失败(-9829)
错误-9828定义为
errSSLPeerCertUnknown = -9829,/*未知证书*/
我的OSX info.plist是
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>amazonaws.com</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSThirdPartyExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>amazonaws.com.cn</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSThirdPartyExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
Run Code Online (Sandbox Code Playgroud)
p12(来自"openssl pkcs12 -info -in awsiot-identity.p12")是:
MAC Iteration 2048
MAC verified OK
PKCS7 Encrypted data: pbeWithSHA1And40BitRC2-CBC, Iteration 2048
Certificate bag
Bag Attributes
localKeyID: 5F 80 DC 6E AB F1 98 6A AA FC 0B 7B …Run Code Online (Sandbox Code Playgroud) 我正在编写一个django应用程序,它应该充当MQTT发布者和订阅者.
我应该在哪里启动paho客户端并运行loop_forever()函数.
它应该在wsgi.py吗?
我通过运行 npx create-react-app my-app 创建了一个 React 项目
我安装了 mqtt-react-hooks
import { Connector } from 'mqtt-react-hooks';
import Status from './Status';
function App() {
return (
<Connector
brokerUrl="mqtt://127.0.0.1:80/"
parserMethod={(msg) => msg} // msg is Buffer
>
<Status />
</Connector>
);
}
export default App;
Run Code Online (Sandbox Code Playgroud)
我在控制台中收到此错误
