---
title: usbpowercontrol
slug: develop/usbpowercontrol
docTags: 
createdAt: 2025-03-27T16:58:57.010Z
---

The *usbpowercontrol* object is used to control the power of the USB port for specific supported platforms. The supported platforms are XT1144, XD1034, AU325, and AU335.  This object is available on BrightSignOS 8.2.20 and above.

**usbpowercontrol IDL**

```javascript
interface UsbPowerControl {
    Promise<void> powerCyclePort(String friendly_name);
    Promise<void> powerCycleAllPorts();
    Promise<void> portPowerOn(String friendly_name);
    Promise<void> portPowerOff(String friendly_name);
};
```

## Object Creation

```javascript
var UsbPowerControlClass = require("@brightsign/usbpowercontrol");
var usbPowerControl = new UsbPowerControlClass();
```

## usbpowercontrol

Use this interface to control power on USB ports.

**powerCyclePort()**

```javascript
Promise<void> powerCyclePort(String friendly_name)
```

Allows you to power cycle the VBus on a device that may be stuck on a specific port.

- `friendly_name` <font color="#6554c0">string</font>: The friendly name of the specific USB port.  Please refer to the table below to map friendly names to supported platforms. For example, call `usbPowerControl.powerCyclePort("USB:A")` to turn the USB power on port 1 of AU325 off and on again.

| **Platform**   | **USB**          | **Friendly Name**                                          |
| -------------- | ---------------- | ---------------------------------------------------------- |
| AU325          | 1, 2, 3, 4, 5, 6 | "USB\:A", "USB\:B", "USB\:C", "USB\:D", "USB\:E", "USB\:F" |
| AU335          | Type-C           | "USB\:A"                                                   |
| XD1034, XT1144 | Type-C, Type-A   | "USB\:A", "USB\:B"                                         |

**powerCycleAllPorts()**

```javascript
Promise<void> powerCycleAllPorts()
```

Call `usbPowerControl.powerCycleAllPorts()` to turn the power off and on for all USB ports and power cycle all plugged in devices.

**portPowerOn()**

```javascript
Promise<void> portPowerOn(String friendly_name)
```

Allows you to power on the specified port. 

- `friendly_name` <font color="#6554c0">string</font>: The friendly name of the specific USB port. Please refer to the table above to map friendly names on supported platforms.

**portPowerOff()**

```javascript
Promise<void> portPowerOff(String friendly_name)
```

Allows you to power off the specified port. 

- `friendly_name` <font color="#6554c0">string</font>: The friendly name of the specific USB port.  Please refer to the table above to map friendly names on supported platforms.

## Example

This example power cycles USB\:A and USB\:B ports:

```javascript
const UsbPowerControlClass = require("@brightsign/usbpowercontrol");
const usbPowerControl = new UsbPowerControlClass();

let promise = usbPowerControl.portPowerOff("USB:A");
promise.then(function(){
        console.log("A is turned off");
        return usbPowerControl.portPowerOff("USB:B");
}).then(function(){
        console.log("B is turned off");
        return usbPowerControl.portPowerOn("USB:A");
}).then(function(){
        console.log("A is back on");
        return usbPowerControl.portPowerOn("USB:B");
}).then(function(){
        console.log("B is back on" );
}).catch(function(err){
        console.log("error");
});
```

