Quick Details

Property Value
Program Name agent_switch
Agent Name switch
File agent_switch.cpp
Hardware Power Distribution Unit (PDU)

Description

The switch agent (aka agent_switch) is an agent that provides control to the switched lines in the EPS power distribution unit (PDU). Little is actually done inside of the main loop of this agent, as most functionality is performed through requests.

The PDU switched lines are controlled using several of the BeagleBone's GPIO pins. The switch agent internally either sets a GPIO pin HIGH to enable a switched line, or sets a GPIO pin LOW to disable it.

Pin Mapping

Below is a table showing which GPIO pins control which switched lines:

Switch Name ID Number Physical Device GPIO Pin PC104 Header Pin PDU Switched Line
sw_heater 0 Heater TODO TODO TODO
sw_temp 1 Temperature Sensors TODO TODO TODO
sw_ss 2 Sun Sensors TODO TODO TODO

Requests

Usage: switch [on | off]
Aliases: state set get

Description: Enables, disables, or displays information for a given switch.

The first argument corresponds to the name of the switch

The second argument is optional:

  • If on is given, the agent will turn on the given switch.
  • If off is given, the agent will turn off the given switch.

If the second argument is not supplied, the status of the switch will be returned.

Usage: list

Description: Lists available switches.

COSMOS Names

Devices

Device Property Storage Type COSMOS Name
Switch
(Heater)
UTC double or Time device_swch_utc_000
Enabled bool device_swch_enabled_000
Voltage float device_swch_volt_000
Switch
(Temperature Sensors)
UTC double or Time device_swch_utc_001
Enabled bool device_swch_enabled_001
Voltage float device_swch_volt_001
Switch
(Sun Sensors)
UTC double or Time device_swch_utc_002
Enabled bool device_swch_enabled_002
Voltage float device_swch_volt_002

Block Diagram

Below is a software diagram demonstrating the behavior of this agent Agent block diagram
Tags: