Gibbon99 / apcupsd

APC UPS plugin for OPNsense
5 stars 1 forks source link

USB UPS fails to communicate because DEVICE directive in apcupsd.conf still set to /dev/cuaU0 #3

Closed dbrandesky closed 3 years ago

dbrandesky commented 3 years ago

Steps to reproduce using USB connected APC UPS:

  1. Configure apcupsd through the web UI as follows:
    • Enabled: yes
    • UPS cable type: USB
    • UPS device: clear the default entry (/dev/cuaU0) so this field is empty
  2. Restart apcupsd service and check status. Observe: web UI status is blank, but service is running. Running 'apcaccess' on the command line reveals that the service is not communicating with the UPS.
  3. Check the contents of /usr/local/etc/apcupsd/apcupsd.conf. Observe: the DEVICE directive still shows /dev/cuaU0.
  4. Comment out the DEVICE line ('#"), save the file, and restart apcupsd. Observe: apcupsd now successfully communicates with the UPS.

Note that I also enabled the netserver ('netserver on') in the web UI in my testing process; I don't think this actually resolved the issue, but it may be a relevant detail.

mrzaz commented 3 years ago

I think I have a solution for this and asked David to push in a correction as I have some issues with my Git Client atm. I'll let you know when you could test again.

UPDATE: I have now committed a fix. Could you please download the latest files and update your OPNSENSE ins /usr/local/opnsense/... folders and let me know if it works OK. Should now not write a default "/dev/cuaU0" to the DEVICE string even if you set it to blank.

Make sure to do a new "Save config" (to overwrite the apcupsd.inc with fresh file and try to restart service.

//Danne (mrzaz)