[From the last episode: In the IoTThe Internet of Things. A broad term covering many different applications where "things" are interconnected through the internet., most “recognizable” communication happens at the application layer.]
Last time, we introduced an example of a radon detector talking to a fan, and we did so in generic terms with human languages. Let’s be more specific since this isn’t going to happen using plain English or Spanish or any other human language. Let’s say that both the detector and the fan use programming languages (which, historically, tend to look more like English). There are a couple of ways in which things could go wrong.
We’re going to introduce some ways that commands might look between devices talking to each other. To tie things together, bear in mind that the commands that Device 1 sends to Device 2 have to reflect the API for Device 2, because Device 1 is completely outside the scope of Device 2 – possibly even made by a different company that will have no access to the internal interfacesThe point where two different domains meet, like a border. For example, a wall plug could be thought of as the interface between the power grid and the appliances you plug in. within Device 2. All they can see is the API. The catch is that they have to follow the API for things to work. Let’s look at this through our radon-detector example (where the radon detector is Device 1 and the fan is Device 2).
Programming Languages Instead of Human Languages
For those of you who haven’t spent time with programming languages, they tend to be terse and, well, engineer-like. So let’s say that the command sent out from the detector looks like this:
fan1.TurnOff
That means, “Turn off Fan 1.”
If that’s what the fan is expecting, you’re good. But let’s say that the fan is listening for a command that looks like this:
FanControl(“off”)
That means that the fan isn’t going to understand the TurnOff command.
Now let’s say that the fan itself has multiple speeds, so that the command it’s expecting looks like:
Fan.SetSpeed [some speed]
where the “some speed” thing can be 0, 1, 2, or 3. Now there is no “turn on” or “turn off” command; “turn off” is really “set the speed to 0.” But if the radon detector doesn’t know that, it may try to use the TurnOff command.
This is where interopThis refers to how well different pieces of equipment can work together. Macs and PCs, for instance have some limited interop, but there are many Mac devices that can't work on a PC, and vice versa. This is an important notion for systems, like the IoT, that involve many different pieces of equipment working together. problems can occur. It’s why, if you have a Nest thermostat and you want to buy something that the Nest will control, you have to ask, “Can this thing talk to a Nest?”
IoT device designers make this decision all the time: “With whom will I connect?“ That’s mostly a business decision, not a technical decision. And there can be more than one answer to that question. Any designer can decide to make their device work with, say, both Amazon‘s Alexa and Apple’s HomeKit. It just means that their program has to be a bit bigger so that it can recognize both languages.
A bigger program takes more memory or a bigger processorA computer chip that does computing work for a computer. It may do general work (like in your home computer) or it may do specialized work (like some of the processors in your smartphone). or something, so the cost may go up. Some flexibility like that may not have a big impact; other flexibility may be very expensive. That’s what engineers do: they make tradeoffs to get the best combination of features and price.
Profiles in Courage (or Discouragement)
One communication stackRelated to communications: A way of organizing parts of a complicated process (like communications) so that any task relies on tasks below it and feeds the tasks above it. Related to computing: A place in memory where you store “where was I?” information when you go from, say, one function into another. Before starting a new function, you store where you were in the old one so that, when the new function ends and you’re back in the old one, you can figure out where you were and continue on. (one we haven’t talked about much) is called ZigBee. The standard defines pretty much the whole stack (except for the very bottom, which it shares with some other standardsA way of doing something specific that has been agreed by multiple parties in an official manner. Some "standards" aren't official standards; the best ones have been established in an open fashion, where anyone with an interest can contribute and where large companies can't push little companies around.), including the application layer. They pioneered the concept of profilesAn agreed-upon definition of how some device works – what commands it can receive – and what those commands should look like.. That means that, even at the application layer, they define various objects and how you talk to those objects. The idea is that, in theory, if you follow the profile perfectly, then you know that two devices that speak ZigBee will understand each other. (Engineers have reported to me that, in practice, it doesn’t always go quite so smoothly, but that’s neither here nor there for our discussion. It’s their problem, not yours.)
The same notion applies no matter what protocolAn agreed way of doing something. Like a convention, except that protocols tend to be related to processes. is used. Both sides of the communication have to agree on how to talk. Their views of the world may not be formally called profiles, but the requirement for agreement still holds.
Of course, nothing’s perfect. You’ve probably found, for instance, things that are supposed to work with a Mac or a PC and, for some unexplainable reason, they just don’t. That can, at least in theory, happen in the IoT as well. So, if you can, it’s good to be able to test a unit out to make sure the communication is clean. In practice, however, that can be hard to do. Your neighborhood retailer probably isn’t set up for that, and it’s even worse buying online.
Which is why you should definitely look up reviews to see what experiences others have had connecting a device you’re interested onto the networkA collection of items like computers, printers, phones, and other electronic items that are connected together by switches and routers. A network allows the connected devices to talk to each other electronically. The internet is an example of an extremely large network. Your home network, if you have one, is an example of a small local network. that you have.
Leave a Reply