10 ms·
XMPP: Swiss Army Knife for the Internet of Things
- babayega2 10y agoAny good Python XMPP library you guys may know ?
- goffi 10y agoTwisted with Wokkel (https://github.com/ralphm/wokkel https://github.com/ralphm/wokkel). It looks unmaintained, but a Python 3 port is on its way, and we are using it actively SleekXMPP (http://sleekxmpp.com/ http://sleekxmpp.com/) and it's asynchronous fork Slixmpp (https://pypi.python.org/pypi/slixmpp/1.1 https://pypi.python.org/pypi/slixmpp/1.1)
- SamWhited 10y agoI've used the XMPP support in Twisted Words pretty heavily; it's a bit outdated at this point, but Ralph is hard at work on an update that suppors Python 3, so it's worth looking into if you're using Python.
- thom_nic 10y ago+1 for SleekXMPP. A colleague and I actually contributed a bit to it some years back when we were using it in a commercial application (ARM/Linux hardware.)
- JoLi 10y agoI use SleekXMPP for most of my XMPP work and is about to move in my support for the IoT Xeps into main track which is currently out in my branch on github https://github.com/joachimlindborg/SleekXMPP/tree/xep_0323_325 https://github.com/joachimlindborg/SleekXMPP/tree/xep_0323_3...
- mrmondo 10y agoWe use XMPP + OTR internally @Infoxchange and it's been really fantastic for us. It's cross platform (although the Windows clients aren't that pretty to be honest, but we don't have many machines running Windows anymore), it's reliable, we can run it on site and ensure that secure chats are not logged (i.e. 1 on 1 chats aren't logged, rooms are just for history when someone joins), it integrates with monitoring / alerting and general operational notifications such as alerts or notifications from Nagios, GitLab CI builds, Application releases, Errors discovered in logs, Changes to oncall rosters, 'interesting' stats from load balancers, global notifications, secure file transfers and the list goes on. One thing I keep meaning to get around to implementing for everyone is a web interface for say people that are volunteering / on a temporary device etc...
- lasermike026 10y agoUse it right. It's not a message bus. XMPP is a chat protocol. Message delivery is not guaranteed.
- rakoo 10y agoSame old, same old: Core XMPP doesn't provide guaranteed delivery, but Extensions do, and today XMPP is more or less unusable without Extensions. I'm talking about XEP-0184 (https://xmpp.org/extensions/xep-0184.html https://xmpp.org/extensions/xep-0184.html) which is pretty much used in all maintained clients and servers. Note that XEP-0184 provides end-to-end delivery receipts; if you're only interested in hop-to-hop delivery, you're going want XEP-0198. I believe this one is a bit less widespread though.
- SamWhited 10y agoFor guaranteed delivery you really want XEP-0198 (http://xmpp.org/extensions/xep-0198.html http://xmpp.org/extensions/xep-0198.html) which effectively provides TCP like ack's and session management at the wire protocol level. It's fairly straight forward to implement, and works really well for both chat and message bus style applications where acks are required.
- rakoo 10y agoI think it really depends about what we mean by "guaranteed delivery". If you are more interested in the infrastructure and consider each piece as a different part then yeah, hop-to-hop reliability is important to you and you want XEP-0198. That's like "guaranted delivery of a packet". If however you are more interested in the application that sits on top of the infrastructure, then what you really care about is whether the recipient did receive your message: that's XEP-0184. That's more like "guaranted delivery of a message". Of course both are complementary (and to me both should be implemented)
- thom_nic 10y agoIQ messages are "guaranteed" at the protocol level. E.g. recipient is required by the protocol to reply, so pretty much all XMPP libraries make it easy to handle an IQ send with a reply timeout. This is not quite the same as "guaranteed delivery" but if you get a reply for your IQ you know it was received. So XMPP gives you request/reply as well as one-way fire-and-forget semantics. This, in conjunction with presence (so I have a good idea if recipient is currently online) give fairly strong toolkit for reliable M2M messaging.
- INTPenis 10y agoNow I love XMPP and before that I was even building website support apps with IRC. But it seems strange now in 2016 to be looking at XMPP for the new IoT wave because there are plenty of other interesting protocols available. AVS from Wire Swiss for example. Websockets that is being used by slack, signal and maybe more. Maybe fresh eyes, fresh code is a positive thing if we're going to move forward. Instead of using XML. ;)
- ungzd 10y agoWhat's wrong with XML? It's more human-writable than json, more flexible, less quirky than yaml (which I even cannot write without constantly looking into specification). Binary protocols are not better too, in age of lightbulbs running linux.
- nextos 10y agoI like XMPP but I reckon XML introduced some complexity. For example, many clients (like mcabber) had lots of features broken (e.g. typing notifications) when interacting with GTalk because they couldn't parse XML namespaces properly.
- jerf 10y agoIf you can't parse XML namespaces at least mostly properly, you can't write an XMPP client. Unfortunately, this disqualifies a lot of the less maintained and/or less well-written parsers. It also sometimes disqualifies "bindings" to things like libxml2, when the bindings are written by someone who doesn't understand namespaces and end up wrecking them even though the underlying library supports them fine. XML namespaces are strange to me. I think they're the simplest example of a standard I consider somewhat simple that to a first approximation nobody understands. It really goes to show that there aren't really all that many people who understand XML qua XML. There's a lot of people who understand "there's angle brackets and attributes and sometimes these entities" and not much more, but there's substantially more meat to correctly understanding XML. Unfortunately (and I mean this fully, not sarcastically or with preaching), to use and implement XMPP requires a somewhat more full understanding of XML than most people have. Namespaces are the biggest sticking point, but XMPP is also a bit quirky in that it tries to have an XML stream, which is sensible enough at the protocol level but often translates strangely up to the API level. (The optimum library for XMPP permits you to use a SAX-like parser for the stream opening, then presents a DOM-like view of each individual element, and there aren't very many libraries that allow both sides of that.)
- betimsl 10y agoAlso, MQTT.
- IshKebab 10y agoMQTT suffers from not having a real RPC system. Eventually with pub/sub you're going to end up with a "request ID" that is copied in replies, and at that point you've just invented a really shitty RPC system. Better to use one that was designed from the start for RPC (and that also supports streaming/push/pubsub as you'll want that too). I recommend gRPC (if your IoT think is beefy enough to support HTTP2), or something lighter like CapnProto's RPC.
- joshstrange 10y agoI wondered how common XMPP was for IoT, my IR Hub (Hub for IR + RF remote) for my TV/Media center speaks XMPP and thanks to some people who reverse engineered it I was able to drop in a library and start sending it commands pretty easily.
- ge0rg 10y agoIt also looks like XMPP is used in some home alarm systems [0]. Unfortunaltey, the developers there did too many things wrong, not only security-wise but also in how they used XMPP [1]. [0] http://www.heise.de/ct/artikel/Home-security-systems-hacked-with-1234-password-3248831.html http://www.heise.de/ct/artikel/Home-security-systems-hacked-... [1] http://geekplace.eu/flow/posts/drafts/xmpp-iot-antipatterns.html http://geekplace.eu/flow/posts/drafts/xmpp-iot-antipatterns....
- KaiserPro 10y agoFor IoT XMPP is utterly wrong. Yes, some planes use it for a message bus. But that was silly then as it is now. most IoT application have to worry about both power and network efficiency. XMPP is neither light nor concise. For example, I'm building a sensor network that needs to report a range of sensors every n seconds. I could use XMPP, but first I'd have to figure out how to make a decent XML parser in < 2kb or ram. Let alone a full IP stack. The cheap radio I have has an MTU of 60 bytes. None of this is going to fly, for what is effectively: Node Address: 1: 56.456 2: -6704 3: 80 If we ignore the <node><sensor><value> boiler plate that will instantly blow our packet budget, lets look at how the values are represented as: ascii. so sensor 1 which was a 4byte float is now a 6 byte varchar. We are of course ignoring the address which is going to be at least 16 bytes. We haven't even touched on the server requirements either. Can you name a decent XMPP server? I can't they are all finicky and nasty. So, no XMPP is not the swiss army knife of IoT, because its too large, too power hungry and just a massive pain in the arse. Anything that uses ascii representations of numbers is probably a bad fit for IoT
- ge0rg 10y agoYour argument only shows how wide the field of "IoT" is. For embedded sensor networks, your arguments apply without restriction. However, for things like "smart lightbulbs" or other devices connected to the cloud (not that I would endorse such things), where you need a scalable infrastructure for secure bidirectional communication between nodes deployed somewhere and your frontend application, XMPP provides a solid base. Besides, embedded nodes are getting more and more powerful (consider the ESP8266, which runs IPv4 and TLS and could easily handle XMPP), and it provides huge benefits to have a common end-to-end protocol that is not based on periodic polling like HTTP.
- KaiserPro 10y agoThe ESP* sucks power, which means bigger PSU, or in the case of lightbulbs, no config support when the light switch is off. Making a PSU that is both small and efficient for both low current draw and high is rather hard. Protocol design is trivial for something like a light bulb, compared to the cost of designing the device, and making the scalable backend (and no XMPP is no shortcut for that. I know how wide the IoT field is. I also know the sheer volume of shite that is being produced. Most of the Wifi products will die a horrid death. replaced by something better and more suitable to low power usage. Failing that something more secure, after a rash of home fires caused by a terribly insecure system that was able to be turned off and on again repeatedly until it caught fire.
- erikb 10y agoDo you know about the TR-069 standard?
- roymurdock 10y agoIf you really want to figure out which messaging protocols are being used for "IoT" deployments, looks at the leading IoT device management services providers: AWS IoT and Azure IoT Hub. AWS IoT uses MQTT and HTTP (over WebSocket). Azure allows customers to choose between MQTT, AMQP, and HTTP, but suggests that its users choose AMQP as a good general-purpose protocol. HTTP is usually used for devices/machines with external power supplies that are sending high volumes of relatively complex data. MQTT/AMQP are generally used for nodes/sensors with internal power supplies that are sending low volumes of telemetry data. Neither service supports XMPP natively which should give you a good indication of how suitable it is for IoT applications.
- azdle 10y agoWhat measure do you use to determine that AWS and Azure are the leading IoT providers? (Genuinely curious.) I know that they're large infrastructure players who are doing IoT, but are they also leaders in the IoT space?
- roymurdock 10y agoRevenue share of the overall "IoT Services" market, which includes connectivity, remote monitoring & control, storage, and data analytics services. Pub/sub protocols like XMPP, AMQP, MQTT are generally used in solutions that are sold into the remote monitoring & control services market. There is not "IoT market" though, so it's impossible to say who is a leader in the IoT space in general. It depends on the technology category. Eg NXP/Freescale is a leader in the IoT processor space, Wind River/Green Hills are leaders in the IoT OS space (RTOS), Amazon/MS are leaders in the IoT services space.
- JoLi 10y agoGetting sensors, data and actuators to work for ONE usecase has always been easy. just use what you need. The problem is still how you get these different company systems (silos) to cooperate. "how can you securely give the inside temperature from your alarm's smoke detector and feed it to the heating system to act upon". These services are provided from two different IoT companies. Here XMPP is the simple and perfect match. Any device in any company can talk to any other device in any other company just as easy as you send email to some one you know in another company. These companies can solve and hide there internal legacy systems with x500,modbus,coap, binary junk or whatever they need but when you pass the company xmpp server you pack it in a nice letter for others to easily understand what you are saying. With encryption and certificates. And you don't talk to servers/endpoints you don't do business with. How can NEST homes talk to openHAB? Zigbee legacy with new coap things? And how can they all participate in a smart city ?
- detaro 10y agoAnd then everything sends a different payload in their XMPP messages, and everything is broken again. XMPP is a possible part of a solution, but not the solution alone.
- JoLi 10y agoThats why the XMPP http://www.xmpp.org/extensions/ http://www.xmpp.org/extensions/ is there defining the payload. reading values http://www.xmpp.org/extensions/xep-0323.html http://www.xmpp.org/extensions/xep-0323.html writing values http://www.xmpp.org/extensions/xep-0325.html http://www.xmpp.org/extensions/xep-0325.html No there will always be several solutions interacting for different usecases, XMPP fits very well in some.
- deleted 10y ago[deleted]