Devuan bug report logs - #394
Cinnamon on Beowulf - Power Management fails to update battery status

version graph

Package: gir1.2-upowerglib-1.0; Maintainer for gir1.2-upowerglib-1.0 is Daniel Reurich <daniel@devuan.org>; Source for gir1.2-upowerglib-1.0 is src:upower.

Reported by: josh.bowyer@protonmail.com

Date: Thu, 13 Feb 2020 18:48:04 UTC

Severity: normal

Tags: beowulf

Found in version 1:0.9.23-2+devuan1.3

Full log


Message #5 received at submit@bugs.devuan.org (full text, mbox, reply):

Received: (at submit) by bugs.devuan.org; 13 Feb 2020 18:34:17 +0000
Return-Path: <josh.bowyer@protonmail.com>
Delivered-To: devuanbugs@dyne.org
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Thu, 13 Feb 2020 18:34:17 +0000 (UTC)
Received: from mail4.protonmail.ch (mail4.protonmail.ch [185.70.40.27])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 92625F60A26
	for <submit@bugs.devuan.org>; Thu, 13 Feb 2020 19:28:55 +0100 (CET)
Authentication-Results: vm6.ganeti.dyne.org;
	dkim=pass (1024-bit key; secure) header.d=protonmail.com header.i=@protonmail.com header.b="PM3bh0iZ";
	dkim-atps=neutral
Date: Thu, 13 Feb 2020 18:28:48 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
	s=default; t=1581618534;
	bh=8UV6Oc3z4G1VHGV9bLv7DkMWk+g+Y3usvFBJLJimCs8=;
	h=Date:To:From:Reply-To:Subject:Feedback-ID:From;
	b=PM3bh0iZXytlazlT5TNTWOefPCjSeqcdQsUs7Fe8BeBWn+qkdRhYVxZloLHWICQ3N
	 A7LtY9TdD47PKmlzqJhr1eentrISeF4wwy2lVL1T5MhTBiwPj2Usk1mSqQO+bJUP+v
	 ver1XtpvK+WD2NHw5o9z/nU5W5sCABjjJqc025yo=
To: "submit@bugs.devuan.org" <submit@bugs.devuan.org>
From: josh.bowyer@protonmail.com
Reply-To: josh.bowyer@protonmail.com
Subject: Cinnamon on Beowulf - Power Management fails to update battery status
Message-ID: <EWorRCJFrpb1DF0Nwfjl8S_sHGNwFAYAkzrwhz87JqsNxVuD8ovjHuJGw21eCChyrTCUANUawn5NGyfoYwrpP_Up3_mWkq9TgcQcn72tl8Q=@protonmail.com>
Feedback-ID: atopSf789bCH4bZrgixkhTbB_qVYhkC8CPQhxeIlly0-xOZm5VH8DGdJ3ohrnYrdSB5O5NXkKrmvoXCgjg7bWQ==:Ext:ProtonMail
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="b1_5b5bb77909645a57d4cb2c1ea83a03db"
X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,
	RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=disabled
	version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org
[Message part 1 (text/plain, inline)]
Package: gir1.2-upowerglib-1.0
Version: 1:0.9.23-2+devuan1.3

On Devuan Beowulf, the Cinnamon Power Management (and therefore also the battery indicator applet) fail to read updated information from the system.

The script that handles this is cs_power.py, which is a module called by cinnamon-settings.py. I have pared it down to the bare minimum lines to return the battery percentage and state:

###################################################################
#!/usr/bin/python3

import gi
gi.require_version('CinnamonDesktop', '3.0')
gi.require_version('UPowerGlib', '1.0')
from gi.repository import CinnamonDesktop, Gdk, UPowerGlib, Gio

(UP_ID, UP_VENDOR, UP_MODEL, UP_TYPE, UP_ICON, UP_PERCENTAGE, UP_STATE, UP_SECONDS) = range(8)

up_client = UPowerGlib.Client.new()

csd_power_proxy = Gio.DBusProxy.new_sync(
    Gio.bus_get_sync(Gio.BusType.SESSION, None),
    Gio.DBusProxyFlags.NONE,
    None,
    "org.cinnamon.SettingsDaemon.Power",
    "/org/cinnamon/SettingsDaemon/Power",
    "org.cinnamon.SettingsDaemon.Power",
    None)

devices = csd_power_proxy.GetDevices()
for device in devices:
    if device[UP_TYPE] == UPowerGlib.DeviceKind.BATTERY:
        batdevice = device
percentage = batdevice[UP_PERCENTAGE]
state = batdevice[UP_STATE]

print(percentage)
print(state)
###############################################

The result, when I ran it, showed 89% and discharging whereas $(upower -i /org/freedesktop/UPower/devices/battery_BAT0) returned 58% and charging. Therefore the issue is with UPowerGlib, which is provided by the package gir1.2-upowerglib-1.0

Current software versions:

Lenovo Thinkpad T480s
Linux Josh-Laptop 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux
Devuan Beowulf
gir1.2-upowerglib-1.0/now 1:0.9.23-2+devuan1.3 amd64
cinnamon-settings-daemon/testing,now 3.8.4-2 amd64
upower/now 1:0.9.23-2+devuan1.3 amd64
[Message part 2 (text/html, inline)]

Send a report that this bug log contains spam.


Devuan BTS -- Powered by Debian bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.

Devuan Bugs Owner <owner@bugs.devuan.org>.
Last modified: Wed Dec 8 11:53:12 2021;