3. Config add devices#
Blueapi is highly configurable. The config details aspects that impact how Blueapi works and it is customisable.
As a first step, create a config.yaml file. This would be best placed in the docs/resources folder.
Initially, add devices using the following code:
env:
metadata:
instrument: demo
sources:
- kind: deviceManager
module: blueapi.tutorial.devices
The env section of the config.yaml file lets you create and set environment variables. The demo points to optional dependencies in the pyproject.toml file. The module above points to the devices you will use for this tutorial which can be found here.
Save the file and restart the worker to use this new config.yaml file you have created. To do this, navigate back to the terminal window where the worker is running, CTRL+C to close it then run the following command:
blueapi --config docs/resources/config.yaml serve
The above command assumes you created the config.yaml file in docs/resources. Else, replace docs/resources/config.yaml with whichever file path your config.yaml has.
Now run
blueapi controller devices in the same terminal window as you did when previously running this command and you should see det and stage.