Skip to content

CoreserverConsole

Eric Pinet edited this page May 29, 2016 · 4 revisions

Coreserver console

The SSH console in a command line interface to controle the ConnectLife Coreserver.

Use a SSH client to connect the coreserver console. The default port is 9008 and the default username is admin and password is admin. The default hostname of this coreserver is connectlife.

To connect on console execute this command in bash :

ssh -l admin -p 9008 connectlife

If the connection is succesfull the Coreserver will show the welcome message :

ConnectLife - CoreServer 1.0.0.0
****************************************************
*        Welcome to ConnectLife Shell              *
****************************************************

List of available command

add accessory

Adding accessory in a room. An accessory can be link in only one room. When an accessory is linked in a room, all change will affect the environment data and all listener will be notified on update.

add accessory [accessory serial number][room uid]
add accessory [10][20]
Accessory added.

exit

Exit the console cli. You can use also "quit" for the same result.

exit

help

Show all command available in the console cli.

help
exit - exit console cli.
help - show all commands.
output all config - return the configurations of the system.
output config - return the specific configuration of the system.
output env - output the system environment (JSON).
output env formatted - output the system environment (JSON formatted).
output log - Output the log of the system.
quit - quit console cli.
add accessory - Add accessory in the environment.
restore factory config - Restore the factory configurations of the system.
save env - save the environment file if it's not already saved.
set config - Modify the configuration of the system.
shutdown - shutdown the system.
remove accessory - Remove accessory in the environment.
version - return the version of the system.

output all config

Return all configurations of the system and current values.

output all config
APISERVER            TCPIP_PORT           INTEGER              9006                
APISERVER            TCPIP_PORT_SECURE    INTEGER              9007                
APISERVER            ADMIN_USERNAME       STRING               admin               
APISERVER            ADMIN_PASSWORD       STRING               admin               
CONSOLE              TCPIP_PORT           INTEGER              9008                
CONSOLE              ADMIN_USERNAME       STRING               admin               
CONSOLE              ADMIN_PASSWORD       STRING               admin               

output config

Return the value of one config of the system.

output config [APISERVER][TCPIP_PORT]
APISERVER            TCPIP_PORT           INTEGER              9006 

output env

Output the system environment (JSON)

output env
{"version":0,"persons":[{"uid":"972e5a5b-25ae-4e7b-a774-815b01a3c50e","firstname":"Eric","lastname":"Pinet","emails":[{"uid":"dc45d166-e5c1-40e9-88f6-45feea03024a","email":"[email protected]","type":"PERSONAL"},{"uid":"836192f0-9007-40c7-81d4-4ddfcaf48a40","email":"[email protected]","type":"WORK"},{"uid":"c5548017-c6bc-4398-9b7b-064bbd677b83","email":"[email protected]","type":"OTHER"}],"phones":[{"uid":"a6e842b8-0a57-44a1-99f0-5a620407ce3e","phone":"418 998-2481","type":"CELL"},{"uid":"5d56e2c5-7d1c-4037-84e7-143f1923b843","phone":"418 548-1684","type":"OTHER"}],"addresses":[{"uid":"3183a70f-24a4-481f-8e50-9650cbff6088","type":"HOME","street":"2353 rue du cuir","city":"Québec","region":"Québec","zipcode":"G3E0G3","country":"Canada"}]},{"uid":"91d80266-0e8f-49d0-9bf2-447480fecfb8","firstname":"Qiaomei","lastname":"Wang","emails":[{"uid":"1ce00bfb-4e0a-4d50-a564-2aa8360e32f8","email":"[email protected]","type":"PERSONAL"},{"uid":"fbb5912a-e337-4603-8a8b-47e1a40d43d0","email":"[email protected]","type":"WORK"}],"phones":[{"uid":"ac5e34b5-7099-4c12-a04c-682f9b635c47","phone":"438 348-1699","type":"CELL"}],"addresses":[{"uid":"50e12640-10f1-4248-b535-10441f545b25","type":"HOME","street":"2353 rue du cuir","city":"Québec","region":"Québec","zipcode":"G3E0G3","country":"Canada"}]}],"homes":[{"uid":"ccf50e38-4220-4185-ade4-d7d67aa71bb2","label":"Home","zones":[{"uid":"6e7e987b-8953-4257-bf24-37c2c9b7ec5a","label":"First floor","rooms":[{"uid":"051ad593-c9f1-4cd4-9645-f3f80d7e7c25","label":"Leving room","accessories":[{"uid":"09645780-4718-4436-acd1-c7bf04477841","label":"Light","manufacturer":"Philips","model":"100w","serialnumber":"PL001-100-10009","services":[{"uid":"6907bbad-adb4-4b15-94dc-cc5838636511","name":"Light","characteristics":[{"uid":"5529bfbe-7832-4bb7-82ce-d2a9484188cc","label":"Light","mode":"READ_WRITE","type":"BOOLEAN","event":"EVENT","data":"false"},{"uid":"f86a371c-3dff-4d6b-8f2e-30158ba81b39","label":"Dimmable","mode":"READ_WRITE","type":"FLOAT","event":"EVENT","data":"1.0"}]}],"imageurl":"","type":"LIGHT_COLORED_DIMMABLE","protocoltype":"JSON_SIMULATION","isRegister":false}]}]}]}]}

output env

Output the system environment (JSON)

output env formatted
{
  "persons": [
    {
      "uid": "1",
      "firstname": "Eric",
      "lastname": "Pinet",
      "emails": [
        {
          "uid": "1.1",
          "email": "[email protected]",
          "type": "PERSONAL"
        },
        {
          "uid": "1.2",
          "email": "[email protected]",
          "type": "WORK"
        },
        {
          "uid": "1.3",
          "email": "[email protected]",
          "type": "OTHER"
        }
      ],
      "phones": [
        {
          "uid": "1.4",
          "phone": "418 998-2481",
          "type": "CELL"
        },
        {
          "uid": "1.5",
          "phone": "418 548-1684",
          "type": "OTHER"
        }
      ],
      "addresses": [
        {
          "uid": "1.6",
          "type": "HOME",
          "street": "2353 rue du cuir",
          "city": "Québec",
          "region": "Québec",
          "zipcode": "G3E0G3",
          "country": "Canada"
        }
      ]
    },
    {
      "uid": "2",
      "firstname": "Qiaomei",
      "lastname": "Wang",
      "emails": [
        {
          "uid": "2.1",
          "email": "[email protected]",
          "type": "PERSONAL"
        },
        {
          "uid": "2.2",
          "email": "[email protected]",
          "type": "WORK"
        }
      ],
      "phones": [
        {
          "uid": "2.3",
          "phone": "438 348-1699",
          "type": "CELL"
        }
      ],
      "addresses": [
        {
          "uid": "2.4",
          "type": "HOME",
          "street": "2353 rue du cuir",
          "city": "Québec",
          "region": "Québec",
          "zipcode": "G3E0G3",
          "country": "Canada"
        }
      ]
    }
  ],
  "homes": [
    {
      "uid": "7",
      "label": "Home",
      "zones": [
        {
          "uid": "6",
          "label": "First floor",
          "rooms": [
            {
              "uid": "5",
              "label": "Leving room",
              "accessories": [
                {
                  "uid": "4",
                  "label": "Light",
                  "manufacturer": "Philips",
                  "model": "100w",
                  "serialnumber": "PL001-100-10009",
                  "services": [
                    {
                      "uid": "3",
                      "name": "Light",
                      "characteristics": [
                        {
                          "uid": "3.1",
                          "label": "Light",
                          "mode": "READ_WRITE",
                          "type": "BOOLEAN",
                          "event": "EVENT",
                          "data": "false"
                        },
                        {
                          "uid": "3.2",
                          "label": "Dimmable",
                          "mode": "READ_WRITE",
                          "type": "FLOAT",
                          "event": "EVENT",
                          "data": "1.0"
                        }
                      ]
                    }
                  ],
                  "imageurl": "",
                  "type": "LIGHT_COLORED_DIMMABLE",
                  "protocoltype": "JSON_SIMULATION",
                  "isRegister": false
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

output log

Output log of the system.

output log
21:13:24.817 [main] DEBUG - com.connectlife.coreserver.Application - Application constructor.
21:13:24.825 [main] INFO  - com.connectlife.coreserver.Application - ConnectLife - CoreServer 1.0.0.0 is starting ...
21:13:24.825 [main] INFO  - com.connectlife.coreserver.Application - Initialization started ...
21:13:24.825 [main] INFO  - com.connectlife.coreserver.Application - Base path: '/Users/connectlife/coreserver'.
21:13:24.825 [main] INFO  - com.connectlife.coreserver.config.ConfigSqlite - Initialization in progress ...
21:13:24.831 [main] INFO  - com.connectlife.coreserver.config.ConfigSqlite - Load database file 'data/config.sqlite'
21:13:25.033 [main] INFO  - com.connectlife.coreserver.config.ConfigSqlite - Set database default timeout '30'

restore factory config

Restore the factory configurations of the system.

restore factory config
The Configurations are restored.

save env

Force a save of the environment data.

save env
Environment saved.

set config

Change the value of one config.

set config [APISERVER][TCPIP_PORT] 9006
Config is updated.

shutdown

Shutdown the system. (After a shutdown, the system will automaticaly reboot).

shutdown

version

Return version number of the server.

version
ConnectLife - CoreServer 1.0.0.0