Linux (Command Line Configuration)

For Linux systems that support the command line (such as FnOS, Debian, Ubuntu, etc.), you can manage the WalleCube Smart UPS by installing the apcupsd daemon. This article will use FnOS as an example to introduce the configuration process.

Introduction

Apcupsd is an open-source UPS daemon that supports Linux, UNIX, macOS, and Windows. It allows computers to interact with UPSes and automatically perform protective actions like shutdown during power anomalies.


Installation Steps

  1. Connect Hardware: Plug one end of the UPS USB signal cable into the UPS and the other end into the NAS or Linux host.
  2. SSH Connection: Connect to your Linux system via SSH and switch to the root user.
  3. Update Software Source:
    1
    
    apt update
    
  4. Install apcupsd:
    1
    
    apt install apcupsd -y
    

Configuration File Modification

Use an editor (such as nano or vi) to modify the configuration file /etc/apcupsd/apcupsd.conf:

1
nano /etc/apcupsd/apcupsd.conf

Find and modify the following key parameters:

  • UPSNAME: Can be changed to your UPS model (e.g., WalleCube).
    1
    
    UPSNAME WalleCube
    
  • POLLTIME: Interval for checking UPS status (default 60 seconds).
    1
    
    POLLTIME 60
    
  • Shutdown Strategy (Shutdown will be triggered if any of the following conditions are met):
    • BATTELEVEL: Shut down when battery is below this percentage (recommended to set to 60).
      1
      
      BATTELEVEL 60
      
    • MINUTES: Shut down when remaining runtime is less than this many minutes (recommended to set to 10).
      1
      
      MINUTES 10
      
    • TIMEOUT: Shut down after the mains power has been interrupted for this many seconds (if you want an immediate countdown to shutdown, it can be set to 600).
      1
      
      TIMEOUT 600
      

After modification, press Ctrl+X, enter Y, and press Enter to save and exit.


Service Management

Execute the following commands to start the service and set it to start on boot:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Start service
systemctl start apcupsd

# Set to start on boot
systemctl enable apcupsd

# Restart service (required after configuration changes)
systemctl restart apcupsd

# View service status
systemctl status apcupsd

Status Verification

After successful installation and configuration, you can use the apcaccess command to view the real-time status of the UPS:

1
apcaccess

If you see STATUS : ONLINE and correct battery charge (BCHARGE) information, the configuration is successful.


References