Xnergy Charger Control Demo

How to use code

Please use python3

  • pip3 install -r requirements.txt
  • python3 app.py PORT

packaging

poetry install --no-root --all-groups
poetry run nuitka --standalone --onefile --windows-icon-from-ico="C:\PATH\TO\xnergy_favicon.ico" .\app.py
poetry run pyinstaller --onefile --icon="C:\PATH\TO\xnergy_favicon.ico" .\app.py

pyinstaller will be faster than nuitka, but sometimes the executable file generated by pyinstaller may be treated as a virus by some antivirus software.

English Instructions

The Xnergy Charger Control Demo is a tool designed to control Xnergy chargers via RS485 serial communication. This program allows users to set the interval time and repetition count for charging cycles, making it ideal for testing and demonstration purposes.

Command Syntax

xnergy-example.exe [-h] [-i INTERVAL] [-r REPEAT] [-q] [-v] port

Positional Arguments

  • port (Required): The serial port device (e.g., COM3, /dev/ttyUSB0) connected to the Xnergy RCU.

Optional Arguments

  • -h, --help: Show this help message and exit.
  • -i INTERVAL, --interval INTERVAL: Time interval (in seconds) between charger on/off cycles. Default is 1800 seconds (30 minutes).
  • -r REPEAT, --repeat REPEAT: Number of times to repeat the charging cycle. Default is 1.
  • -q, --quiet: Quiet mode. Suppress all output messages.
  • -v, --version: Show program version number and exit.

Usage Examples

  1. Basic usage: xnergy-example.exe COM3
    Controls the charger via COM3 using default interval and 1 repetition.

  2. Custom interval and repeats: xnergy-example.exe -i 3600 -r 5 COM5
    Controls the charger via COM5 with a 1-hour interval and 5 repetitions.

  3. Quiet mode: xnergy-example.exe -q COM5
    Runs on COM5 without displaying any output.

Xnergy充电器控制演示程序说明

中文说明

Xnergy充电器控制演示程序是一个用于控制Xnergy充电器的工具通过RS485串口与充电器通信。该程序允许用户设置充电周期的间隔时间和重复次数适用于测试和演示场景。

命令格式

xnergy-example.exe [-h] [-i INTERVAL] [-r REPEAT] [-q] [-v] port

参数说明

  • port必需连接到Xnergy RCU的串口设备名称如COM3、/dev/ttyUSB0

可选参数

  • -h, --help:显示此帮助信息并退出。
  • -i INTERVAL, --interval INTERVAL充电器开关切换的间隔时间默认1800秒30分钟
  • -r REPEAT, --repeat REPEAT充电周期的重复次数默认1次。
  • -q, --quiet:安静模式,抑制所有输出信息。
  • -v, --version:显示程序版本号并退出。

使用示例

  1. 基本用法:xnergy-example.exe COM3
    通过COM3端口控制充电器使用默认间隔时间和1次重复。

  2. 自定义间隔和重复次数:xnergy-example.exe -i 3600 -r 5 COM5
    通过COM5端口控制充电器设置间隔为1小时重复5次。

  3. 安静模式:xnergy-example.exe -q COM5
    在COM5端口上运行不显示任何输出信息。

Description
No description provided
Readme 413 KiB
2025-05-15 15:48:06 +08:00
Languages
Python 100%