Quick Start Guide¶
To get started with BrainD, follow these steps:
Install BrainD following the Installation Guide.
Connect an Acroname product with a valid Software License installed. For this guide, a USBHub3c will be used, with serial number
F7A9DFC6
.Start BrainD by selecting it in the Start Menu under “Acroname” (Windows) or from the Applications directory (Mac). An icon will appear in the system taskbar.
The BrainD service is now running. The RESTful API is available at
http://127.0.0.1:9005
. See the following sections for example usage. Additional examples are in the documentation for each RESTful endpoint.
GET Example - Get Version¶
The version of software that is running can be read by issuing a GET request to the version
endpoint.
curl -H 'Accept: application/json' http://127.0.0.1:9005/api/v1/version
import requests
import json
response = requests.get('http://127.0.0.1:9005/api/v1/version')
json_data = response.json()
print(json.dumps(json_data, indent=3))
The resulting return of the version will return the following JSON body.
1{
2 "braind": {
3 "version": {
4 "major": 1,
5 "minor": 0,
6 "patch": 0
7 },
8 "buildDate": "Thu Aug 24 13:58:24 2023",
9 "buildHash": "d38f0a1dd5f8daa2c8cd0a0170fee8210d1356b4"
10 },
11 "brainstem": {
12 "version": {
13 "major": 2,
14 "minor": 10,
15 "patch": 0
16 },
17 "buildDate": "2023-09-08T19:03:10Z",
18 "buildHash": "7af9c07e44601d6987fe3dab0ea201a13609683e"
19 }
20}
PUT Example - Set BrainStem Port Off¶
BrainD is designed to manage and manipulate Acroname products through the RESTful API
curl -X PUT http://127.0.0.1:9005/api/v1/brainstem/F7A9DFC6/port/1/enabled -H 'Content-Type: application/json' -d '{"value": 0}'
import requests
import json
response = requests.put('http://127.0.0.1:9005/api/v1/brainstem/F7A9DFC6/port/1/enabled', json={'value': 0})
json_data = response.json()
print(json.dumps(json_data, indent=3))
The resulting return of the version will return the following JSON body.
1{
2 "timestamp": "2023-09-18T04:43:09.813Z",
3 "request": {
4 "endpointName": "/api/v1/brainstem/F7A9DFC6/port/1/enabled",
5 "parameters": {
6 "value": 0
7 }
8 },
9 "response": {}
10}
GET Example - Get BrainStem Port 2 Vbus Voltage¶
curl http://127.0.0.1:9005/api/v1/brainstem/F7A9DFC6/port/2/VbusVoltage
import requests
import json
response = requests.put('http://127.0.0.1:9005/api/v1/brainstem/F7A9DFC6/port/2/VbusVoltage')
json_data = response.json()
print(json.dumps(json_data, indent=3))
1{
2 "timestamp": "2023-09-18T04:56:16.639Z",
3 "request": {
4 "endpointName": "/api/v1/brainstem/F7A9DFC6/port/2/VbusVoltage",
5 "parameters": {}
6 },
7 "response": {
8 "value": 5100097,
9 "rawValue": 5100097
10 }
11}