Skip to content

CTISenior/iotwin-data-generator

 
 

Repository files navigation

IoTwin | Data Generator

Python Linux CI CodeQL linting: pylint MIT license

IoTwin Data Generator helps developers create virtual devices without the need to configure physical devices.

Table of Contents


Installation

sudo apt update -y
sudo apt install python3-dev python3-pip git libglib2.0-dev libxkbcommon-x11-0 libqt5x11extras5 -y 
git clone https://github.com/muratalkan/iotwin-data-generator.git
sudo python3 ./iotwin-data-generator/setup.py install
sudo python3 ./iotwin_data_generator/main.py

Usage

  • Double click the SN to view the device log
  • Right click on the SN to open the context menu

Configuration

default "./iotwin_data_generator/config/settings.json" file

{
    "gateway": {
        "id" : "test_id",
        "name": "Test Broker",
        "host": "127.0.0.1",
        "security": {
            "credentials": false,
            "username": "username",
            "password": "password"
        },
        "advanced_security": {
            "certificates": false,
            "ca_cert": "~/ssl/ca.pem",
            "private_key": "~/ssl/privateKey.pem",
            "cert": "~/ssl/certificate.pem"
        },
        "protocols": {
            "mqtt": {
                "name": "mqtt",
                "port": 1883,
                "topic_name": "/sensor/data",
                "method": null,
                "telemetry_keys":["serialNumber", "deviceName", "deviceType", "deviceModel"],
                "security": {
                    "credentials": false,
                    "username": "username",
                    "password": "password"
                },
                "advanced_security": {
                    "certificates": false,
                    "ca_cert": "~/ssl/cert.pem"
                }
            },
            "http": {
                "name": "http",
                "port": 5000,
                "topic_name": "/devices",
                "method": "post",
                "telemetry_keys":["serialNumber", "deviceName", "deviceType", "deviceModel"],
                "security": {
                    "credentials": false,
                    "username": "username",
                    "password": "password"
                },
                "advanced_security": {
                    "certificates": false,
                    "cert": "~/ssl/cert.pem",
                    "key": "~/ssl/key.pem"
                }
            },
            "modbus": {
                
            }
        }
    },
    "generator": {
        "default_keys": ["temp", "hum", "custom"],
        "telemetry_keys":["serialNumber", "deviceName", "deviceType", "deviceModel"],
        "value_types": {
            "RFN-1": {
                "value_list":  [-0.01, 0, 0.01],
                "format": "{0:.3f}"
            },
            "RFN-2": {
                "value_list":  [-0.05, 0, 0.05],
                "format": "{0:.3f}"
            },
            "RFN-3": {
                "value_list":  [-0.1, 0, 0.1],
                "format": "{0:.2f}"
            },
            "RFN-4": {
                "value_list":  [-0.5, 0, 0.5],
                "format": "{0:.2f}"
            },
            "RN": {
                "value_list":  [-1, 0, 1],
                "format": "{0:.0f}"
            },
            "CN": {
                "value_list":  [0],
                "format": "{0:.0f}"
            }
        }
    }
}

default "./iotwin_data_generator/data/devices.json" file

{
    "devices": [
 
    ]
}

Screenshots

Main Window
main_window

"Add New Device" Dialog
add_dialog

Roadmap

  • Code Optimization
  • Advanced Security
  • More Protocol Support
  • Command Dialog
  • Testing

License

Licensed under the MIT License 2022 - Murat Alkan

[Back to top]

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.9%
  • Shell 0.1%