Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Andromeda

#1
Thank you all for the replies. :)
I managed to get it working now.
UPS: Numeric Digital 800 Plus
Identified on USB as: 
ugen0.3: <CTN USB UPS> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)
  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0110
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0008
  idVendor = 0x06da
  idProduct = 0x0003
  bcdDevice = 0x0501
  iManufacturer = 0x0003  <CTN>
  iProduct = 0x0001  <USB UPS>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001


The issues seems to have been a combination of things, and I've learned a few things along the way:
These are the settings that in the end worked for me:
Service Mode: standalone
Name: ups1
Listen Address: added local IPv4 address of OPNsense server (192.168.0.1)
UPS type: QX-Driver -> enabled
Extra Arguments: port=auto, novendor, protocol=megatec
With these settings (and a re-connect of USB cable) the Service status on the NUT configuration pages shows as running (Green).
On the Dashboard, the 2 services 'nut_deamon' and 'nut_upsmon' are now also green.

Learned:
UI process getting in the way of the commands given on the command line:
- Adding the settings via the UI, Apply, then stop the service, then troubleshoot/run commands on the command line. Or disable the NUT service in the UI and manually enter the details in the NUT config files.
- USB port of the UPS getting blocked (Permission denied) -> unplug USB cable and re-insert into other USB port.
- NUT package on FreeBSD is compiled with user uucp and group uucp, so use that when running the nut usb driver directly
  (like: /usr/local/libexec/nut/blazer_usb -a ups1 -DDD -u uucp).
  * The number of 'D's is the debug level (e.g 5 'D's is debug-lvel 5).
- NUT config files are in: /usr/local/etc/nut  -> owned by: root:wheel
- NUT state path (PID file and status output file): /var/db/nut -> owned by: uucp:uucp
- NUT drivers are in : /usr/local/libexec/nut/ -> owned by: root:wheel
- NUT utils like upsd, upsdrvctl etc. are in: /usr/local/sbin/ -> owned by: root:wheel
- USB port is/gets correctly owned:
  - sudo ls -l /dev/ugen0.3 -> shows link to usb/0.3.0 and is owned by root:wheel
  - sudo ls -l /dev/usb/0.3.0 is owned by root:uucp

#2
The UPS is "Numeric Digital 800 plus"
It is on the list here: https://networkupstools.org/ddl/NUMERIC/Digital_800_Plus.html

I'm using the blazer_usb driver and that driver replaces the older/previous megatec driver, and it is using the megatec Q1 protocol.

As mentioned, the UPS is detected when I run the blazer_usb driver manually as the root user (with the -u root option).

I've also tried the newer QX driver (nutdrv_qx), with the same results.


#3
Hi all,
Hope that someone can help me out with the os-nut package.
It will not detect my UPS connected on a USB port.
Nut/Diagnostics just stays blank.

It looks like it has something to do with rights and user used, but I'm not sure where or how I could change/correct that.

Configuration:
OPNsense 22.1.6-amd64 with latest updates
os-nut v1.8.1
nut v2.7.4_20
Service Mode: standalone
Name: ups1
Listen Address: 127.0.0.1  & ::1
UPS Type: Enabled the BlazerUSB driver
Extra Arguments: port=auto

Troubleshooting:
NUT service shows as running in the GUI.
When logged in through ssh, you regularly see the message: UPS ups1 is unavailable

The content of the files in /usr/local/etc/nut seems to be correct, and line-up with what is shown in the OPNsense user interface.

When running the blazer usb driver from the command line, it will not detect the UPS.
But when running the blazer usb driver with user root, it will detect the ups.

$ sudo /usr/local/libexec/nut/blazer_usb -a ups1 -DDD
Password:
Network UPS Tools - Megatec/Q1 protocol USB driver 0.12 (2.7.4)
   0.000000     debug level is '3'
   0.000661     No appropriate HID device found
   0.000685     No supported devices found. Please check your device availability with 'lsusb'
and make sure you have an up-to-date version of NUT. If this does not help,
try running the driver with at least 'subdriver', 'vendorid' and 'productid'
options specified. Please refer to the man page for details about these options
(man 8 blazer_usb).

$

$ sudo /usr/local/libexec/nut/blazer_usb -a ups1 -DDD -u root
Network UPS Tools - Megatec/Q1 protocol USB driver 0.12 (2.7.4)
   0.000000     debug level is '3'
   0.000983     Checking device (06DA/0003) (/dev/usb//dev/ugen0.3)
   0.017996     - VendorID: 06da
   0.018020     - ProductID: 0003
   0.018031     - Manufacturer: CTN
   0.018040     - Product: USB UPS
   0.018049     - Serial Number: unknown
   0.018057     - Bus: /dev/usb
   0.018066     - Device release number: 0501
   0.018074     Trying to match device
   0.018085     Device matches
   0.018105     nut_usb_set_altinterface: skipped usb_set_altinterface(udev, 0)
   0.018140     Trying megatec protocol...
   0.019889     send: Q1
   0.250438     read: (232.9 232.9 232.9 007 50.1 13.5 25.0 00001001
   0.250576     Status read in 1 tries
   0.250595     Supported UPS detected with megatec protocol
   0.252378     send: F
   0.394414     read: #220.0 003 12.00 50.0

$ sudo usbconfig
Password:
ugen0.1: <Intel EHCI root HUB> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <vendor 0x8087 product 0x07e6> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.3: <CTN USB UPS> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)