Project

General

Profile

Determining what subscriptions you will need

IoT One Cloud is based off XMPP, a protocol that is designed for real-time communication. The basic system works by sending a message stanza from a user or a device, to a server, and then from that sever to to another user or device on a different server. Depending on how things are setup, another message is sent back to the original user confirming information has been sent.

IoT One Cloud functions in a similar fashion; however it can vary depending on your setup. Ultimately, you will have to determine how many messages a second your system will need to send through IoT One Cloud service, but we can provide some guidelines.

Devices

This is fairly straightforward. You get one device to control through IoT One Cloud, and can add an additional 4 devices per subscription. Note that if you are using a single DHT22 sensor for both humidity and temperature, it is still considered two devices, even though one sensor is in use. This is because there are two request calls for specific information. Currently, the first devices added will be the first shown through IoT One Cloud, so if you add 6 devices, the first 5 will be shown when you connect.

Typical Use cases for messages:

In one case, say you want to turn on an LED. A client on a cell phone wishing to turn an LED on will send a message to the IoT One Cloud server, that message then is sent to the hub and framework. It is then checked against the last published information for the LED (it is currently off) and then pushes the turn on command. This status is then sent back to the client through the IoT One Cloud Server. In all, this transaction takes 3 messages.

A sensor on the other hand is "one way", where the sensor publishes new information from the framework to the device through the IoT One Cloud server at a rate designated when it's added. This only requires one message since it's one directional.

Adding and removing a device from the hub VIA the IoT One Cloud server will take two messages. One to send the command through to the hub, and one to receive the "item changed" confirmation (and subsequently add controls or sensor data to the client).

Calculation:

Using the above details, you can estimate how many messages a minute you would need to avoid running into your limits. Sensors will publish information as often as you set them to when added. Note that even though a device might have a limit of 1 read per second, if you set the IoT Hub to poll data twice a second, it will publish at that rate, so it is important to understand a devices' limitations when adding them. Something like a weather station can be calculated somewhat easier. If you have say 6 devices (temp, humidity, wind speed, wind direction, cloud cover, and rain sensor), and they each are sending information 4 times a second, the calculation is very easy: 24 messages a second.

Controlling a robot however, you are sending information back and forth at a much faster rate. Assuming you have two 4-way motors, and a few sensors, you're going to want to push information as fast as possible. If we estimate 3 messages per command, and 6 messages per input (motor on, motor off) we can start to get an idea. Since you would want more overhead for inputs, assume you want to use all 8 inputs at the same time, that results in 48 messages for just the directions alone. Clearly, some added subscription would be needed to control the robot without having to worry about running out of commands.

Note that commands that exceed the limit will be ignored until the number of sent messages start to fall (for the last 60 seconds). A message on your client will be shown when you exceed this limit, and it will let you know when you can return to normal use.

Limitations:

Your connection to the limit is the major limiting factor as to how fast messages can be sent back and forth. Assuming you have a 10Mbs connection, you can expect somewhere in the range of 100 messages per second, up to a total of 6000 messages per second. This could be greater depending on hardware and connection. The IoT One Cloud server is built to handle millions of messages per second, and scales dynamically during times of need so you won't miss a beat.

Consideration:

Note that your client has a small indication of how many messages per minute you are sending, if you have a stable setup, you can see at a glance how many messages are being sent through the IoT One Cloud. Note that there is no penalty for exceeding the limit aside from dropped messages, so you can gage using that.