Unicon-eLux-Checking Power Supply Status on eLux RP6 and eLux 7 Devices

book

Article ID: CTX695756

calendar_today

Updated On:

Description

 

  • Issue: Administrators need to check if an eLux device is powered by an external supply or battery.

  • Command Behavior:

    • Returns 0 → device is running on battery.

    • Returns 1 → device is connected to power supply.

  • Custom Script:

    • A shell script can be created to output clear text messages instead of numeric values.

    • Example:

      #!/bin/bash
      if [ -e /sys/class/power_supply/AC/online ]; then
          power_status=$(cat /sys/class/power_supply/AC/online)
      else
          power_status=1
      fi
      
      if [ "$power_status" -eq 1 ]; then
          echo "Power is connected"
      else
          echo "Power is not connected"
      fi
      
  • Result: Script outputs either “Power is connected” or “Power is not connected”.

  • Notes:

    • Script can be modified as needed.

    • Useful for monitoring and troubleshooting power status on eLux RP6 and eLux 7 devices.

Cause

By default, eLux devices do not provide a direct GUI indicator for power source status. Administrators must use terminal commands or scripts to determine whether the device is running on battery or connected to external power.

Resolution

 

  1. Run Command in Terminal:

     
    if [ -e /sys/class/power_supply/AC/online ]; then cat /sys/class/power_supply/AC/online; else echo 1; fi
    
    • Output 0 → battery mode.

    • Output 1 → power supply connected.

  2. Optional – Use Custom Script:

    • Create a shell script as shown above.

    • Deploy script for easier monitoring with text-based output.

Result: 
image.png

Issue/Introduction

On eLux RP6 and eLux 7 devices, you can determine whether the device is connected to external power or running on battery using a simple terminal command. A custom shell script can also be used to display the status in text form for easier monitoring.