Monitor Voltronic/Axpert inverter via USB
I and couldn't find another node based solution. But thanks to JosefKrieglstein's python implementation for useful information regarding CRC error in Axpert firmare.
I like node and I have other node based packages I wanted to integrate it with.
It allows direct connection without bothering with RS232 converters.
It was easy to add, so why not?
The general thinking is captured in the design documentation
Locally as dependency
npm i -S axpert-monitor
Globally for CLI interface
npm i -g axpert-monitor
This module has only been tested on Raspbian GNU/Linux 10 (buster).
In order for this module to access hidraw interface, some OS changes are necessary. See full details on the nide-hid library page
A helper script has been added to automate the udev changes. This has only been tested on raspbian.
npm run udev-setup
Or, if the module is globally installed:
axpert-udev-setup
Remeber to add user to dialout group if not already added to allow accessing serial port
sudo useradd <current_user> dialout
Sends any inquiry command via CLI and prints formatted response if a parser is implemented for the query, otherwise the raw string response is printed.
If no connection parameters are specified this will use the USB interface with default VendorID and ProductID values.
- -c, --command: the inquery command to send. Must start with a 'Q'
- -r, --raw: show the raw, unformatted response string, default=false
- -h, --hid: USB HID raw path, e.g. /dev/hidraw1
- -p, --port: Serial port for tty interface, e.g. /dev/ttyUSB0
- -V, --vid: VendorID to use for HID interface, default=0x665
- -P, --pid: ProductID to use for HID interface, default=0x5161
- -t, --timeout: query timeout in MS, default=10000
$ axpert-query -c QPIGS
Sending command: QPIGS
{
"gridVoltage": 234.2,
"gridFrequency": 50,
"outputVoltage": 230.2,
"outputFrequency": 50,
"outputPowerApparent": 437,
"outputPowerActive": 279,
"outputLoadPercent": 8,
"busVoltage": 368,
"batteryVoltage": 52.9,
"batteryChargingCurrent": 0,
"batteryCapacity": 37,
"temperature": 50,
"pvBatteryCurrent": 0,
"pvInputVoltage": 0,
"batteryVoltageSCC": 0,
"batteryDischargeCurrent": 6,
"status": {
"addSBUPriorityVersion": false,
"configChanged": false,
"sccFirmwareUpdates": false,
"loadOn": true,
"batteryVoltToSteady": false,
"charging": false,
"chargingSCC": false,
"chargingAC": false
},
"pvPower": 241
}
$ axpert-query -c QPIGS -r -p /dev/ttyUSB0
Sending command: QPIGS
235.9 50.1 231.7 50.1 0344 0272 006 368 52.90 000 037 0050 0000 000.0 00.00 00005 00010000 00 00 00000 010
Sends a set command via CLI and returns the respose - ACK if successful, NACK if command failed.
If no connection parameters are specified this will use the USB interface with default VendorID and ProductID values.
- -c, --command: the set command to send. Typically starts with a 'P', 'M' or 'F'
- -v, --value: the value to set. The string is used directly so make sure it is correct
- -h, --hid: USB HID raw path, e.g. /dev/hidraw1
- -p, --port: Serial port for tty interface, e.g. /dev/ttyUSB0
- -V, --vid: VendorID to use for HID interface, default=0x665
- -P, --pid: ProductID to use for HID interface, default=0x5161
- -t, --timeout: query timeout in MS, default=10000
$ axpert-set -c POP -v 00
Sending command: 'POP00'
ACK
USE AT OWN RISK
Changing some parameters while the inverter is in use (like the output frequency) is probably not a good idea.
Currently only some inquery commands have parsers implemented. The following are not yet implemented and will only return the raw string response when executed:
- QVFW2
- QDI
- QMCHGCR
- QMUCHGCR