StarLabsLtd / firmware

78 stars 5 forks source link

[StarLite Mk IV] Battery not recognised #162

Closed CommonLoon102 closed 5 months ago

CommonLoon102 commented 5 months ago

The OS (Ubuntu 24.04) cannot detect any battery, it doesn't indicate anything. upower -i /org/freedesktop/UPower/devices/battery_BAT0 gives only (null). There is no battery info in the settings either.

native-path:          (null)
power supply:         no
updated:              Thu 01 Jan 1970 01:00:00 AM CET (1716922293 seconds ago)
has history:          no
has statistics:       no
unknown
  warning-level:       unknown
  battery-level:       unknown
  percentage:          0% (should be ignored)
  icon-name:           '(null)'

If I open the BIOS on boot and quit without any change, then battery indication works correctly. But only if I enter the BIOS on boot. If I don't, the OS doesn't know about the battery at all. I had the same issue on Ubuntu 22. I haven't used the device for a while (months). I don't remember having this issue before. I haven't updated or changed the BIOS, neither the OS. Then I upgraded to Ubuntu 24, but the issue is the same.

Correct output if I enter the BIOS on boot:

  native-path:          BAT0
  serial:               0000
  power supply:         yes
  updated:              Tue 28 May 2024 08:59:43 PM CEST (4 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              27.36 Wh   
    energy-empty:        0 Wh
    energy-full:         30.4 Wh
    energy-full-design:  30.4 Wh
    energy-rate:         2.31 W
    voltage:             8.291 V
    charge-cycles:       N/A
    time to empty:       11.8 hours
    percentage:          90%
    capacity:            100%
    icon-name:          'battery-full-symbolic'
  History (charge):
    1716922753  90.000  discharging
  History (rate):
    1716922783  2.310   discharging
    1716922753  3.214   discharging
    1716922723  2.553   discharging
    1716922693  6.140   discharging

OS: Ubuntu 24.04

BIOS Version: 1.0.0 EC Version: 1.04 BIOS Vendor: American Megatrends

Sean-StarLabs commented 5 months ago

We're no longer releasing updates for the AMI firmware, so I'd recommend installing coreboot.

CommonLoon102 commented 5 months ago

Thanks for the quick reply. Do I have the latest firmware for AMI then?

Sean-StarLabs commented 5 months ago

Yes

CommonLoon102 commented 5 months ago

Thanks. I found it in the meantime as well. There was only one initial version. https://github.com/StarLabsLtd/firmware/tree/master/StarLite/MkIV/AMI Then I will just open the BIOS every time I boot...

Sean-StarLabs commented 5 months ago

Out of interest, why do you not want to use coreboot?

CommonLoon102 commented 5 months ago

Because what if it is even worse? I have a workaround I can live with. I don't take unnecessary risks :)

Sean-StarLabs commented 5 months ago

Haha, it's most definately not - but you can always switch back!

CommonLoon102 commented 5 months ago

Maybe on one rainy Sunday evening I will give it a try.

CommonLoon102 commented 5 months ago

Although it is not raining, but a Sunday evening... So I have realised that my workaround was just random luck. It doesn't matter if I enter the BIOS or anything. I decided to give coreboot a try, but after fwupdmgr switch-branch I only get no devices. What should I do?

https://starlabsltd.github.io/firmware/methods/lvfs_requirements/

ITE requirements (only for standalone EC updates) Permalink

  • The disk cannot be encrypted with LUKS

Can this be a problem? I have the disk encrypted with LUKS.

Sean-StarLabs commented 5 months ago

Can this be a problem? I have the disk encrypted with LUKS.

No

Assuming requirements are met, would need to see the output of sudo fwupdtool get-devices --plugins flashrom --verbose

CommonLoon102 commented 5 months ago

Inspecting the output of sudo fwupdtool get-devices --plugins flashrom --verbose gave me the idea to plug in the charger. That was the issue. Now the flashing is in progress. Thanks.

CommonLoon102 commented 5 months ago

Now it is running on coreboot. I restarted 10 times and shows the battery percentage 10 out of 10. Closing this. Thanks again.