Mosquitto串口接收数据处理到的数据如何处理

mosquitto 参数配置(转) - wateras1的日志 -
电子工程世界-论坛
请完成以下验证码
mosquitto 参数配置(转)
已有 108 次阅读 11:01
|个人分类:|
mosquitto 参数配置1.retry_interval&当QoS为1或2的消息已经被发送后,mosquitto在一段时间内仍未接收到客户端的反馈消息,将重新发送消息。 默认为20秒2.sys_interval&每隔一段时间将更新$SYS层级话题的状态,其中包含着proker的状态信息。 默认为10秒3.store_clean_interval表示间隔多长时间将不再被使用的消息销毁掉。该值越小,使用的内存就会越小但会需要更多的处理时间。 如果设置为0,表示不被使用的消息将会及时销毁。 默认为10秒4. pid_file &默认为/var/run/mosquitto.pid5.user & 设置mosquitto启动用户6.max_inflight_messages&表示允许多大数量的QoS为1或2消息被同时进行传输处理。这些消息包括正在进行握手的消息和进行重新发送的消息。默认为20个,如果设置为0,表示不设限制;如果为1,则会确保消息被顺序处理。7.max_queued_messages表示允许多大数量的QoS为1或2消息在队列中进行排队。 默认为100个8.max_connections设置最大的连接数 &-1表示不限制9.autosave_interval表示当开启持久化设置时,间隔多少时间mosquitto会把内存中的消息保存到磁盘中。默认为30分钟,当设置为0时,只有mosquitto关闭的时候才会写的磁盘中。10.persistence设置为true时,所有的连接,订阅和消息数据都会被保存到磁盘的mosquitto.db文件中。当mosquitto重启的时候,它会从mosquitto.db文件中重新加载数据。11.persistence_location &默认为/var/lib/mosquitto/12.log_dest &设置日志的输出目的地 可以是:stdout stderr syslog topic & 如果输出到某个文件的话可以这样设置log_dest file /var/log/mosquitto.log &要赋予对mosquitto.log文件的读写权限。13.log_type &日志类型:debug, error, warning, notice, information, subscribe, unsubscribe, websockets, none, all14.log_timestamp & 是否记录日志时间15.clientid_prefixes设置只有clientId以某个前缀开始的客户端才允许连接到mosquitto broker.16.allow_duplicate_messages如果一个客户端订阅了多个topic时,设置是否允许接收重复的消息。比如订阅了foo/# 和 foo/+/baz。17.autosave_on_changes&If true, mosquitto will count the number of subscription changes, retained messages received and queued messages and if the total exceeds autosave_interval then the in-memory database will be saved to disk. If false, mosquitto will save the in-memory database to disk by treating autosave_interval as a time in seconds18.persistent_client_expiration持久订阅的过期设置。 对于将clean session设置为false的持久订阅客户端,如果在一定的时间段里面没有重新连接mosquitto将会被移除。这并不是一个标准的配置项,因为对于MQTT协议来说所有的持久订阅应该是永远有效的。如: persistent_client_expiration 2m  persistent_client_expiration 14d persistent_client_expiration 1y h:小时  d:天  m:月  y:年19.queue_qos0_messages 是否将QoS为0的消息计算到max_queued_messages参数中
作者的其他最新日志
评论 ( 个评论)
EEWORLD 官方微信
Powered by安装Mosquitto
#To use the new repository you should first import the repository package signing key:
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
#Then make the repository available to apt:
cd /etc/apt/sources.list.d/
#Then one of the following, depending on which version of debian you are using:
sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list
#Then update apt information:
sudo apt-get update
#And discover what mosquitto packages are available:
sudo apt-cache search mosquitto
##Or just install:
#安装服务端
sudo apt-get install mosquitto
#安装客户端 (订阅sub
与 发布pub)
sudo apt-get install mosqutitto-client
#安装调试器
sudo apt-get install mosquitto-dbg
启动与关闭Mosquitto
开启 mosquitto:
sudo service mosquitto start
停止 mosquitto:
sudo service mosquitto stop
查看 mosquitto 状态:
sudo service mosquitto status
查看监听的端口:
sudo lsof -i:1883
测试Mosquitto
#启动代理服务
mosquitto -v
【-v】打印更多的调试信息
mosquitto_sub -v -t sensor -h 192.168.228.130 -p 1883
【-t】指定主题,此处为sensor
【-v】打印更多的调试信息
【-h】指定代理服务的IP地址
【-p】指定代理服务的端口号
mosquitto_pub -t sensor -m test_one -h 192.168.228.130 -p 1883
【-t】指定主题,此处为sensor
【-m】指定消息内容,此处为test_one
【-h】指定代理服务的IP地址
【-p】指定代理服务的端口号
MQTT协议工作过程
---------------------------------------------------------------------------------------------------------------------------------------※ 我在手机上先订阅内涵小段子(我为订阅者),内涵小段子每发我就会收到(内涵小段子为发布者,当然它也可以选择不发给我),我不订阅就收不到。---------------------------------------------------------------------------------------------------------------------------------------
阅读(...) 评论()没有更多推荐了,
不良信息举报
举报内容:
MQTT协议与mosquitto的安装使用
举报原因:
原文地址:
原因补充:
最多只允许输入30个字
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!没有更多推荐了,
不良信息举报
举报内容:
mosquitto 使用详解
举报原因:
原文地址:
原因补充:
最多只允许输入30个字
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!Mosquitto接收到的数据如何处理? - 知乎12被浏览<strong class="NumberBoard-itemValue" title="分享邀请回答31 条评论分享收藏感谢收起01 条评论分享收藏感谢收起写回答

我要回帖

更多关于 打印机接收不到数据 的文章

 

随机推荐