generic_modbus -a DEVICE_NAME [OPTIONS]
This man page only documents the specific features of the generic_modbus driver. For information about the core driver, see nutupsdrv(8).
This is a generic modbus driver expected to work with contact (direct) signal UPS devices, connected via modbus RIO (remote I/O) either serial or TCP/IP.
The driver has been tested against PULS UPS (model UB40.241) via MOXA ioLogikR1212 (RS485) and ioLogikE1212 (TCP/IP).
More information about this UPS can be found here:
More information about Moxa ioLogik R1212, E1212 can be found here:
The PULS UPS UB40.241 supports the following signals:
Ready contact (DO) <--> HB Buffering contact (DO) <--> OL | OB Battery-low (DO) <--> LB Replace Battery (DO) <--> RB Inhibit (DI) <--> FSD
Digital port direction (DI/DO) assumes the device perspective
The driver’s concept is to map the UPS states (as defined in NUT) onto UPS contacts' states. The driver has an extended configuration interface implemented using variables defined in ups.conf.
The commission of modbus remote I/O server as well as UPS device is carried out following the corresponding instruction manuals. The following figure depicts the anticipated communication path and hardware interconnection:
+------+ +----------------+ +------------+ +------------+ | UPSD | <---> | GENERIC_MODBUS | <---> | MODBUS RIO | <---> | UPS DEVICE | +------+ (1) +----------------+ (2) +------------+ (3) +------------+ | | +-------------------+ HOST CONTROLLER (1) Unix IPC (2) RS232 | TCP/IP (3) contacts
This driver supports the following optional settings in the ups.conf(5) file:
A string specifying the manufacturer of the UPS device (default UNKNOWN).
A string specifying the model of the UPS device (default UNKNOWN).
A integer specifying the serial port baud rate (default 9600).
A integer specifying the serial port data bit (default 8).
A character specifying the serial port parity (default N).
An integer specifying the serial port stop bit (default 1).
An integer specifying the RIO modbus slave ID (default 1).
States (X = OL, OB, LB, HB, RB, CHRG, DISCHRG, FSD)
A number specifying the modbus address for the X state.
A number specifying the modbus register type for the X state
1 for X = OL, OB, LB ,HB, RB, CHRG, DISCHRG 0 for X = FSD
0:COIL, 1:INPUT_B, 2:INPUT_R, 3:HOLDING
A number specifying the contact configuration for the X state (default 1).
NO stands for normally open and NC for normally closed contact
A number specifying the duration in ms for the inhibit pulse. If it’s not defined, signal has only one transition depending on FSD_noro configuration.
Examples for FSD signal configuration:
FSD_noro = 1 FSD_pulse_duration = 150 +-----+ | | inhibit pulse >-----+ +------------------> <---> 150ms FSD_noro = 0 inhibit pulse >-----+ | +------------------------>
Here is an example of generic_modbus driver configuration in ups.conf file:
[generic_modbus] driver = generic_modbus port = /dev/ttyUSB0 desc = "generic ups driver" # device info device_mfr = "PULS" device_model = "UB40.241" # serial settings ser_baud_rate = 9600 ser_parity = N ser_data_bit = 8 ser_stop_bit = 1 # modbus slave id rio_slave_id = 5 # UPS signal state attributes OB_addr = 0x0 OB_regtype = 1 OB_noro = 0 LB_addr = 0x1 LB_regtype = 1 HB_addr = 0x2 HB_regtype = 1 RB_addr = 0x3 RB_regtype = 1 FSD_addr = 0x0 FSD_regtype = 0 FSD_pulse_duration = 150
This driver support the following instant commands:
executes "instant poweroff"
This driver is not built by default. You can build it by installing libmodbus and running configure --with-modbus=yes.
You also need to give proper permissions on the local serial device file (/dev/ttyUSB0 for example) to allow the run-time NUT driver user account to access it.
The generic_modbus driver intends to support generic UPS devices with contact signals through modbus TCP/RTU gateways (also known as RIO — remote I/Os). The data and signal path looks like this:
[UPSD] <--- IPC ---> [GENERIC_UPS] <--- modbus TCP/RTU ---> MODBUS-RIO <--- contacts ---> [UPS DEVICE]
On the other hand, you can setup any kind of modbus server, and configure the generic_modbus driver to connect and read or write specific registers. Your application / modbus server could then drive NUT statuses (e.g. OL, OB, HB etc) by writing over those registers.
Dimitris Economou <email@example.com>
The core driver