dell / libsmbios

library for interacting with Dell SMBIOS tables
Other
192 stars 39 forks source link

smbios-battery-ctl --get-charging-cfg on Dell Inspiron 7737 #141

Open p2004r opened 1 year ago

p2004r commented 1 year ago

It looks like I have the latest version of the utility.

$ sudo smbios-sys-info

Libsmbios version: 2.4.3

Product Name: Inspiron 7737

Vendor: Dell Inc.

BIOS Version: A10

....

But the query returns strange battery status

$ sudo smbios-battery-ctl --get-charging-cfg Traceback (most recent call last): File "/usr/sbin/smbios-battery-ctl", line 275, in sys.exit( main() ) File "/usr/sbin/smbios-battery-ctl", line 241, in main print_primary_battery_cfg() File "/usr/sbin/smbios-battery-ctl", line 190, in print_primary_battery_cfg mode = get_charging_mode() File "/usr/sbin/smbios-battery-ctl", line 143, in get_charging_mode raise RunTimeBatteryErr( main.RunTimeBatteryErr: Multiple charging modes enabled: adaptive and express enabled at the same time

Trying to change the charging status does not change anything.

`$ sudo smbios-battery-ctl --trace --set-charging-mode custom ENTER TokenTable() ENTER init(<libsmbios_c.smbios_token._TokenTable object at 0x7fbac1efe2c0>, 1, ) ENTER _errorOnNullPtrFN(<libsmbios_c.smbios_token.LPTokenTable object at 0x7fbac1efe340>, <_FuncPtr object at 0x7fbac1d5d900>, (1,), ) RAN CTYPES FUNCTION: token_table_factory LEAVE _errorOnNullPtrFN --> <libsmbios_c.smbios_token.LPTokenTable object at 0x7fbac1efe340>

LEAVE init --> None

LEAVE TokenTable --> <libsmbios_c.smbios_token._TokenTable object at 0x7fbac1efe2c0>

ENTER getitem(<libsmbios_c.smbios_token._TokenTable object at 0x7fbac1efe2c0>, 835, ) LEAVE getitem --> <libsmbios_c.Token ID 0x0343>

ENTER activate(<libsmbios_c.Token ID 0x0343>, ) ENTER _errorOnNegativeFN(0, <_FuncPtr object at 0x7fbac1d5df00>, (<libsmbios_c.Token ID 0x0343>,), ) RAN CTYPES FUNCTION: token_obj_activate LEAVE _errorOnNegativeFN --> 0

LEAVE activate --> 0

Charging mode has been set to: custom `

`$ sudo smbios-battery-ctl --trace --get-charging-cfg ENTER TokenTable() ENTER init(<libsmbios_c.smbios_token._TokenTable object at 0x7f37408fe2c0>, 1, ) ENTER _errorOnNullPtrFN(<libsmbios_c.smbios_token.LPTokenTable object at 0x7f37408fe340>, <_FuncPtr object at 0x7f374075d900>, (1,), ) RAN CTYPES FUNCTION: token_table_factory LEAVE _errorOnNullPtrFN --> <libsmbios_c.smbios_token.LPTokenTable object at 0x7f37408fe340>

LEAVE init --> None

LEAVE TokenTable --> <libsmbios_c.smbios_token._TokenTable object at 0x7f37408fe2c0>

ENTER getitem(<libsmbios_c.smbios_token._TokenTable object at 0x7f37408fe2c0>, 833, ) LEAVE getitem --> <libsmbios_c.Token ID 0x0341>

ENTER isActive(<libsmbios_c.Token ID 0x0341>, ) ENTER _errorOnNegativeFN(0, <_FuncPtr object at 0x7f374075de40>, (<libsmbios_c.Token ID 0x0341>,), ) RAN CTYPES FUNCTION: token_obj_is_active LEAVE _errorOnNegativeFN --> 0

LEAVE isActive --> 0

ENTER getitem(<libsmbios_c.smbios_token._TokenTable object at 0x7f37408fe2c0>, 834, ) LEAVE getitem --> <libsmbios_c.Token ID 0x0342>

ENTER isActive(<libsmbios_c.Token ID 0x0342>, ) ENTER _errorOnNegativeFN(1, <_FuncPtr object at 0x7f374075de40>, (<libsmbios_c.Token ID 0x0342>,), ) RAN CTYPES FUNCTION: token_obj_is_active LEAVE _errorOnNegativeFN --> 1

LEAVE isActive --> 1

ENTER getitem(<libsmbios_c.smbios_token._TokenTable object at 0x7f37408fe2c0>, 835, ) LEAVE getitem --> <libsmbios_c.Token ID 0x0343>

ENTER isActive(<libsmbios_c.Token ID 0x0343>, ) ENTER _errorOnNegativeFN(0, <_FuncPtr object at 0x7f374075de40>, (<libsmbios_c.Token ID 0x0343>,), ) RAN CTYPES FUNCTION: token_obj_is_active LEAVE _errorOnNegativeFN --> 0

LEAVE isActive --> 0

ENTER getitem(<libsmbios_c.smbios_token._TokenTable object at 0x7f37408fe2c0>, 838, ) LEAVE getitem --> <libsmbios_c.Token ID 0x0346>

ENTER isActive(<libsmbios_c.Token ID 0x0346>, ) ENTER _errorOnNegativeFN(0, <_FuncPtr object at 0x7f374075de40>, (<libsmbios_c.Token ID 0x0346>,), ) RAN CTYPES FUNCTION: token_obj_is_active LEAVE _errorOnNegativeFN --> 0

LEAVE isActive --> 0

ENTER getitem(<libsmbios_c.smbios_token._TokenTable object at 0x7f37408fe2c0>, 839, ) LEAVE getitem --> <libsmbios_c.Token ID 0x0347>

ENTER isActive(<libsmbios_c.Token ID 0x0347>, ) ENTER _errorOnNegativeFN(1, <_FuncPtr object at 0x7f374075de40>, (<libsmbios_c.Token ID 0x0347>,), ) RAN CTYPES FUNCTION: token_obj_is_active LEAVE _errorOnNegativeFN --> 1

LEAVE isActive --> 1

Traceback (most recent call last): File "/usr/sbin/smbios-battery-ctl", line 275, in sys.exit( main() ) File "/usr/sbin/smbios-battery-ctl", line 241, in main print_primary_battery_cfg() File "/usr/sbin/smbios-battery-ctl", line 190, in print_primary_battery_cfg mode = get_charging_mode() File "/usr/sbin/smbios-battery-ctl", line 143, in get_charging_mode raise RunTimeBatteryErr( main.RunTimeBatteryErr: Multiple charging modes enabled: adaptive and express enabled at the same time ` I couldn't find a similar problem by searching. I ask for your help. I am changing the third battery in the laptop. Without a storage mode, they do not live long. :(

p2004r commented 1 year ago

I ran in the old version of python and some of the errors are fixed.

$ sudo python3.6 /usr/sbin/smbios-token-ctl --dump-tokens-csv ID,Type,Value,Name,Setting 0x007d,bool,true,LCD Brightness,Value 0x0180,bool,true,Wireless LAN,Enable 0x017f,bool,false,Wireless LAN,Disable 0x0152,bool,true,Bluetooth Devices,Enabled 0x0153,bool,false,Bluetooth Devices,Disabled 0x017c,bool,true,Cellular Radio,Enable 0x017b,bool,false,Cellular Radio,Disable 0x002e,bool,false,Embedded NIC1,Disable 0x002d,bool,true,Embedded NIC1,Enable with PXE 0x006e,bool,true,Embedded NIC1,Enable without Boot Support 0x018a,bool,true,External USB Ports,Enabled 0x0189,bool,false,External USB Ports,Disabled 0x009b,bool,false,"USB Emulation, USB Boot Capable",Enabled 0x009c,bool,true,USB Emulation,Disabled 0x012d,bool,false,Energy Star Logo,Enable 0x012e,bool,true,Energy Star Logo,Disable 0x0114,bool,false,Wireless Device,Disable 0x0115,bool,true,Wireless Device Controlled by Application,Enable 0x0116,bool,false,Wireless Device Controlled by Hotkey and Application,Enable 0x018e,bool,false,PC Card and 1394,Enabled 0x018d,bool,true,PC Card and 1394,Disabled 0x0194,bool,false,Wireless Switch Changes,Permitted 0x0193,bool,true,Wireless Switch Changes,Denied 0x00ea,bool,false,POST Boot Testing,Minimal 0x00eb,bool,true,POST Boot Testing,Thorough 0xfe00,bool,true,unknown,unknown 0xfe01,bool,false,unknown,unknown 0xfea0,bool,true,unknown,unknown 0xfea1,bool,false,unknown,unknown 0x01e1,bool,true,Keyboard Illumination,Off 0x01e2,bool,false,Keyboard Illumination,On 0x01e3,bool,false,Keyboard Illumination,Auto 0x02a5,bool,true,Hard drive free fall protection,Enable 0x02a6,bool,false,hard drive free fall protection,disable 0x800c,bool,true,Trusted Platform Module,Deactivated 0x024a,bool,false,Trusted Platform Module,Activate 0x00ed,bool,false,SpeedStep,Disabled 0x00ee,bool,false,SpeedStep,Maximum Performance 0x00ef,bool,false,SpeedStep,Maximum Battery 0x00f0,bool,true,SpeedStep,Automatic 0x010e,bool,false,Power Warning,Enable 0x010f,bool,true,Power Warning,Disable 0x0135,bool,false,SATA Controller,OFF 0x0136,bool,false,SATA Controller,Combined 0x0137,bool,false,SATA Controller,ATA 0x0138,bool,true,SATA Controller,AHCI 0x0139,bool,false,SATA Controller,RAID 0x01fe,bool,false,SATA Controller,QDMA 0x033c,bool,false,SATA Controller,SmartResponse 0x0144,bool,true,TPM Enable,Off 0x0145,bool,false,TPM Enable,Enabled 0x0146,bool,true,USB Wake Support,Off 0x0147,bool,false,USB Wake Support,Enabled 0x033e,bool,true,Function Key Behavior,Multimedia 0x033d,bool,false,Function Key Behavior,Native 0x014a,bool,false,CPU Virtualization,Disabled 0x014b,bool,true,CPU Virtualization,Enabled 0x033b,bool,false,Intel Smart Connect Technology,Disable 0x033a,bool,true,Intel Smart Connect Technology,Enable 0x0236,bool,true,USB PowerShare,Disabled 0x0235,bool,false,USB PowerShare,Enabled 0x033f,bool,true,HPC Mode,Enable 0x0109,bool,true,"USB Emulation On, No USB Boot",Enabled 0x0133,bool,true,On-board Serial ATA 2 Controller,Disable 0x0134,bool,false,Redundant Memory,RAID 0x013e,bool,false,Memory Remapping,Off 0x0156,bool,false,Intel Quick Resume Technology,Disabled 0x0157,bool,true,Intel Quick Resume Technology,Enabled 0x0341,bool,false,Primary Battery Charge Configuration,Primarily AC Use 0x0342,bool,true,Primary Battery Charge Configuration,Adaptive Charge 0x0343,bool,false,Primary Battery Charge Configuration,Custom Charge 0x0344,bool,true,Battery Slice Charge Configuration,Standard Charge 0x0345,bool,true,Battery Slice Charge Configuration,Express Charge 0x0346,bool,false,Primary Battery Charge Configuration,Standard Charge 0x0347,bool,true,Primary Battery Charge Configuration,Express Charge 0x0348,bool,false,Primary Battery Charge Configuration,Custom Charge 0x0349,bool,true,Primary Battery Custom Charge Start,NA 0x034a,bool,true,Primary Battery Custom Charge End,NA

However, it is not possible to change the values of the tokens.

$ sudo python3.6 /usr/sbin/smbios-token-ctl --import-token-settings-csv --token-csv=./smbtable.csv

Ignoring parsing error in CSV file:Traceback (most recent call last): File "/usr/sbin/smbios-token-ctl", line 143, in addToList val = int(line["Token Value"],16) KeyError: 'Token Value'

=============================================================================== Ignoring parsing error in CSV file:Traceback (most recent call last): File "/usr/sbin/smbios-token-ctl", line 143, in addToList val = int(line["Token Value"],16) KeyError: 'Token Value'

=============================================================================== Ignoring parsing error in CSV file:Traceback (most recent call last): File "/usr/sbin/smbios-token-ctl", line 143, in addToList val = int(line["Token Value"],16) KeyError: 'Token Value'

=============================================================================== Ignoring parsing error in CSV file:Traceback (most recent call last): File "/usr/sbin/smbios-token-ctl", line 143, in addToList val = int(line["Token Value"],16) KeyError: 'Token Value'

=============================================================================== Ignoring parsing error in CSV file:Traceback (most recent call last): File "/usr/sbin/smbios-token-ctl", line 143, in addToList val = int(line["Token Value"],16) KeyError: 'Token Value'

=============================================================================== Ignoring parsing error in CSV file:Traceback (most recent call last): File "/usr/sbin/smbios-token-ctl", line 143, in addToList val = int(line["Token Value"],16) KeyError: 'Token Value'

=============================================================================== Ignoring parsing error in CSV file:Traceback (most recent call last): File "/usr/sbin/smbios-token-ctl", line 143, in addToList val = int(line["Token Value"],16) KeyError: 'Token Value'

Traceback (most recent call last): File "/usr/sbin/smbios-token-ctl", line 475, in sys.exit( main() ) File "/usr/sbin/smbios-token-ctl", line 388, in main exitcode = not importTokensCsv(tokenTable, tokenXlator, options, args) File "/usr/sbin/smbios-token-ctl", line 263, in importTokensCsv print(("Importing token values from '%s'") % args[0]) IndexError: list index out of range

$ cat ./smbtable.csv 0x0341,bool,true,"Primary Battery Charge Configuration","Primarily AC Use" 0x0342,bool,false,Primary Battery Charge Configuration,"Adaptive Charge" 0x0343,bool,false,Primary Battery Charge Configuration,Custom Charge 0x0344,bool,false,Battery Slice Charge Configuration,Standard Charge 0x0345,bool,false,Battery Slice Charge Configuration,Express Charge 0x0346,bool,false,Primary Battery Charge Configuration,Standard Charge 0x0347,bool,false,Primary Battery Charge Configuration,Express Charge 0x0348,bool,false,Primary Battery Charge Configuration,Custom Charge