IoT Simulation service
Перейти к файлу
Devis Lucato f2c8d6e92d Save simulations in the storage (#32)
* Store simulations using the storage adapter
* Implement device bootstrap scenario: when a new device is created, mark it as a simulated device and report some properties like device type, messages schema, and initial location.
* Remove dependency on IoT Hub manager and access IoT Hub directly
* Refactor state machine to reduce complexity and reuse code
* Add launch settings for Visual Studio
* Remove env var used for the web service TCP port
* Improve logging of exceptions to avoid log flooding
* Fix messages format, to always use the “_unit” convention
* Add JSON config checks
2017-08-15 10:39:11 -07:00
.github Add GitHub templates 2017-07-05 20:29:22 -07:00
Services Save simulations in the storage (#32) 2017-08-15 10:39:11 -07:00
Services.Test Save simulations in the storage (#32) 2017-08-15 10:39:11 -07:00
SimulationAgent Save simulations in the storage (#32) 2017-08-15 10:39:11 -07:00
SimulationAgent.Test Remove Akka and update to new template (#21) 2017-07-07 13:49:03 -07:00
WebService Save simulations in the storage (#32) 2017-08-15 10:39:11 -07:00
WebService.Test Remove Akka and update to new template (#21) 2017-07-07 13:49:03 -07:00
scripts Save simulations in the storage (#32) 2017-08-15 10:39:11 -07:00
.gitattributes Initialize project with files from template 2017-05-25 18:22:07 -07:00
.gitignore Implement device bootstrap scenario and decouple from IoT Hub manager (#30) 2017-08-08 18:10:43 -07:00
.travis.yml Migrate to .NET Core (#9) 2017-06-20 18:52:50 -07:00
CONTRIBUTING.md Remove Akka and update to new template (#21) 2017-07-07 13:49:03 -07:00
DEVELOPMENT.md Implement device bootstrap scenario and decouple from IoT Hub manager (#30) 2017-08-08 18:10:43 -07:00
LICENSE Initial commit 2017-04-30 19:08:53 -07:00
README.md Implement device bootstrap scenario and decouple from IoT Hub manager (#30) 2017-08-08 18:10:43 -07:00
device-simulation.sln Implement device bootstrap scenario and decouple from IoT Hub manager (#30) 2017-08-08 18:10:43 -07:00
device-simulation.sln.DotSettings Migrate to .NET Core (#9) 2017-06-20 18:52:50 -07:00
version Save simulations in the storage (#32) 2017-08-15 10:39:11 -07:00

README.md

Build Issues Gitter

Device Simulation

This service allows to manage a pool of simulated devices, to test the end-to-end flow of device-to-cloud (D2C) telemetry, invoking cloud-to-device (C2D) commands, methods, etc.

The microservice provides a RESTful endpoint to set the simulation details, to start and stop the simulation, to add and remove virtual devices. The simulation is composed by a set of virtual devices, of different types, each sending telemetry and replying to method calls.

How to use the microservice

Quick demo using the public Docker image

After cloning the repository, follow these steps:

  1. Install Docker Compose: https://docs.docker.com/compose/install
  2. Create an instance of Azure IoT Hub
  3. Store the "IoT Hub Connection string" in the env-vars-setup script. For more information about environment variables, see the development notes.
  4. Using an HTTP client like Postman, use the RESTful API to create a simulation.

By default, Docker Compose will start the service using the sample device types defined in sample-volume:

  • to load device types definitions from a different folder, edit the docker-compose.yml
  • to add your custom simulations, add the JSON and Javascript files into the folder and restart the service. See the wiki for more information about device types and the API.

Working with Visual Studio

After cloning the repository, follow these steps:

  1. Install Docker: https://docs.docker.com/engine/installation

  2. Create an instance of Azure IoT Hub

  3. Open the solution in Visual Studio

  4. Either in Visual Studio or in your system, define the following environment variable:

    1. PCS_IOTHUB_CONNSTRING = {your Azure IoT Hub connection string}

    For more information about environment variables, see the development notes.

  5. In Visual Studio, start the WebService project

  6. In Visual Studio, Start the SimulationAgent project

  7. Using an HTTP client like Postman, use the RESTful API to create a simulation.