{"action":"created","issue":{"url":"https://api.github.com/repos/linrunner/TLP/issues/369","repository_url":"https://api.github.com/repos/linrunner/TLP","labels_url":"https://api.github.com/repos/linrunner/TLP/issues/369/labels{/name}","comments_url":"https://api.github.com/repos/linrunner/TLP/issues/369/comments","events_url":"https://api.github.com/repos/linrunner/TLP/issues/369/events","html_url":"https://github.com/linrunner/TLP/issues/369","id":372220756,"node_id":"MDU6SXNzdWUzNzIyMjA3NTY=","number":369,"title":"TLP sets wrong values for charge_stop_threshold and charge_start_threshold and displays wrong with natacpi","user":{"login":"samcv","id":20145557,"node_id":"MDQ6VXNlcjIwMTQ1NTU3","avatar_url":"https://avatars1.githubusercontent.com/u/20145557?v=4","gravatar_id":"","url":"https://api.github.com/users/samcv","html_url":"https://github.com/samcv","followers_url":"https://api.github.com/users/samcv/followers","following_url":"https://api.github.com/users/samcv/following{/other_user}","gists_url":"https://api.github.com/users/samcv/gists{/gist_id}","starred_url":"https://api.github.com/users/samcv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samcv/subscriptions","organizations_url":"https://api.github.com/users/samcv/orgs","repos_url":"https://api.github.com/users/samcv/repos","events_url":"https://api.github.com/users/samcv/events{/privacy}","received_events_url":"https://api.github.com/users/samcv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-20T15:08:12Z","updated_at":"2018-10-23T05:07:41Z","closed_at":null,"author_association":"NONE","body":"### Symptom data\r\n\r\n1. Does the problem occur on battery or AC or both?\r\n* Both\r\n2. Attach the *full* output of `tlp-stat` via https://gist.github.com/ for *all* cases of 1.\r\n* Battery: https://gist.github.com/samcv/bc5c177691b5374ebf6becfe920dbdba\r\n* AC: https://gist.github.com/samcv/c094f557d94cb66e93caecbc9ef178ff\r\n\r\n### Expected behavior\r\nExpected the TLP config to set `/sys` to the same values I set them to:\r\n```\r\nfor i in /sys/class/power_supply/BAT{0,1}/charge_{start,stop}_threshold; do printf \"%s = %s [%%]\\n\" \"$i\" \"$(cat \"$i\")\"; done\r\n/sys/class/power_supply/BAT0/charge_start_threshold = 90 [%]\r\n/sys/class/power_supply/BAT0/charge_stop_threshold = 95 [%]\r\n/sys/class/power_supply/BAT1/charge_start_threshold = 90 [%]\r\n/sys/class/power_supply/BAT1/charge_stop_threshold = 95 [%]\r\n```\r\n### Actual behavior\r\nThis is what they are actually set to, note how start is at 95, and stop is at 90 which that is the opposite of how the config file has it set.\r\n```\r\nfor i in /sys/class/power_supply/BAT{0,1}/charge_{start,stop}_threshold; do printf \"%s = %s [%%]\\n\" \"$i\" \"$(cat \"$i\")\"; done\r\n/sys/class/power_supply/BAT0/charge_start_threshold = 95 [%]\r\n/sys/class/power_supply/BAT0/charge_stop_threshold = 90 [%]\r\n/sys/class/power_supply/BAT1/charge_start_threshold = 95 [%]\r\n/sys/class/power_supply/BAT1/charge_stop_threshold = 90 [%]\r\n```\r\nThe output from tlp stat -b shows all values at 90% which is also incorrect as well, since those are not\r\nthe values which the `/sys` system shows.\r\n```\r\ntlp stat -b | grep _thresh\r\n/sys/class/power_supply/BAT0/charge_start_threshold         =     90 [%]\r\n/sys/class/power_supply/BAT0/charge_stop_threshold          =     90 [%]\r\n/sys/class/power_supply/BAT1/charge_start_threshold         =     90 [%]\r\n/sys/class/power_supply/BAT1/charge_stop_threshold          =     90 [%]\r\n```\r\n### Steps to reproduce the problem\r\nFor the config, do:\r\n```\r\nSTART_CHARGE_THRESH_BAT0=90\r\nSTOP_CHARGE_THRESH_BAT0=95\r\nSTART_CHARGE_THRESH_BAT1=90\r\nSTOP_CHARGE_THRESH_BAT1=95\r\n```\r\nRestart tlp and then check the output of `tlp stat -b | grep _thresh` and the output of `for i in /sys/class/power_supply/BAT{0,1}/charge_{start,stop}_threshold; do printf \"%s = %s [%%]\\n\" \"$i\" \"$(cat \"$i\")\"; done`"},"comment":{"url":"https://api.github.com/repos/linrunner/TLP/issues/comments/432093990","html_url":"https://github.com/linrunner/TLP/issues/369#issuecomment-432093990","issue_url":"https://api.github.com/repos/linrunner/TLP/issues/369","id":432093990,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjA5Mzk5MA==","user":{"login":"linrunner","id":794121,"node_id":"MDQ6VXNlcjc5NDEyMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/794121?v=4","gravatar_id":"","url":"https://api.github.com/users/linrunner","html_url":"https://github.com/linrunner","followers_url":"https://api.github.com/users/linrunner/followers","following_url":"https://api.github.com/users/linrunner/following{/other_user}","gists_url":"https://api.github.com/users/linrunner/gists{/gist_id}","starred_url":"https://api.github.com/users/linrunner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linrunner/subscriptions","organizations_url":"https://api.github.com/users/linrunner/orgs","repos_url":"https://api.github.com/users/linrunner/repos","events_url":"https://api.github.com/users/linrunner/events{/privacy}","received_events_url":"https://api.github.com/users/linrunner/received_events","type":"User","site_admin":false},"created_at":"2018-10-23T05:07:41Z","updated_at":"2018-10-23T05:07:41Z","author_association":"OWNER","body":"@self: don't read bug reports on smartphone ;-)\r\n\r\n@samcv : it's strange that reading the sysfiles produces results differing from tlp-stat -b because the latter just reads the same sysfiles. I think we use the suggestion of @dywisor with some modification:\r\n\r\nConfigure trace:\r\n\r\n     TLP_DEBUG=\"run bat\"\r\n\r\nDon't change thresholds in config. \r\n\r\nComment tlp-stat Line 519  to\r\n\r\n    #nodebug=1\r\n\r\nChange thresholds to some other values\r\n\r\n   tlp setcharge 40 60 BAT0\r\n\r\nCheck sysfiles\r\n\r\n    for i in /sys/class/power_supply/BAT{0,1}/charge_{start,stop}_threshold; do printf \"%s = %s [%%]\\n\" \"$i\" \"$(cat \"$i\")\"; done\r\n\r\nCheck with tlp-stat\r\n\r\n    tlp-stat -b\r\n\r\nPost all terminal outputs. Post trace by\r\n\r\n   tlp-stat -T"}}
{"actor":{"display_login":"linrunner"}}