ExoEdge Simulator¶
ExoEdge has a simulator source that can be installed with some useful features:
- Maintenance/Telemetrics
- Simulated Data
Installation¶
pip3 install exoedge-simulator
Info
If you are having install issues, installing the following may help:
sudo apt-get install build-essential python-dev
Basic Example¶
To use the simulator, simply set up config_io
along these lines:
config_io
{
"channels": {
"sin_wave": {
"display_name": "Sinusoid",
"description": "Sinusoidal data from ExoEdge ExoSimulator.",
"properties": {
"max": null,
"precision": null,
"data_type": "NUMBER",
"min": null
},
"protocol_config": {
"application": "Simulator",
"report_on_change": false,
"report_rate": 1000,
"sample_rate": 1000,
"down_sample": "ACT",
"app_specific_config": {
"function": "sin_wave",
"parameters": {
"period": 60,
"amplitude": 1,
"offset": 0,
"precision": 2
},
"positionals": []
}
}
}
}
}
Waveform example¶
Another example using the function do_wave
which supports ASDR envelope definitions:
config_io
{
"channels": {
"asdr": {
"display_name": "ASDR",
"description": "An ASDR simulation.",
"properties": {
"max": null,
"precision": null,
"data_type": "NUMBER",
"min": null
},
"protocol_config": {
"application": "Simulator",
"report_on_change": false,
"report_rate": 1000,
"sample_rate": 1000,
"down_sample": "ACT",
"app_specific_config": {
"function": "do_wave",
"parameters": {
"period": 60,
"amplifier": {
"type": "lineargain",
"gain": -3.0,
"offset": 4.0
},
"envelope": {
"attack": 2,
"decay": 0.5,
"sustaint": 2.5,
"sustainl": 6.9,
"release": 7.4,
"gap": 5
},
"precision": 1
},
"positionals": []
}
}
}
}
}
IP Address Function Example¶
Another useful function is the ip_address
function of the simulator:
config_io
{
"channels": {
"ip_address": {
"display_name": "IP Address",
"description": "The IP Address of the gateway.",
"properties": {
"data_type": "STRING"
},
"protocol_config": {
"application": "Simulator",
"report_on_change": true,
"app_specific_config": {
"function": "ip_address",
"module": "exo_simulator",
"parameters": {},
"positionals": ["eth0"]
}
}
}
}
}
Computer Stats - PSUTIL Example¶
If the psutil
module is installed, there are other gateway stats that can be collected as well.
- architecture
- cpu_times_percent
- disk_stats
- machine_type
- net_io
- system_platform
- whoami
config_io
{
"channels": {
"architecture": {
"display_name": "Processor Architecture",
"description": "The Processor Architecture of the gateway.",
"properties": {
"data_type": "STRING"
},
"protocol_config": {
"application": "Simulator",
"report_on_change": true,
"app_specific_config": {
"function": "architecture",
"module": "exo_simulator",
"parameters": {},
"positionals": []
}
}
},
"machine_type": {
"display_name": "Machine Type",
"description": "The Machine Type of the gateway.",
"properties": {
"data_type": "STRING"
},
"protocol_config": {
"application": "Simulator",
"report_on_change": true,
"app_specific_config": {
"function": "machine_type",
"module": "exo_simulator",
"parameters": {},
"positionals": []
}
}
},
"system_platform": {
"display_name": "System Platform",
"description": "The System Platform of the gateway.",
"properties": {
"data_type": "STRING"
},
"protocol_config": {
"application": "ExoSimulator",
"report_on_change": true,
"app_specific_config": {
"function": "system_platform",
"module": "exo_simulator",
"parameters": {},
"positionals": []
}
}
},
"python_version": {
"display_name": "Python Version",
"description": "The Python Version of the gateway.",
"properties": {
"data_type": "STRING"
},
"protocol_config": {
"application": "Simulator",
"report_on_change": true,
"app_specific_config": {
"function": "python_version",
"module": "exo_simulator",
"parameters": {},
"positionals": []
}
}
},
"whoami": {
"display_name": "Current User",
"description": "The Current User of the edged process.",
"properties": {
"data_type": "STRING"
},
"protocol_config": {
"application": "Simulator",
"report_on_change": true,
"app_specific_config": {
"function": "whoami",
"module": "exo_simulator",
"parameters": {},
"positionals": []
}
}
},
"net_io": {
"display_name": "NetIO",
"description": "Network statistics of the gateway.",
"properties": {
"data_type": "JSON"
},
"protocol_config": {
"application": "Simulator",
"report_on_change": false,
"sample_rate": 30000,
"report_rate": 30000,
"app_specific_config": {
"function": "net_io",
"module": "exo_simulator",
"parameters": {},
"positionals": []
}
}
},
"disk_stats": {
"display_name": "Disk Stats",
"description": "Disk usage statistics of the gateway.",
"properties": {
"data_type": "JSON"
},
"protocol_config": {
"application": "ExoSimulator",
"report_on_change": false,
"sample_rate": 30000,
"report_rate": 30000,
"app_specific_config": {
"function": "disk_stats",
"module": "exo_simulator",
"parameters": {},
"positionals": []
}
}
},
"cpu_times_percent": {
"display_name": "CPU Stats",
"description": "CPU usage statistics of the gateway.",
"properties": {
"data_type": "JSON"
},
"protocol_config": {
"application": "Simulator",
"report_on_change": false,
"sample_rate": 30000,
"report_rate": 30000,
"app_specific_config": {
"function": "cpu_times_percent",
"module": "exo_simulator",
"parameters": {
"interval": 1
},
"positionals": []
}
}
},
"exoedge_version": {
"display_name": "ExoEdge Version",
"description": "The ExoEdge Version running on the gateway.",
"properties": {
"data_type": "STRING"
},
"protocol_config": {
"application": "Simulator",
"report_on_change": true,
"app_specific_config": {
"function": "exoedge_version",
"module": "exo_simulator",
"parameters": {},
"positionals": []
}
}
}
}
}