Skip to content
Matej Troják edited this page Mar 2, 2022 · 6 revisions

Welcome to the DeviceControl wiki!

DeviceControl is a tool to provide unified interface to control and measure data in specific cultivation device.

To learn how to install the tool, we recommend reading installation instructions.

To learn about individual end points provided by the tool, read respective documentation.

Quick start

Assuming DeviceControl is properly installed and running, follow these steps to quickly setup a device and execute a measurement:

import requests

# device configuration
test_PBR_device = {
    'device_id': PBR_id,
    'device_class': 'test',
    'device_type': 'PBR',
    'address': 'null',
}

# register the device
requests.post('http://localhost:5000/device', json=test_PBR_device)

# configuration of a command for measurement of temperature
cmd = {'device_id': PBR_id,
       'command_id': '2',
       'await': True
      }

response = requests.post('http://localhost:5000/command', json=cmd)
print("The current temperature is", response.json()['data']['temp'])
Clone this wiki locally