用于机器对机器 (M2M) 通信的 XMPP
我正在开发基于位置的服务项目,其中有几个传感器需要将异步读数发送到服务器,服务器将关联读数并生成结果。还会有一定程度的传感器到传感器通信,我对使用 XMPP 作为传输很感兴趣,因为它具有高效的消息传递、实时性和 NAT 遍历。
我希望找到(python 或任何其他语言)XMPP 机器对机器 (M2M) 服务的示例,希望使用 PubSub 模型进行异步通信,而不是基于轮询的 RPC。我无法在网上或在我见过的 XMPP 书籍中找到任何示例,因为它们似乎主要关注 XMPP 用于人类交互,例如聊天、视频等。
我必须满足的一般要求是:
1.多个传感器通过 XMPP 相互共享数据
2。异步(PubSub)通信,订阅感兴趣的消息
3.希望用 Python 编写,但任何语言都是一个很好的起点
4。服务器将所有传感器的数据关联起来并生成结果,可供订阅者使用
5。通过发现轻松配置/设置
任何关于在哪里查找或一个好的起点的想法将不胜感激。
谢谢!
I am working on location-based services project where I have several sensors that need to send asynchronous readings to a server, which will correlate the readings and generate a result. There will be some level of sensor to sensor communication as well, and I am interested in using XMPP as a transport due to its efficient messaging, real-time nature and NAT traversal.
I am hoping to find an example of (python, or any other langauge) XMPP machine to machine (M2M) services, hopefully using a PubSub model for asynchronous communication rather than a polling-based RPC. I have not been able to find any examples online or in XMPP books that I have seen, as they seem to be mostly focused on XMPP for human interaction such as chat, video, etc.
The general requirements that I have to work with are:
1. Multiple sensors sharing data with each other over XMPP
2. Asynchronous (PubSub) communication, subscribing to messages of interest
3. Hopefully written in Python, but any language would be a good starting point
4. Server correlates data from all the sensors and generates results, which can be made available to subscribers
5. Easy configuration / setup through discovery
Any ideas about where to look, or a good starting point would be much appreciated.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
M2M 的 XMPP 听起来是个好主意。
关于客户端和服务器,请参阅 http://xmpp.org/about-xmpp/technology- Overview/pubsub/
在 pubsub 中,服务器基本上完成了所有艰苦的工作,并且您必须向客户端实现很少的智能。但这取决于您想如何处理已发布的信息。我还没有测试过任何实际使用已发布信息执行某些操作的客户端。
XMPP for M2M sounds like a nice idea.
About clients and servers, see http://xmpp.org/about-xmpp/technology-overview/pubsub/
In pubsub server does basically all the hard work, and you have to implement very little intelligence to clients. But this depends on what you want to do with published information. I haven't tested any clients which actually do something with the published information.
这非常适合 XMPP 的 pubsub 模型。
您发现的任何处理 pubsub 的示例都可以轻松应用。在 XMPP 中,JID(Jabber ID)是否代表机器的用户是无关紧要的,并且 pubsub 实际上并不面向人类交互,这与多用户聊天不同。
有许多 XMPP 服务器支持 pubsub。我使用过 Smack 和 OpenFire 我自己也有类似的目的。服务器对您来说不太重要,因为任何支持 PubSub 的现成产品都可以完成这项工作。更重要的是具有 pubsub 支持的客户端库。我知道 Smack 有这个,但它是一个 Java 库而不是 python。
This fits the pubsub model of XMPP pretty well.
Any example you find dealing with pubsub is easily applicable. In XMPP, whether the JID (Jabber ID) represents a user of a machine is irrelevant, and pubsub is not actually oriented toward human interaction, unlike say, Multi User Chat.
There are many XMPP servers that support pubsub. I have used Smack and OpenFire for a similar purpose myself. The server is of less importance to you, since any off the shelf product that supports PubSub will do the job. More importantly is a client library that has pubsub support. I know Smack has this, but it is a Java library not python.
我对所有这些必要条件一无所知,但您可以使用 SleekXMPP 来构建您自己的。它是纯 python 且文档齐全的 XMPP 库。 XMPP 已用于进行计算机到计算机的通信,这非常好,因为您可以从自己的聊天客户端测试它。例如,http://www.python.org/about/success/projectpipe/
祝你好运
I do not know anything with all those requisites but you can use SleekXMPP to build your own. It is pure python and well documented XMPP library. XMPP has been used to do computer-to-computer communication which is quite nice because you can just test it from your own chat client. Look for example, http://www.python.org/about/success/projectpipe/
Good luck