gersilex / apcupsd-docker Goto Github PK
View Code? Open in Web Editor NEWapcupsd in a container; can trigger arbitrary commands on the Docker host
Home Page: https://hub.docker.com/r/gersilex/apcupsd
License: MIT License
apcupsd in a container; can trigger arbitrary commands on the Docker host
Home Page: https://hub.docker.com/r/gersilex/apcupsd
License: MIT License
Hi, any ideas what other devices than /dev/usb/hiddev0
would need to be handed over to the container when trying to use modbus?
I am constantly getting COMMLOST
when running in docker. If I install on the host, modbus communication is perfectly running using the same apcupsd.conf
Hi,
I think you forgot to include host-trigger-check.sh in Dockerfile, at least the Readme says, that I should copy it from the dockercontainer to the host.
Thanks for the container, have a nice day,
Cyber1000
Hello and thanks a lot for this repo,
I've been using it on a Rpi with libreelec for a while now and it's been very helpful. The only issue I had was with the docker stop
command in host-trigger-check.sh because I create all my containers using the --restart unless-stopped
option. When manually stopping a container created with this option, it will never be started after a reboot (when power comes back).
I know that in your guidelines you specify that custom changes might be needed per use case but I would like to ask you why not simply halt the system? It will try to gracefully stop the docker service which will stop all containers. 'Systemd' usually has a sane timeout (90 secs on most installations I've seen).
Regards,
Panos
The default apcupsd.conf
for this container specifies a UPSTYPE net
. A custom config with UPSTYPE usb
is needed for an UPS connected via USB according to the USB configuration in APCUPSD's documentation.
But trying to use the apcupsd.conf file
## apcupsd.conf v1.1 ##
UPSCABLE usb
UPSTYPE usb
DEVICE
BATTERYLEVEL 5
MINUTES 10
LOCKFILE /var/lock
UPSCLASS standalone
UPSMODE disable
and mapping it onto the container with
volumes:
- /tmp/apcupsd-docker:/tmp/apcupsd-docker
- /file/path/apcupsd.conf:/etc/apcupsd/apcupsd.conf
- /file/path/doshutdown:/etc/apcupsd/doshutdown
results in a COMMLOST error using apcaccess
:
APC : 001,017,0429
DATE : 2022-04-26 15:13:41 +0000
HOSTNAME : 8bfdba79ab48
VERSION : 3.14.14 (31 May 2016) unknown
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2022-04-26 15:12:30 +0000
STATUS : COMMLOST
MBATTCHG : 5 Percent
MINTIMEL : 10 Minutes
MAXTIME : 0 Seconds
NUMXFERS : 0
TONBATT : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
STATFLAG : 0x05000100
END APC : 2022-04-26 15:14:00 +0000
with the log also not showing NIS server startup succeeded
.
Using the apcupsd.conf as
# /etc/apcupsd/apcupsd.conf (in the apcupsd-docker container)
UPSCABLE usb
UPSTYPE usb
DEVICE
BATTERYLEVEL 5
MINUTES 10
at least results in a successful NIS server startup succeeded
, followed by a loss of communications:
/sbin/apcupsd: Warning: old configuration file found.
/sbin/apcupsd: Expected: "## apcupsd.conf v1.1 ##"
/sbin/apcupsd: Found: "# /etc/apcupsd/apcupsd.conf (in the apcupsd-docker container)
"
/sbin/apcupsd: Please check new file format and
/sbin/apcupsd: modify accordingly the first line
/sbin/apcupsd: of config file.
/sbin/apcupsd: Processing config file anyway.
apcupsd[1]: apcupsd 3.14.14 (31 May 2016) unknown startup succeeded
apcupsd[1]: NIS server startup succeeded
apcupsd[1]: Communications with UPS lost.
/etc/apcupsd/commfailure: line 18: mail: not found
: Warning: old configuration file found.
: Expected: "## apcupsd.conf v1.1 ##"
: Found: "# /etc/apcupsd/apcupsd.conf (in the apcupsd-docker container)
"
: Please check new file format and
: modify accordingly the first line
: of config file.
: Processing config file anyway.
Warning communications lost with UPS
A working USB option apcupsd.conf file would be highly appreciated.
Is it possible to compile a Linux/arm and Linux/arm64 versions of this? I would like to run this on my Raspberry Pi Compute Module 4. Thank you very much.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.