mosquitto 桥接环境
2015-11-03 11:49
441 查看
环境如下:
在AP板子端操作:(注:允许有多个AP同时在线)
下列配置实现AP和PC之间的双向桥接,AP端发布的消息如果前缀为local/sensor/,该消息将转发到PC端前缀为remote/sensor/的topic;
同理,PC端发布的消息如果前缀为remote/sensor/,则该消息将转发到AP端前缀为local/sensor/的topic;
在PC端操作:(注意:当在AP端配置了both方向的bridge后,在PC端不需要再进行bridge配置)
在AP板子端操作:(注:允许有多个AP同时在线)
下列配置实现AP和PC之间的双向桥接,AP端发布的消息如果前缀为local/sensor/,该消息将转发到PC端前缀为remote/sensor/的topic;
同理,PC端发布的消息如果前缀为remote/sensor/,则该消息将转发到AP端前缀为local/sensor/的topic;
/etc/mosquitto/mosquitto-1.conf |
log_type all user root connection server-PC address 192.168.1.102:1883 topic # both 0 local/sensor/ remote/sensor/ clientid 1_4 cleansession true |
执行服务器程序: mosquitto -c mosquitto-1.conf |
执行订阅者程序: mosquitto_sub -t local/sensor/# |
执行发布者程序: mosquitto_pub -t local/sensor/room -m "`date`" |
执行服务器程序: ~/mosquitto-1.4.4/mosquitto |
执行订阅者程序: ~/mosquitto-1.4.4/client/mosquitto_sub -t remote/sensor/# |
执行发布者程序: ~/mosquitto-1.4.4/client/mosquitto_pub -t remote/sensor/room -m "`date`" |
相关文章推荐
- iOS开发技巧(系列十八:扩展UIColor,支持十六进制颜色设置)
- UINavigationItem的那点事
- 解决Azure Management API ForbiddenError: The server failed to authenticate the request
- php preg_match中文 Compilation failed: character value in \x{...} sequence is too large at offset 7
- codeforces 589C(divide and conquer)
- EasyUI DataGrid 修改每页显示数量的最大值&&导出Grid到Excel
- leetcode 300: Longest Increasing Subsequence
- UIScrollView代理调用顺序
- 解决EasyUI中Dialog 和 Uploadify 相互影响问题
- 百度编辑器 UEditor 使用
- (转).NET 4.5中使用Task.Run和Parallel.For()实现的C# Winform多线程任务及跨线程更新UI控件综合实例
- 关于java.sql.SQLException: Incorrect string value的解决方法
- iOS - UI之核心动画CAAnimationGroup以及其他
- IOS-UIScrollView的小用法
- Rogue游戏(二)——房间与走廊的创建
- UIAlertController 弹框提醒
- UIMenuController的使用,对UILabel拷贝以及定制菜单
- UIView UIViewContentMode各类型效果
- EasyUI combotree 使用技巧
- 自定义 UIAlertView 之 BSYAlertView