Discussion:
[Apcupsd-users] Multiple ups support with modbus and systemd
Sandro Bordacchini
2017-04-24 20:50:37 UTC
Permalink
Hello everyone.

I don't know if this will work, i just realized that the last message is 1
year old, but i don't know where to ask.

I am trying to monitor a couple of SMT1500 with a embedded arm platform
(debian armv7l) connected via usb to the UPSes.
I was successful at the beginning, but i realized that the parameters were
very few. So i read about the modbus issue.

So i upgraded UPSes firmware and the platform from wheezy to stretch (in
order to have an apcupsd version 3.14.14).
I managed to convert these
https://wiki.debian.org/apcupsd#Configuring_.28Multiple_UPS_Devices.29
instructions in something that could work in a systemd environment (using
template unit files), and i actually managed to have two instances of
apcupsd running:
175 ? Ssl 0:14 /sbin/apcupsd -f
/etc/apcupsd/apcupsd-smt1500-01.conf -P /var/run/apcupsd-smt1500-01.pid
183 ? Ssl 0:04 /sbin/apcupsd -f
/etc/apcupsd/apcupsd-smt1500-02.conf -P /var/run/apcupsd-smt1500-02.pid

The NIS servers are listening on two different ports.
The smt1500-02 is working properly and i can access it with apcaccess -h
localhost:3552
The smt1500-01 is not, it reports, with apcaccess a status of COMMLOST and
no info.

On dmesg i see a lot of these messages:
[ 75.861064] usb 3-1: reset full-speed USB device number 2 using sw-ohci
[ 77.844722] usb 5-1: usbfs: process 183 (apcupsd) did not claim
interface 0 before use
[ 79.865349] usb 3-1: reset full-speed USB device number 2 using sw-ohci
[ 81.044720] usb 5-1: usbfs: process 183 (apcupsd) did not claim
interface 0 before use
[ 82.857064] usb 3-1: reset full-speed USB device number 2 using sw-ohci
[ 83.188727] usb 5-1: usbfs: process 183 (apcupsd) did not claim
interface 0 before use
[ 85.848772] usb 3-1: reset full-speed USB device number 2 using sw-ohci
[ 86.388742] usb 5-1: usbfs: process 183 (apcupsd) did not claim
interface 0 before use
[ 88.840483] usb 3-1: reset full-speed USB device number 2 using sw-ohci

I quote for reference one config file, the other one is analogue.
UPSNAME SMT1500-01
UPSTYPE modbus
UPSCABLE usb
DEVICE AS1302223920
POLLTIME 60
LOCKFILE /var/lock
NETSERVER on
NISIP 127.0.0.1
NISPORT 3551
EVENTSFILE /var/log/apcupsd-smt1500-01.events
BATTERYLEVEL -1
MINUTES -1
TIMEOUT 0
ANNOY 0
ANNOYDELAY 0
NOLOGON disable
KILLDELAY 0
SCRIPTDIR /etc/apcupsd/scripts-smt1500-01
PWRFAILDIR /etc/apcupsd/scripts-smt1500-01
STATTIME 0
STATFILE /var/log/apcupsd-smt1500-01.status
DATATIME 0
FACILITY DAEMON
UPSCLASS standalone
UPSMODE disable

Can I make this work?

Thanks a lot for help.
SB

Loading...