Michael Hacker Posted August 11, 2020 Share Posted August 11, 2020 TL;DR - I can only get apcusbd to work if I both restart apcusbd and unplug and plugin the USB. It doesn't seem to matter which I do first. Having to unplug and plug in a usb each time the server shuts down seems unrealistic. Any help is appreciated. I have a brand new APC P-SMT1000C connected to unraid through USB. When unraid starts up with the USB plugged in from startup, I get the following. It's always some random number for Battery Charge (6.2, 1.5, etc) and it alternates between Online and Online Low Batt. Also the logs reflect power failures. The Aug 11 10:07:19 Maverick apcupsd[4299]: Power failure. Aug 11 10:07:25 Maverick apcupsd[4299]: Power failure. Aug 11 10:08:35 Maverick apcupsd[4299]: Power failure. Aug 11 10:08:36 Maverick apcupsd[4299]: Power is back. UPS running on mains. Aug 11 10:11:10 Maverick webGUI: Successful login user root from 172.17.0.4 Aug 11 10:11:49 Maverick ntpd[2022]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized Aug 11 10:11:55 Maverick apcupsd[4299]: Power failure. Aug 11 10:12:06 Maverick apcupsd[4299]: Power failure. Aug 11 10:13:17 Maverick apcupsd[4299]: Power failure. Aug 11 10:16:37 Maverick apcupsd[4299]: Power failure. Aug 11 10:16:44 Maverick apcupsd[4299]: Power failure. Aug 11 10:16:52 Maverick apcupsd[4299]: Power failure. Aug 11 10:16:57 Maverick apcupsd[4299]: Power failure. Aug 11 10:17:05 Maverick apcupsd[4299]: Power failure. Then, if I stop the daemon and start it up again, i get the following in the log, with the same battery number percentage: Aug 11 10:24:49 Maverick apcupsd[4299]: apcupsd exiting, signal 15 Aug 11 10:24:49 Maverick kernel: usb 3-2: reset full-speed USB device number 2 using xhci_hcd Aug 11 10:24:49 Maverick apcupsd[4299]: Communications with UPS lost. Aug 11 10:24:49 Maverick apcupsd[4299]: apcupsd shutdown succeeded Aug 11 10:24:49 Maverick kernel: apcupsd[4299]: segfault at 0 ip 000000000041c773 sp 00007ffe4c70b7e0 error 4 in apcupsd[400000+46000] Aug 11 10:24:49 Maverick kernel: Code: 01 40 38 c5 0f 85 1e ff ff ff eb 89 0f 1f 00 80 ce 01 48 89 43 10 be 0c 00 00 00 89 97 08 0d 00 00 e8 e1 93 fe ff 48 8b 7b 18 <48> 8b 07 ff 50 18 e9 60 ff ff ff 66 90 48 89 43 10 48 c7 c0 20 96 Aug 11 10:24:49 Maverick sSMTP[12432]: Creating SSL connection to host Aug 11 10:24:49 Maverick sSMTP[12432]: SSL connection using TLS_AES_256_GCM_SHA384 Aug 11 10:24:52 Maverick sSMTP[12432]: Sent mail for [email protected] (221 2.0.0 closing connection d8sm19737570qtr.12 - gsmtp) uid=0 username=root outbytes=663 Aug 11 10:25:04 Maverick apcupsd[12557]: apcupsd 3.14.14 (31 May 2016) slackware startup succeeded Aug 11 10:25:04 Maverick apcupsd[12557]: NIS server startup succeeded Then unplugging and plugging back in the USB (this works if the daemon has been turned off and back on, but not if i just unplug and plug it in without first restarting the daemon). Aug 11 10:36:02 Maverick kernel: usb 3-2: USB disconnect, device number 2 Aug 11 10:36:03 Maverick apcupsd[4242]: Communications with UPS lost. Aug 11 10:36:03 Maverick sSMTP[14338]: Creating SSL connection to host Aug 11 10:36:03 Maverick sSMTP[14338]: SSL connection using TLS_AES_256_GCM_SHA384 Aug 11 10:36:05 Maverick sSMTP[14338]: Sent mail for [email protected] (221 2.0.0 closing connection j61sm19163637qtd.52 - gsmtp) uid=0 username=root outbytes=659 Aug 11 10:36:08 Maverick kernel: usb 3-2: new full-speed USB device number 3 using xhci_hcd Aug 11 10:36:08 Maverick kernel: hid-generic 0003:051D:0003.0002: hiddev96,hidraw0: USB HID v1.11 Device [American Power Conversion Smart-UPS_1000 FW:UPS 04.1 / ID=1015] on usb-0000:05:00.3-2/input0 Aug 11 10:36:09 Maverick apcupsd[4242]: Communications with UPS restored. Aug 11 10:36:09 Maverick sSMTP[14626]: Creating SSL connection to host Aug 11 10:36:09 Maverick sSMTP[14626]: SSL connection using TLS_AES_256_GCM_SHA384 Aug 11 10:36:11 Maverick sSMTP[14626]: Sent mail for [email protected] (221 2.0.0 closing connection w12sm16316689qkj.116 - gsmtp) uid=0 username=root outbytes=655 Aug 11 10:36:47 Maverick apcupsd[4242]: apcupsd exiting, signal 15 Aug 11 10:36:47 Maverick kernel: usb 3-2: reset full-speed USB device number 3 using xhci_hcd Aug 11 10:36:47 Maverick apcupsd[4242]: apcupsd shutdown succeeded Aug 11 10:36:52 Maverick apcupsd[16707]: apcupsd 3.14.14 (31 May 2016) slackware startup succeeded Aug 11 10:36:52 Maverick apcupsd[16707]: NIS server startup succeeded Here is it working (just to show that it works). Quote Link to comment
Energen Posted August 11, 2020 Share Posted August 11, 2020 I'm not home to check mine but you have the UPS type set to ModBus.. I'm not sure if this is correct. ModBus was mainly used for RS232 serial interfaces. I don't know if that's what your problem could be but I would double check your settings first and see if the problems persist. Quote Link to comment
Michael Hacker Posted August 11, 2020 Author Share Posted August 11, 2020 1 minute ago, Energen said: I'm not home to check mine but you have the UPS type set to ModBus.. I'm not sure if this is correct. ModBus was mainly used for RS232 serial interfaces. I don't know if that's what your problem could be but I would double check your settings first and see if the problems persist. Thank you. The issue is without Modbus, I don't get the real time usage information (I guess not the end of the world, but the missing data bugs me). The device has Modbus settings, which are enabled, and it does work just it doesn't work at startup on its own w/o tinkering. So that tells me it works, but there is something wrong or some setting or something that i'm missing. Quote Link to comment
Energen Posted August 12, 2020 Share Posted August 12, 2020 Do you have the APC USB plugged into a USB3 port? I don't know if/why that could be a problem. Maybe for some reason the USB 3 port is dropping the 'connection'. If so, use a USB2 port, and repeat. This is totally irrelevant, but this is what happened to me when I went from USB UPS Type to ModBus (which dropped communication since I actually have CyberPower), and back again. Aug 11 20:59:34 UNRAID apcupsd[1202]: apcupsd exiting, signal 15 Aug 11 20:59:34 UNRAID apcupsd[1202]: apcupsd shutdown succeeded Aug 11 20:59:35 UNRAID apcupsd[31794]: apcupsd 3.14.14 (31 May 2016) slackware startup succeeded Aug 11 20:59:35 UNRAID apcupsd[31794]: NIS server startup succeeded Aug 11 20:59:39 UNRAID kernel: usb 1-5: USB disconnect, device number 13 Aug 11 20:59:41 UNRAID kernel: usb 1-5: new low-speed USB device number 14 using xhci_hcd Aug 11 20:59:42 UNRAID kernel: hid-generic 0003:0764:0601.000C: hiddev96,hidraw0: USB HID v1.10 Device [CPS OR1500LCDRM1U] on usb-0000:00:14.0-5/input0 Aug 11 20:59:48 UNRAID kernel: usb 1-5: USB disconnect, device number 14 Aug 11 20:59:50 UNRAID kernel: usb 1-5: new low-speed USB device number 15 using xhci_hcd Aug 11 20:59:51 UNRAID kernel: hid-generic 0003:0764:0601.000D: hiddev96,hidraw0: USB HID v1.10 Device [CPS OR1500LCDRM1U] on usb-0000:00:14.0-5/input0 Aug 11 20:59:57 UNRAID kernel: usb 1-5: USB disconnect, device number 15 Aug 11 20:59:59 UNRAID apcupsd[31794]: apcupsd exiting, signal 15 Aug 11 20:59:59 UNRAID apcupsd[31794]: apcupsd shutdown succeeded Aug 11 20:59:59 UNRAID apcupsd[32743]: apcupsd 3.14.14 (31 May 2016) slackware startup succeeded Aug 11 20:59:59 UNRAID apcupsd[32743]: NIS server startup succeeded Aug 11 21:00:00 UNRAID kernel: usb 1-5: new low-speed USB device number 16 using xhci_hcd Aug 11 21:00:00 UNRAID kernel: hid-generic 0003:0764:0601.000E: hiddev96,hidraw0: USB HID v1.10 Device [CPS OR1500LCDRM1U] on usb-0000:00:14.0-5/input0 Mine are all "low speed" vs your "full speed", just wondering if it's a USB2 vs USB3 issue. You can google variants of "reset full-speed USB device number 3 using xhci_hcd" and see all kinds of Linux problems with USB3. Quote Link to comment
Michael Hacker Posted August 12, 2020 Author Share Posted August 12, 2020 16 minutes ago, Energen said: Do you have the APC USB plugged into a USB3 port? I don't know if/why that could be a problem. Maybe for some reason the USB 3 port is dropping the 'connection'. If so, use a USB2 port, and repeat. This is totally irrelevant, but this is what happened to me when I went from USB UPS Type to ModBus (which dropped communication since I actually have CyberPower), and back again. Mine are all "low speed" vs your "full speed", just wondering if it's a USB2 vs USB3 issue. You can google variants of "reset full-speed USB device number 3 using xhci_hcd" and see all kinds of Linux problems with USB3. Interesting. I'm running an X570M and it only has USB 3 ports. It does have a few USB 2.0 headers, so I can get a slot plate and add some. That would be a cheap fix. I tried to run a usb device reset via python to see if that would simulate a cable pull but it didn't work. I read in a few spots that the included APC USB cable is very low quality. I'm going to a newer / better one from monoprice and see if that adds stability. If not, I will try to get a AP9827 from eBay (the proprietary 10 pin RJ 45 to USB for the RJ 45 serial port on this device) and see if that works....or try to add USB 2.0 ports. Interestingly, this device also supports Modbus over tcp via the SmartConnect Ethernet port. I enabled that, but I cannot figure out how to connect to it via IP. Thanks for the tip! Quote Link to comment
Michael Hacker Posted August 14, 2020 Author Share Posted August 14, 2020 I tired a new shorter better quality USB cable, and that did not solve the problem. It worked great when i plugged it in, but then on restart (and on trying to shut off and turn back on the apcusbd) I get these logs. The one line sticking out to me is "usbfs: process 4689 (apcupsd) did not claim interface 0 before use" because my issue is resolved if i unplug and plug it back in. Aug 14 08:16:11 Maverick emhttpd: shcmd (75): /etc/rc.d/rc.nginx start Aug 14 08:16:11 Maverick root: Starting Nginx server daemon... Aug 14 08:16:12 Maverick apcupsd[4689]: Power failure. Aug 14 08:16:13 Maverick apcupsd[4689]: Power is back. UPS running on mains. Aug 14 08:17:51 Maverick webGUI: Successful login user root from 172.17.0.4 Aug 14 08:20:45 Maverick ntpd[1998]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized Aug 14 08:22:52 Maverick login[10777]: ROOT LOGIN on '/dev/pts/0' Aug 14 08:24:03 Maverick apcupsd[4689]: Power failure. Aug 14 08:24:03 Maverick apcupsd[4689]: Power is back. UPS running on mains. Aug 14 08:24:10 Maverick apcupsd[4689]: Power failure. Aug 14 08:24:10 Maverick apcupsd[4689]: Power is back. UPS running on mains. Aug 14 08:25:19 Maverick apcupsd[4689]: Power failure. Aug 14 08:26:27 Maverick apcupsd[4689]: Power failure. Aug 14 08:26:28 Maverick apcupsd[4689]: Power is back. UPS running on mains. Aug 14 08:26:50 Maverick apcupsd[4689]: Power failure. Aug 14 08:27:05 Maverick apcupsd[4689]: Power failure. Aug 14 08:27:05 Maverick apcupsd[4689]: Power is back. UPS running on mains. Aug 14 08:27:15 Maverick apcupsd[4689]: apcupsd exiting, signal 15 Aug 14 08:27:15 Maverick kernel: usb 3-1: reset full-speed USB device number 2 using xhci_hcd Aug 14 08:27:16 Maverick kernel: usb 3-1: usbfs: process 4689 (apcupsd) did not claim interface 0 before use Aug 14 08:27:16 Maverick kernel: apcupsd[4689]: segfault at 0 ip 000000000041b836 sp 00007ffc16577440 error 4 in apcupsd[400000+46000] Aug 14 08:27:16 Maverick kernel: Code: 00 00 00 00 41 57 41 56 49 89 fe 41 55 41 54 49 89 f4 55 53 48 81 ec 88 00 00 00 48 8b 46 08 48 8b 7f 18 0f b7 50 02 0f b7 30 <48> 8b 07 ff 50 20 48 85 c0 0f 84 fb 02 00 00 49 89 c5 48 8d 6c 24 Aug 14 08:27:25 Maverick apcupsd[11699]: apcupsd 3.14.14 (31 May 2016) slackware startup succeeded Aug 14 08:27:25 Maverick apcupsd[11699]: NIS server startup succeeded Aug 14 08:27:35 Maverick apcupsd[11699]: Power failure. Aug 14 08:27:45 Maverick apcupsd[11699]: Power failure. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.