Skip to content

Protocol

DanDayne edited this page Nov 24, 2019 · 6 revisions

The initiation protocol is represented by a Python dictionary and its compulsory structure varies according to the device it initiates.

Each node must have these keys defined:

  • 'experiment_details' -> data which concern all the devices on node are passed here
    • 'sleep_time' -> time period between perirodical measurememts
  • devices -> list of devices as defined below

Example:

{
    int: { # identified by a unique ID
        'experiment_details': {
            'sleep_time': int # how often periodical measurements are executed (seconds)
        },
        'devices': [
            # a list of devices defined below
        ]
    }
    ...
}

Multiple nodes are allowed, but they have to be identified by a unique ID. Each device has to have an arbitrary set of attributes defined. These attributes vary according to the device's type (PBR/GAS/GMS) and class (Java/Phenometrics).

All devices must include:

  • 'device_type' -> one of ['PBR', 'GAS', 'GMS']
  • 'device_class'-> the class of devices which should be used, Java or Phenometrics

PBR's must also include:

  • 'setup'
    • 'lower_outlier_tol' -> the lower percentual tolerance for outliers
    • 'upper_outlier_tol' -> the upper percentual tolerance for outliers
    • 'max_outliers' -> the number of outliers in row considered as correct data
    • 'min_OD' -> the lowest allowed OD value
    • 'max_OD'' -> the highest allowed OD value
    • 'pump_id' -> ID of the pump for PBR
    • 'ft_channel' -> the ft channel for PBR
    • OD_channel' -> the OD channel used stabilisation check

Additionally, all Java dependant devices must include:

  • host_address -> address of the physical device

And all Phenometrics devices must include:

  • 'device_id' -> unique identifier of the device
  • 'encryption_key' -> communication key
  • 'host_port' -> communication key
  • host_address -> address of the physical device

Example

{
    'device_type' : str,
    'device_class' : str, 
    'device_id': str, # 
    'encryption_key': str,
    'host_port': int,
    'host_address': str
    'setup' : {
        'initial_commands' : [commands which should be executed with initialisation (optional)
               { 'time': str, 'cmd_id': int, 'args': list } # id of command and list of its arguments
               # the time is obtained like this - datetime.datetime.utcnow().strftime("%Y-%m-%d, %H:%M:%S")
               ...
        ],
        'lower_outlier_tol' : int,
        'upper_outlier_tol' : int,
        'max_outliers' : int, 
        'min_OD' : float,
        'max_OD' : float,
        'pump_id' : int,
        'ft_channel': int,
        'OD_channel': int,
    }
}
Clone this wiki locally