Once you have put the simulation files and directories in place, define your custom simulation.

First, establish the general simulation parameters such as groups, number of devices, or their type. This is done in the simulation main file, simulation.json. To do so:

  1. Edit the simulation.json file located inside the streetlights_simulation directory.

  2. Add groups to your simulation.

    In this example, there is one group with three streetlights, so in the groups object, define just one group with the following configuration:

    1. Set the name of the group to Streetlights, for example.

    2. Enter the profile for your simulated devices, that is, the identifier of the file that defines how they behave.

      Profiles are defined inside the profiles directory of your simulation folder, see next step 3. Establish your devices profile.

      The profile identifier, profile_id, of your devices in Streetlights group is streetlight.

    3. Specify the number of devices to mimic in each group.

      In this case, set the number of devices to three.

    4. Define the initial information of the group to build.

      Inside setup:

      1. Choose the vendor identifier for the devices in the group, vendor_id.

        In this case, keep the vendor identifier, FE080003; simulated devices are based on ConnectCore modules.

        Find the available vendor IDs here.

      2. Enter the device type, type, that defines the device model.

        For the example, update it to cc_light.

      3. Type the prefix name for your devices.

        As you are simulating streetligths, use Light as prefix, so they are named as Light-<N>.

      4. Indicate the firmware version of your simulated devices and the initial device identifier.

        For this example, keep both values as they are.

    5. Inside the mobility object, you can define routes for simulated devices.

      Remove this object for this example as you are going to simulate static devices.

  3. The last object, user_app, determines how the IoT Device Simulator interacts with custom code for device requests and data points.

    Keep the user_app object as it is.

    This example requires the implementation of code to generate data point samples and process device requests. See 6. Implement custom code.

    This object can be removed if the simulation does not include device requests nor data samples generated by code.

For a complete explanation of simulation.json file, see Simulation configuration.
simulation.json
{
    "groups": [
        {
            "name": "Streetlights",
            "profile_id": "streetlight",
            "num_devices": 3,
            "setup": {
                "vendor_id": "FE080003",
                "type": "cc_light",
                "initial_device_id": "AA0FF0FF-FF0FF001",
                "name_prefix": "Light",
                "fw_version": "1.0.0.0"
            }
        }
    ],
    "user_app": {
        "initial_dr_port": 5577,
        "initial_dp_port": 6577,
        "log_level": "info"
    }
}