Coder Social home page Coder Social logo

Comments (12)

poltpolt avatar poltpolt commented on August 15, 2024 1

it's due to my password in bios i guess, this aditional option to set it up in the program would be nice

$ powerprofilesctl get
power-saver
ThermalManagement=Optimized
PrimaryBattChargeCfg=Custom:50-55
$ bash -c "export PATH=/opt/dell/dcc:$PATH && sudo -n $(which cctk) --ThermalManagement=UltraPerformance"
$ powerprofilesctl get
power-saver

Setup Password is required to change the setting. Use --ValSetupPwd to provide password.
$ powerprofilesctl get
power-saver
$ bash -c "export PATH=/opt/dell/dcc:$PATH && sudo -n $(which cctk) --ThermalManagement --PrimaryBattChargeCfg"
$ cat /sys/class/power_supply/AC/uevent /sys/class/power_supply/BAT0/uevent
POWER_SUPPLY_NAME=AC
POWER_SUPPLY_TYPE=Mains
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Full
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-poly
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11400000
POWER_SUPPLY_VOLTAGE_NOW=12968000
POWER_SUPPLY_CURRENT_NOW=1000
POWER_SUPPLY_CHARGE_FULL_DESIGN=8339000
POWER_SUPPLY_CHARGE_FULL=8339000
POWER_SUPPLY_CHARGE_NOW=8339000
POWER_SUPPLY_CAPACITY=100
POWER_SUPPLY_CAPACITY_LEVEL=Full
POWER_SUPPLY_MODEL_NAME=DELL F8CPG26
POWER_SUPPLY_MANUFACTURER=BYD
POWER_SUPPLY_SERIAL_NUMBER=71
$ powerprofilesctl get

from dell-powermanager.

alexVinarskis avatar alexVinarskis commented on August 15, 2024 1

Thanks for the input. Will try to get first version up over the weekends!

from dell-powermanager.

poltpolt avatar poltpolt commented on August 15, 2024 1

I tried

`static Future _runCctk(String arg) async {
String biosPassword = await _readBiosPasswordFromFile();

if (Platform.isLinux) {
  return (await _shell.run('''bash -c "export PATH="${Constants.apiPathLinux}:\$PATH" && sudo -n \$(which cctk) --ValSetupPwd=$biosPassword $arg"'''))[0];
} else {
  return (await _shell.run('''cmd /c cmd /c "${Constants.apiPathWindows}" $arg'''))[0];
}

}

static Future _readBiosPasswordFromFile() async {
final file = File('${Platform.environment['HOME']}/.config/dell-powermanager/settings.ini'); // Use expanded path with environment variable
if (!await file.exists()) {
throw Exception('Dell power manager configuration file not found.');
}

final contents = await file.readAsString();
final passwordLine = contents.split('\n').firstWhere((line) => line.startsWith('bios_password='));
if (passwordLine == null) {
  throw Exception('BIOS password not found in configuration file.');
}

return passwordLine.split('=')[1].trim();

}
`
and manually pasted my bios_password=mypassword but cctk reported an error

Report operations and set operations must be separate.

Usage error.

Dell Command Configure Version 4.11.0 3 (Linux - Aug 8 2023, 13:46:48)
Copyright 2009 - 2023 Dell Inc. All rights reserved.

so I think that the password should only be passed to setting operations.

If you want to chat for live testing I'm on discord as poltpolt

from dell-powermanager.

alexVinarskis avatar alexVinarskis commented on August 15, 2024

Good find, thanks. powermanagement is actually only used to display OS's power setting. On this pic, top right corner, yellow box:

image

Does power profile switching itself do anything?
Does battery mode switching changes modes?

from dell-powermanager.

alexVinarskis avatar alexVinarskis commented on August 15, 2024

hehe thats an interesting one, didn't even know it exists :P
Definitely in this case need to option to provide password, and somehow store it in encrypted form within app's tmp data.

Will look into it in the next weeks (a bit busy these days) and update this thread.

Could you drop full info on your machine and OS? In an unlikely case that I am unable to reproduce these on my side.

from dell-powermanager.

poltpolt avatar poltpolt commented on August 15, 2024

from dell-powermanager.

xAlvzx avatar xAlvzx commented on August 15, 2024

I also have that error, and I confirm it is because of the BIOS password.
I use Arch Linux with the auto-cpufreq power manager.

~sudo cctk --ThermalManagement=Cool
Setup Password is required to change the setting. Use --ValSetupPwd to provide password.

~sudo cctk --ThermalManagement=Cool --ValSetupPwd=passwd
ThermalManagement=Cool

Laptop:
XPS 9520

from dell-powermanager.

alexVinarskis avatar alexVinarskis commented on August 15, 2024

@poltpolt powerprofilectl error message resolved in #32.

FYI to get logs you would now need to export POWERMANAGER_DEBUG=true before running the app. This is to prevent insane log spamming during normal operation.

from dell-powermanager.

poltpolt avatar poltpolt commented on August 15, 2024

Hi Alex
I think Logs were not the problem, logs were precise enough but I have tested the new master and still get so I guess it is still work in progress
$ bash -c "export PATH=/opt/dell/dcc:$PATH && sudo -n $(which cctk) --ThermalManagement=UltraPerformance"
Setup Password is required to change the setting. Use --ValSetupPwd to provide password.

I'm wiling to test and report but I don't know flutter at all so I cannot assist you in programming.

from dell-powermanager.

alexVinarskis avatar alexVinarskis commented on August 15, 2024

Correct, logs were removed just for cleaniness, and error wrt to power state fetching was fixed.

Bios password fetching implementation takes much longer than I though. Working branch here. Im actually working on this right now :) Will update here once its ready for testing, currently it still not there.

from dell-powermanager.

alexVinarskis avatar alexVinarskis commented on August 15, 2024

Correct, bios password should only be added when setting config. There are also 3 different types of passwords that are supported, owner one is handled a little bit differently. Final difficulty is having adding password to shell securely, such that it is not logged either, as in your example its simply exposed, thats bad.

I tested it as concept on my side, and it worked. Im finishing UI handling part now, as it becomes really convoluted to handle all edge cases. Hopefully will have testsable version in a few hours pushed.

Its better to have bug related conversations here in public forum. Wrt to just debug process, it indeed may be easier on discord - we have a small Dell server here. Initially made to fix speakers sound on XPS 9530, but it grew quite a bit since then :)

from dell-powermanager.

alexVinarskis avatar alexVinarskis commented on August 15, 2024

PR linked now supports Windows & Linux, both entering password every time, and to securely sto it on the device.
Will do minor UI fixes and further testing, and merge within a few days.

Aiming at new release in ~week.

from dell-powermanager.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.