[Nut-upsuser] Zigor on Mac Os X

Mark Burton 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
<dictionary> {
  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 [0] = State:/IOKit/Power/CPUPower
  subKey [1] = State:/IOKit/PowerManagement/CurrentSettings
  subKey [2] = State:/IOKit/PowerManagement/SystemLoad
  subKey [3] = State:/IOKit/PowerManagement/SystemLoad/Detailed
  subKey [4] = 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"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleGetInfoString</key>
    <string>Dummy UPS Driver</string>
    <key>CFBundleIdentifier</key>
    <string>com.intelms.driver.dummy</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>NUTDummy</string>
    <key>CFBundlePackageType</key>
    <string>KEXT</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1.0.0</string>
    <key>IOKitPersonalities</key>
    <dict>
        <key>Uninterruptible Power Supply</key>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>com.apple.kpi.iokit</string>
            <key>IOClass</key>
            <string>IOService</string>
            <key>IOProviderClass</key>
            <string>IOUSBInterface</string>
            <key>idVendor</key>
            <integer>1</integer>
            <key>idProduct</key>
            <integer>0</integer>
            <key>bInterfaceNumber</key>
            <string>*</string>
            <key>bConfigurationValue</key>
            <string>*</string>
        </dict>
    </dict>
    <key>OSBundleLibraries</key>
    <dict>
        <key>com.apple.iokit.IOUSBFamily</key>
        <string>1.8</string>
    </dict>
    <key>OSBundleRequired</key>
    <string>Root</string>
</dict>
</plist>

Now, the following commands work:
> sudo /opt/local/bin/upsdrvctl start
> sudo /opt/local/bin/upsd
> upsc zigor
battery.voltage: 13.90
battery.voltage.nominal: 12.0
beeper.status: disabled
device.mfr: ZIGOR
device.model: EBRO 650
device.type: ups
driver.name: blazer_usb
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.productid: 0000
driver.parameter.vendorid: 0001
driver.version: 2.6.1
driver.version.internal: 0.03
input.current.nominal: 2.8
input.frequency: 50.0
input.frequency.nominal: 50
input.voltage: 227.0
input.voltage.fault: 165.0
input.voltage.nominal: 230
output.voltage: 227.0
ups.delay.shutdown: 30
ups.delay.start: 180
ups.firmware: VER 1.74
ups.load: 10
ups.mfr: ZIGOR
ups.model: EBRO 650
ups.productid: 0000
ups.status: OL
ups.temperature: 0.0
ups.type: offline / line interactive
ups.vendorid: 0001

(Given I have set up /opt/local/etc/ups.conf).



HOWEVER :-(((((
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[0]: 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[0]: com_apple_driver_AppleUSBCardReaderUMC:: Stop::Controller Reset
Sep 24 12:11:23 Marks-iMac kernel[0]: USBF:     1128.982        [0xffffff801a1ed400] The IOUSBFamily has successfully enumerated the device.
Sep 24 12:11:23 Marks-iMac kernel[0]: 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… 

Any ideas?


Cheers

Mark.




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 mailing list