At the recent Build, Microsoft announced that the Azure IoT Suites were renamed to Microsoft Azure IoT Solution Accelerators.
“A solution accelerator helps you speed up the development and deployment of your IoT solution. It’s open source so you can customize it to fit your business. Use it as a reference for your own solution, or as a demo to see how a finished solution can work for you.”
There are four different accelerators:
- Remote Monitoring
- Connected Factory
- Predictive Maintenance
- Device Simulation
In this blog, we dive into the Device simulation:
“Streamline your IoT solution development by using simulated IoT devices to both build and test your solution throughout the software development lifecycle.”
This is an interesting tool to generate the output of many devices as if there are actually (thousands of) devices connected to an IoT Hub.
What can we do with it? How useful is it?
Microsoft provides a guide, let’s check this out.
If we look at the documentation, this service will generate the following resources on your Azure subscription:
- 1 Azure Active Directory application
- 1 Virtual Machine (Standard D4 v3 with 4 cores and 16 GB memory)
- 1 Cosmos DB Account (Standard)
- 1 Storage account (Standard-LRS)
- 1 Web Application
- 1 IoT Hub (S2 – Standard)
The costs are not clear. According to Microsoft, you will have to use the Azure calculator to find out. Experience says it will be quite cheap if you do some testing for a few hours or days and then tear down the resources. If you can not wait for twenty minutes to get everything created or you have custom messages which are very hard to re-create, you can choose to set resources on pause (like the VM).
If you are a heavy user, you have to monitor the resources to find out if these have to be scaled up.
It seems the IoT Hub can be removed during or after the creation if you have your own IoT Hub at some point in time.
You can look into the code of this accelerator or even start your own version of it using the open-source code.
Installation is pretty simple:
If you leave out the IoT Hub, it will not be created.
Creation will take 15 minutes or so.
You will need the correct permissions to get this created.
Afterwards you will see the resources created:
And a simple website is available:
You can see we can enter the connection string on an alternative IoT Hub.
Generating Data Messages
Using this website you can generated message of A maximum of 20.000 devices. We can specify the interval in hours (maximum of 99), minutes and seconds (default ten). And we can specify the duration, also in hours (maximum of 99), minutes and seconds (default indefinitely). Finally, we can choose the model. There are three pre-defined modules. These are the messages we receive:
While the generation of messages is executed, you get some feedback (eg. the amount of messages generated):
You also get a summary at the end:
There is no Back button. If you want to switch back to a new generation run, just press the OK button. Or just remove “simulation” in the path “https://%5Byour solution].azurewebsites.net/simulation”. Here you can plan your next run, the previous selections are still available.
Generating Custom Messages
You can also choose to create a custom message. This message is just one dimension deep (so no arrays) and each field consists of the following properties:
- Sensor name
- Behavior. This is either Random, Increment or Decrement
- Minimum value
- Maximum value
- Unit (just a string)
Entering the data is simple:
This will generate something like:
Note: And there is no unique Name check.
you will have to add the unit. I have not seen cases where the unit was omitted. This was done because the company used standard units for certain fields or to limit the size of the message.
Having to add them, makes the messages ‘dirty’. A bit more information is sent. Chunks could be filled more quickly, a bit more load on the server side is needed, etc.
It would be nice to have the opportunity to leave out the unit.
If you want to send fairly exotic messages, from only a few devices, building your own message generator is a simpler and probably a cheaper solution.
But if you want to have a flexible solution to create A LOT of simple messages, this accelerator is just for you.
If you want to add arrays you will have to dive into the code in Github and change and create your own solution.
This accelerator has potential so I look forward to what the community or Microsoft will bring us in the next version.