Monitor device status
The device status can be checked physically, using the OPTION button and the status indicators on the front panel. The battery charge and the connected devices are also accessible from within Bonsai when you need to log them alongside your data or use the information in a workflow.
This article covers how to check the battery charge, configure the battery telemetry rate, visualize the battery events, and check the connected devices in Bonsai.
The complete workflow is shown below. Copy and paste it into Bonsai to get started immediately, or build each section by following the step-by-step instructions in the following sections.
Check battery charge
The Battery register holds the battery voltage, averaged by the firmware over the last 16 one-second samples. It can be read on demand at any time, even when the periodic battery events (covered in the next section) are disabled. The battery reading is reported as a Battery event, which we will cover in a later section.
- Insert a
KeyDownoperator and set theFilterproperty toA. - Insert a
CreateMessageoperator and configure the following properties:MessageType- SelectRead.Payload- SelectBatteryPayload.Battery- Leave at the default, the payload value is ignored by the device for a read request.
- Insert a
MulticastSubjectoperator namedTimestampGeneratorGen3 Commands.
Configure the battery rate
Alternatively, you can configure BatteryRate to make the device report the Battery event at regular intervals. We will cover how to visualize the Battery event in the next section.
- Insert a
KeyDownoperator and set theFilterproperty toS. - Insert a
CreateMessageoperator and configure the following properties:Payload- SelectBatteryRatePayload.BatteryRate- Select the reporting rate for the event (e.g.EverySecond). To stop the events in the future, selectNever.
- Insert a
MulticastSubjectoperator namedTimestampGeneratorGen3 Commands.
Visualize battery events
The device reports the battery voltage as a Battery event stream, both in reply to a read request and at the configured battery rate. The workflow below will show you how to decode and visualize the battery events:
- Insert a
SubscribeSubjectoperator namedTimestampGeneratorGen3 Events. - Insert a
Parseoperator and set theRegisterproperty toTimestampedBattery. - Insert a
VisualizerWindowoperator.
Run the workflow and press A to request the current battery voltage on demand, or press S to set the battery rate and receive a new value at regular intervals. The visualizer will display:
3.71@95.563344
3.71@96.563344
The first number is the battery voltage, in volts, and the second number is the timestamp on the device clock.
Note
If the BATTERY switch is off or the battery isn't detected, a battery read returns zero and no events are reported.
Check connected devices
DevicesConnected reports which clock output ports (Out0–Out5) currently have a device connected.
- Insert a
KeyDownoperator and set theFilterproperty toD. - Insert a
CreateMessageoperator and configure the following properties:MessageType- SelectRead.Payload- SelectDevicesConnectedPayload.DevicesConnected- Leave at the default, the payload value is ignored by the device for a read request.
- Insert a
MulticastSubjectoperator namedTimestampGeneratorGen3 Commands.
In a separate branch:
- Insert a
SubscribeSubjectoperator namedTimestampGeneratorGen3 Events. - Insert a
Parseoperator and set theRegisterproperty toTimestampedDevicesConnected. - Insert a
VisualizerWindowoperator to display the reply.
Run the workflow and press D. The visualizer will display:
Out0, Out2@95.563344
The first part is the set of ports with a device connected, matching the OUT LEDs lit on the front panel, and the number is the timestamp on the device clock.
Documentation for release v1.4.0