No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

AR500, AR510, and AR530 V200R007 Commands Reference

This document describes all the configuration commands of the device, including the command function, syntax, parameters, views, default level, usage guidelines, examples, and related commands.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
GPIO Interface Configuration Commands

GPIO Interface Configuration Commands

NOTE:

The AR502G-L-D-H, AR502GR-L-D-H supports GPIO interfaces that can function as both DI and DO interfaces.

The AR530 series support only DI interfaces.

di state

Function

The di state command displays the level input status of a DI interface.

By default, the level input status of DI 0, DI 1, and DI 2 is low level, and that of DI 3, DI 4, and DI 5 is high level.

NOTE:

Only the AR502G-L-D-H, AR502GR-L-D-H support this command.

Format

di gpio-id state

Parameters

Parameter

Description

Value

gpio-id

Specifies the ID of a digital input channel.

The value is an integer ranging from 0 to 5.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

A DI interface receives level signals from an external device. You can run this command to view the status of received level signals on the DI interface. If the level signal status changes, the AR router reports an alarm to the network management system.

You can run the display di command to view the level input status of all DI interfaces.

Prerequisites

On the GPIO interface has been configured to work as a DI interface using the gpio mode command.

Example

# Display the level input status of DI channel 0.

<Huawei> system-view
[Huawei] di 0 state
 GPIO 0 mode: di state: high    
Table 4-23  Description of the di state command output

Item

Description

GPIO 0 mode: di state: high

Level input status of a DI interface.
  • high: high level
  • low: low level

display gpio

Function

The display gpio command displays the working mode and level status of all GPIO interfaces.

NOTE:

Only the AR502G-L-D-H, AR502GR-L-D-H support this command.

Format

display { gpio | di | do }

Parameters

Parameter

Description

Value

di

Displays the level input status of all DI interfaces.

-

do

Displays the level output status of all DO interfaces.

-

Views

System view

Default Level

2: Configuration level

Usage Guidelines

None.

Example

# Display the working mode and level status of all GPIO interfaces.

<Huawei> system-view
[Huawei] display gpio
 GPIO 0 mode: do state: high
 GPIO 1 mode: di state: high
 GPIO 2 mode: di state: high
 GPIO 3 mode: di state: high
 GPIO 4 mode: di state: high
 GPIO 5 mode: di state: high
Table 4-24  Description of the display gpio command output

Item

Description

GPIO 0 mode

Working mode of a GPIO interface.
  • di: DI mode
  • do: DO mode

To set the working mode of a GPIO interface, run the gpio mode command.

state

Level input or output status of a GPIO interface.
  • high: high level
  • low: low level

To set the level output status of a DO interface, run the do command.

# Display the level input status of all DI interfaces.

<Huawei> system-view
[Huawei] display di
 GPIO 1 mode: di state: high
 GPIO 2 mode: di state: high
 GPIO 3 mode: di state: high
 GPIO 4 mode: di state: high
 GPIO 5 mode: di state: high

# Display the level output status of all DO interfaces.

<Huawei> system-view
[Huawei] display do
 GPIO 0 mode: do state: high
Related Topics

do

Function

The do command configures the level output status of a DO interface.

By default, the level output status of a DO interface is high level.

NOTE:

Only the AR502G-L-D-H, AR502GR-L-D-H support this command.

Format

do gpio-id { low | high }

Parameters

Parameter

Description

Value

gpio-id

Specifies the ID of a digital output channel.

The value is an integer ranging from 0 to 5.

low

Sets the level output status to low level.

-

high

Sets the level output status to high level.

-

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

A DO interface sends low and high level signals to turn on or off an external device. You can run this command to configure the status of level signals sent from the DO interface to the external device.

You can run the display do command to view the level output status of all DO interfaces.

Prerequisites

On the GPIO interface has been configured to work as a DO interface using the gpio mode command.

Example

# Set the level output status of DO channel 0 to low level.

<Huawei> system-view
[Huawei] do 0 low

gpio mode

Function

The gpio mode command configures the working mode of a GPIO interface.

By default, a GPIO interface works as a DI interface.

NOTE:

Only the AR502G-L-D-H, AR502GR-L-D-H support this command.

Format

gpio mode gpio-id { di | do [ low | high ] }

Parameters

Parameter

Description

Value

gpio-id

Specifies the GPIO channel ID.

The value is an integer that ranges from 0 to 5.

di

Configures the GPIO interface to work as a DI interface.

-

do

Configures the GPIO interface to work as a DO interface.

By default, the level output status of a DO interface is high level.

-

low

Sets the level output status to low level.

-

high

Sets the level output status to high level.

-

Views

System view

Default Level

2: Configuration level

Usage Guidelines

A GPIO interface can function as a digital input (DI) interface to monitor the level signal status of an external device connected to it. It can also function as a digital output (DO) interface to send low and high level signals to turn on or off the external device.

You can run the display gpio command to view the working mode and level status of all GPIO interfaces.

Example

# Set the working mode of GPIO channel 0 to DO mode and the level output status to low level.

<Huawei> system-view
[Huawei] gpio mode 0 do low
Related Topics

set di connect

Function

The set di connect command configures the type of the relay connected to the DI interface.

The undo set di connect command clears the configured type of the relay connected to the DI interface.

By default, the type of the relay connected to the DI interface is not configured.

NOTE:

Only the AR530 series supports this command.

Format

set di di-id connect { ac | battery }

undo set di di-id connect

Parameters

Parameter

Description

Value

di-id

Specifies the DI channel ID.

The value is 0 or 1.

ac

Indicates that the DI interface connects to an AC relay to monitor the AC power status.

-

battery

Indicates that the DI interface connects to a DC relay to monitor the DC power status.

-

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The DI interface connects to the power supply through a relay. By default, the device does not generate an alarm when the status of the power supply connected to the DI interface changes. The power status cannot be monitored. You can run the set di connect command to configure the type of the relay connected to the DI interface and enable the alarm function of monitoring the corresponding power status. When the relay detects that the power status is abnormal, it sends high level signals to the DI interface, triggering the hwGpioDIFailure alarm. When the relay detects that the power supply restores to the normal state, it sends low level signals to the DI interface, triggering the hwGpioDIRecovery alarm.
  • When the DI interface connects to an AC relay, you can run the set di di-id connect ac command to monitor the AC power status. When the AC power is disconnected, the device sends the hwGpioDIFailure alarm to the NMS, and the value of Reason is 1.

  • When the DI interface connects to a DC relay, you can run the set di di-id connect battery command to monitor the DC power status. When the DC power voltage is too low, the device sends the hwGpioDIFailure alarm to the NMS, and the value of Reason is 2.

Precautions

The DI interface can correctly monitor the status of the connected power supply only when the configured relay type is the same as the type of the actually connected power supply. The device then can send alarms to the NMS when the power status is abnormal.

Example

# Configure DI channel 0 to connect to an AC relay.

<Huawei> system-view
[Huawei] set di 0 connect ac
Translation
Download
Updated: 2019-05-29

Document ID: EDOC1000097293

Views: 90306

Downloads: 124

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next