[Nut-upsuser] Zigor on Mac Os X
mark at helenandmark.org
Mon Sep 24 10:15:28 UTC 2012
First, a HUGE thanks !
To answer your questions, (and I should replete, for those coming after :-) - this is a vigor embo 650 UPS device) )
(I have some success, - but there is still some issue - see below, I'll go through whats working first)
When I boot my iMac, with the device connected, I get:
echo show 'State:/IOKit/PowerSources/UPS0' | scutil
Is Charging : TRUE
Is Present : TRUE
Max Capacity : 100
Name : STD UPS MON V1.0
Power Source ID : 0
Power Source State : AC Power
Transport Type : USB
Voltage : 130
The state remains unchanged if you pull out the power on the UPS, and it is working from batter - HENCE the need to use NUT …
Next, if I unplug, and re-plug the USB cable, I then do not have any keys in the scutil…. e.g.:
echo list 'State:/IOKit/.*' | scutil
subKey  = State:/IOKit/Power/CPUPower
subKey  = State:/IOKit/PowerManagement/CurrentSettings
subKey  = State:/IOKit/PowerManagement/SystemLoad
subKey  = State:/IOKit/PowerManagement/SystemLoad/Detailed
subKey  = State:/IOKit/SystemPowerCapabilities
At this point, if I follow the instructions given in the link you provided below (THANKS), things begin to show some hint of life:
for completeness, and to help anybody else:
> more /System/Library/Extensions/NUTDummy.kext/Contents/Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
<string>Dummy UPS Driver</string>
<key>Uninterruptible Power Supply</key>
Now, the following commands work:
> sudo /opt/local/bin/upsdrvctl start
> sudo /opt/local/bin/upsd
> upsc zigor
device.model: EBRO 650
ups.firmware: VER 1.74
ups.model: EBRO 650
ups.type: offline / line interactive
(Given I have set up /opt/local/etc/ups.conf).
If you want a second, and run upsc zigor again, you get
Error: Data stale
In the kernel.log I get:
Sep 24 12:11:16 Marks-iMac kernel: USBF: 1122.116 [0xffffff801a1ed400] The IOUSBFamily is having trouble enumerating a USB device that has been plugged in. It will keep retrying. (Port 1 of Hub at 0xfd100000)
Sep 24 12:11:22 Marks-iMac kernel: com_apple_driver_AppleUSBCardReaderUMC:: Stop::Controller Reset
Sep 24 12:11:23 Marks-iMac kernel: USBF: 1128.982 [0xffffff801a1ed400] The IOUSBFamily has successfully enumerated the device.
Sep 24 12:11:23 Marks-iMac kernel: USBMSC Identifier (non-unique): 000000009833 0x5ac 0x8403 0x9833
If I stop and re-start the drivers - everything works again, ONCE.
I _think_ related to this - it's not exactly ideal to have to unplug, and re-plug the USB cable each time I restart my machine - so I'm GUESSING I have an issue still with the NUTDummy mechanism, but I'm not sure I know what it could be…
On 24 Sep 2012, at 04:33, Charles Lepple wrote:
> On Sep 23, 2012, at 1:45 PM, Mark Burton wrote:
>> Yes it does, My only issue is that it doesn't seem to be able to get a reading on the status of the device (battery level, or whether it's on power or not)…. :-(
>> Hence turning to NUT
> Curious as to what you get when you try running scutil:
> $ echo show State:/IOKit/PowerSources/UPS0 | scutil
> (The name might not be "UPS0" - if not, try "echo list 'State:/IOKit/PowerSources/.*' | scutil" and use that name)
> There is a NUT driver that can use this information (macosx-ups), but if the GUI is missing information, that driver might not see it either.
> The solution to get the blazer_usb driver is actually discussed here: http://lists.apple.com/archives/usb/2010/Nov/msg00056.html (the .plist refers to the USB Vendor ID and Product ID for your UPS, if I am not mistaken).
> It's been on my list of things to do to automate creating a kext like that. Let me know whether that information is still up to date.
> Charles Lepple
> clepple at gmail
More information about the Nut-upsuser