Install the GTB network simulator

Organ recovery

Download the repository via GitHub

https://github.com/spinalcom/spinal-organ-network_sample

Then extract the deposit on the file spinalsystem/organs

$> unzip organ.zip -d "/path/to/spinalsystem/organs"

Or in CLI

spinalsystem $> cd organs

spinalsystem/organs $> git clone https://github.com/spinalcom/spinal-organ-network_sample

Configuration

The configuration file is : spinalsystem/organs/spinal-organ-network_sample/config.json5

It will be necessary to modify the configuration to add the elements allowing the organ to connect to the BOS datahub, to access the targeted digital twin then to retrieve or create the "network context" and its subgraph.

{
spinalConnector: {

user: 168, // spinalcom system identifiant utilisateur (un nombre)
password: "A_CHANGER", // spinalcom system mot de passe utilisateur
host: "localhost", // spinalcom system adresse IP du hub, peux être une adresse IP
port: 7777 // spinalcom system port du hub
},
file: { // path to a digital twin in spinalhub filesystem
path: '/__users__/admin/shared_with_me/DEI'
},
organ: {
contextName: "Network", // sélectionnez le bon contexte IoT ou BMS network
contextType: "Network", // ne pas toucher
networkType: "SubNetwork", // le type du sous network
networkName: "NetworkVirtual" // le nom du sous network (par exemple BacnetIP, SNMP, ModbusIP...)
}
}


Configuration for pm2

To add the organ in the list of processes followed by PM2, you will have to modify the file

spinalsystem/.apps.json as explained below :

{
"apps": [
{
"name": "spinal-core-hub",
"script": "spinalhub.js",
"cwd": "./nerve-center/"
},
...
{
"name": "spinal-organ-network_sample",
"script": "index.js",
"cwd": "organs/spinal-organ-network_sample"
}
]
}

Start the system

once the organ added to the file .apps.json, it is possible to launch it with the other organs as follows:

pm2 start launch.config.js

ou pm2 restart launch.config.js // si votre système est déja lancé

The simulator is set to send data every 3 to 5 minutes. It will surely be necessary to wait a little before seeing the first time-series appear.