Sundeep Mediratta
2015-Jun-27 03:07 UTC
[Nut-upsuser] Driver macosx-ups failing on Yosemite
> On Jun 26, 2015, at 9:25 PM, Charles Lepple <clepple at gmail.com> wrote: > > On Jun 26, 2015, at 8:35 AM, Sundeep Mediratta <smedius at gmail.com> wrote: > >> OSX Yosemite 10.10.3 >> Nut version 2.6.5 >> Installed via Macports >> Device is Cyberpower CP1000AVRLCD >> Device is visible and is monitored in the OSX control panel >> >> Error- >> >> macosx-ups -DD -a cyberpower > > Can you please increase the debug level to -DDD? > > -- > Charles Lepple > clepple at gmailsudo macosx-ups -DDDD -a cyberpower Network UPS Tools - Mac OS X UPS meta-driver 1.0 (2.6.5-Unversioned directory) Warning: This is an experimental driver. Some features may not function correctly. 0.000000 debug level is '4' 0.000233 upsdrv_initups(): Power Sources blob: <CFArray 0x7ffd18605480 [0x7fff7443bed0]>{type = immutable, count = 1, values = ( 0 : <CFBasicHash 0x7ffd18605360 [0x7fff7443bed0]>{type = immutable dict, count = 10, entries => 0 : <CFString 0x7ffd18605800 [0x7fff7443bed0]>{contents = "Voltage"} = <CFNumber 0x4c9037 [0x7fff7443bed0]>{value = +19600, type = kCFNumberSInt64Type} 1 : <CFString 0x7ffd18605820 [0x7fff7443bed0]>{contents = "Power Source ID"} = <CFNumber 0x37 [0x7fff7443bed0]>{value = +0, type = kCFNumberSInt64Type} 3 : <CFString 0x7ffd186059a0 [0x7fff7443bed0]>{contents = "Transport Type"} = <CFString 0x7ffd18605850 [0x7fff7443bed0]>{contents = "USB"} 6 : <CFString 0x7ffd18605970 [0x7fff7443bed0]>{contents = "Current Capacity"} = <CFNumber 0x6437 [0x7fff7443bed0]>{value = +100, type = kCFNumberSInt64Type} 7 : <CFString 0x7ffd186059c0 [0x7fff7443bed0]>{contents = "Time to Empty"} = <CFNumber 0x2337 [0x7fff7443bed0]>{value = +35, type = kCFNumberSInt64Type} 8 : <CFString 0x7ffd18605950 [0x7fff7443bed0]>{contents = "Max Capacity"} = <CFNumber 0x6437 [0x7fff7443bed0]>{value = +100, type = kCFNumberSInt64Type} 9 : <CFString 0x7ffd18605790 [0x7fff7443bed0]>{contents = "Is Charging"} = <CFBoolean 0x7fff7443c8a8 [0x7fff7443bed0]>{value = true} 10 : <CFString 0x7ffd186057b0 [0x7fff7443bed0]>{contents = "Power Source State"} = <CFString 0x7ffd18605310 [0x7fff7443bed0]>{contents = "AC Power"} 11 : <CFString 0x7ffd186057e0 [0x7fff7443bed0]>{contents = "Is Present"} = <CFBoolean 0x7fff7443c8a8 [0x7fff7443bed0]>{value = true} 12 : <CFString 0x7fff7440b7c0 [0x7fff7443bed0]>{contents = "Name"} = <CFString 0x7ffd18605330 [0x7fff7443bed0]>{contents = "UPS CP1000AVRLCD"} } )} 0.001803 Matching power supply key names against regex '/UPS' 0.001817 Matching power supply model names against regex 'CP1000AVRLCD' 0.001838 Number of power supplies found: 1 <CFArray 0x7ffd18605910 [0x7fff7443bed0]>{type = immutable, count = 1, values = ( 0 : <CFBasicHash 0x7ffd18605360 [0x7fff7443bed0]>{type = immutable dict, count = 10, entries => 0 : <CFString 0x7ffd18605800 [0x7fff7443bed0]>{contents = "Voltage"} = <CFNumber 0x4c9037 [0x7fff7443bed0]>{value = +19600, type = kCFNumberSInt64Type} 1 : <CFString 0x7ffd18605820 [0x7fff7443bed0]>{contents = "Power Source ID"} = <CFNumber 0x37 [0x7fff7443bed0]>{value = +0, type = kCFNumberSInt64Type} 3 : <CFString 0x7ffd186059a0 [0x7fff7443bed0]>{contents = "Transport Type"} = <CFString 0x7ffd18605850 [0x7fff7443bed0]>{contents = "USB"} 6 : <CFString 0x7ffd18605970 [0x7fff7443bed0]>{contents = "Current Capacity"} = <CFNumber 0x6437 [0x7fff7443bed0]>{value = +100, type = kCFNumberSInt64Type} 7 : <CFString 0x7ffd186059c0 [0x7fff7443bed0]>{contents = "Time to Empty"} = <CFNumber 0x2337 [0x7fff7443bed0]>{value = +35, type = kCFNumberSInt64Type} 8 : <CFString 0x7ffd18605950 [0x7fff7443bed0]>{contents = "Max Capacity"} = <CFNumber 0x6437 [0x7fff7443bed0]>{value = +100, type = kCFNumberSInt64Type} 9 : <CFString 0x7ffd18605790 [0x7fff7443bed0]>{contents = "Is Charging"} = <CFBoolean 0x7fff7443c8a8 [0x7fff7443bed0]>{value = true} 10 : <CFString 0x7ffd186057b0 [0x7fff7443bed0]>{contents = "Power Source State"} = <CFString 0x7ffd18605310 [0x7fff7443bed0]>{contents = "AC Power"} 11 : <CFString 0x7ffd186057e0 [0x7fff7443bed0]>{contents = "Is Present"} = <CFBoolean 0x7fff7443c8a8 [0x7fff7443bed0]>{value = true} 12 : <CFString 0x7fff7440b7c0 [0x7fff7443bed0]>{contents = "Name"} = <CFString 0x7ffd18605330 [0x7fff7443bed0]>{contents = "UPS CP1000AVRLCD"} } )} 2015-06-26 23:02:11.480 macosx-ups[51792:5073268] -[__NSCFDictionary _getCString:maxLength:encoding:]: unrecognized selector sent to instance 0x7ffd18605360 2015-06-26 23:02:11.484 macosx-ups[51792:5073268] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary _getCString:maxLength:encoding:]: unrecognized selector sent to instance 0x7ffd18605360' *** First throw call stack: ( 0 CoreFoundation 0x00007fff8a12c03c __exceptionPreprocess + 172 1 libobjc.A.dylib 0x00007fff8726c76e objc_exception_throw + 43 2 CoreFoundation 0x00007fff8a12f0ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205 3 CoreFoundation 0x00007fff8a074e24 ___forwarding___ + 1028 4 CoreFoundation 0x00007fff8a074998 _CF_forwarding_prep_0 + 120 5 CoreFoundation 0x00007fff89ffd11d CFStringGetCString + 173 6 macosx-ups 0x000000010c435ebb upsdrv_initups + 409 7 macosx-ups 0x000000010c436bd2 main + 1040 8 libdyld.dylib 0x00007fff9083e5c9 start + 1 9 ??? 0x0000000000000004 0x0 + 4 ) libc++abi.dylib: terminating with uncaught exception of type NSException
On Jun 26, 2015, at 11:07 PM, Sundeep Mediratta <smedius at gmail.com> wrote:> 0.000233 upsdrv_initups(): Power Sources blob: > <CFArray 0x7ffd18605480 [0x7fff7443bed0]>{type = immutable, count = 1, values = ( > 0 : <CFBasicHash 0x7ffd18605360 [0x7fff7443bed0]>{type = immutable dict, count = 10, > entries =>Thanks. There is a subtle difference in the "Power Sources" blob: on 10.9 and earlier, it is a dictionary rather than an array. I will try later today to see if there is a better way to enumerate the power sources. -- Charles Lepple clepple at gmail
On Jun 27, 2015, at 9:17 AM, Charles Lepple <clepple at gmail.com> wrote:> On Jun 26, 2015, at 11:07 PM, Sundeep Mediratta <smedius at gmail.com> wrote: > >> 0.000233 upsdrv_initups(): Power Sources blob: >> <CFArray 0x7ffd18605480 [0x7fff7443bed0]>{type = immutable, count = 1, values = ( >> 0 : <CFBasicHash 0x7ffd18605360 [0x7fff7443bed0]>{type = immutable dict, count = 10, >> entries => > > Thanks. There is a subtle difference in the "Power Sources" blob: on 10.9 and earlier, it is a dictionary rather than an array. I will try later today to see if there is a better way to enumerate the power sources.I can't test this easily on 10.10 (my 10.10 box is powered by a serial UPS that does not show up in Energy Saver), but it uses the proper API now, and works on 10.9. I pushed the branch as macosx_power_dict: https://github.com/networkupstools/nut/commit/b608975b55895e853ba8d24fc08761bff2c65940 Patch: https://github.com/networkupstools/nut/compare/macosx_power_dict.diff I don't use MacPorts much, but I think this is how you would add this patch to the NUT portfile: https://guide.macports.org/#development.patches.source patchfiles macosx_power_dict.diff patch.pre_args -p1 -- Charles Lepple clepple at gmail