-- How to use OMRON UPS on OpenBSD/NetBSD --
OpenBSDマシンに、USB接続のオムロン製UPSを接続して、自動シャットダウンできるように設定する方法のメモです。 NetBSDでもUPSと通信できることは確認しましたので、同様に設定できると思います。
[ no symbol table formats found ] | |
Copyright (c) 1982, 1986, 1989, 1991, 1993 | |
The Regents of the University of California. All rights reserved. | |
Copyright (c) 1995-2013 OpenBSD. All rights reserved. http://www.OpenBSD.org | |
OpenBSD 5.4-current (GENERIC) #114: Thu Aug 15 19:53:54 JST 2013 | |
[email protected]:/usr/src/sys/arch/luna88k/compile/GENERIC | |
real mem = 117440512 (112MB) | |
avail mem = 111919104 (106MB) | |
mainbus0 at root: OMRON LUNA-88K2, 33MHz |
x11perf - X11 performance program, version 1.2 | |
The X.Org Foundation server version 11401000 on :0 | |
from aurora.in.nk-home.net | |
Fri Sep 13 22:47:58 2013 | |
Sync time adjustment is 5.8911 msecs. | |
600000 reps @ 0.0091 msec (110000.0/sec): Dot | |
600000 reps @ 0.0090 msec (111000.0/sec): Dot | |
600000 reps @ 0.0090 msec (111000.0/sec): Dot |
/* | |
* Copyright (c) 2013 Kenji Aoyama | |
* | |
* Permission to use, copy, modify, and distribute this software for any | |
* purpose with or without fee is hereby granted, provided that the above | |
* copyright notice and this permission notice appear in all copies. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
% sudo /usr/local/bin/blazer_usb -DDDDD -a by35s | |
Network UPS Tools - Megatec/Q1 protocol USB driver 0.09 (2.6.5) | |
0.000000 send_to_all: SETINFO driver.parameter.port "auto" | |
0.000084 send_to_all: SETINFO driver.parameter.vendorid "0590" | |
0.000096 send_to_all: SETINFO driver.parameter.productid "0080" | |
0.000108 send_to_all: SETINFO driver.parameter.subdriver "ippon" | |
0.000148 debug level is '5' | |
0.000740 No appropriate HID device found | |
0.000763 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, |
% sudo /usr/local/bin/blazer_usb -DDDD -a by35s | |
Network UPS Tools - Megatec/Q1 protocol USB driver 0.09 (2.6.5) | |
0.000000 debug level is '4' | |
0.171836 Checking device (10DE/0000) (000/001) | |
0.172024 - VendorID: 10de | |
0.172032 - ProductID: 0000 | |
0.172038 - Manufacturer: NVIDIA | |
0.172044 - Product: EHCI root hub | |
0.172049 - Serial Number: unknown | |
0.172055 - Bus: 000 |
#### Linux #### | |
loris% sudo ./omupschat | |
bus 0, device 0, VendorID:0x0590, ProductID:0x0080, at (002/004) | |
** Target device found | |
bus 0, device 1, VendorID:0x0e0f, ProductID:0x0002, at (002/003) | |
bus 0, device 2, VendorID:0x0e0f, ProductID:0x0003, at (002/002) | |
bus 0, device 3, VendorID:0x1d6b, ProductID:0x0001, at (002/001) | |
bus 1, device 4, VendorID:0x1d6b, ProductID:0x0002, at (001/001) | |
Q1 |
--- nut-2.6.5/drivers/blazer_usb.c.orig Wed Aug 1 02:38:59 2012 | |
+++ nut-2.6.5/drivers/blazer_usb.c Mon Oct 21 00:04:22 2013 | |
@@ -173,8 +173,8 @@ | |
static int ippon_command(const char *cmd, char *buf, size_t buflen) | |
{ | |
- char tmp[64]; | |
- int ret; | |
+ char tmp[64], tmp2[64]; | |
+ int ret, len1; |
trantor% sudo ./blazer_usb -DDDD -a by35s | |
Password: | |
Network UPS Tools - Megatec/Q1 protocol USB driver 0.09 (2.6.5) | |
0.000000 debug level is '4' | |
0.147968 Checking device (10DE/0000) (000/001) | |
0.148313 - VendorID: 10de | |
0.148321 - ProductID: 0000 | |
0.148327 - Manufacturer: NVIDIA | |
0.148333 - Product: EHCI root hub | |
0.148339 - Serial Number: unknown |
Index: sys/dev/usb/usb_quirks.c | |
=================================================================== | |
RCS file: /cvs/src/sys/dev/usb/usb_quirks.c,v | |
retrieving revision 1.66 | |
diff -u -r1.66 usb_quirks.c | |
--- sys/dev/usb/usb_quirks.c 31 Jan 2012 21:13:32 -0000 1.66 | |
+++ sys/dev/usb/usb_quirks.c 26 Oct 2013 00:24:10 -0000 | |
@@ -156,6 +156,7 @@ | |
{ USB_VENDOR_MUSTEK2, USB_PRODUCT_MUSTEK2_PM800, ANY, { UQ_BAD_HID }}, | |
{ USB_VENDOR_OMRON, USB_PRODUCT_OMRON_BX35F, ANY, { UQ_BAD_HID }}, |