Battery Log and Amazfit do not work on SFOS 4

My problem is, that after Update on SFOS 4 some apps not complete work and no update is available. I think it is the new sandboxing and the not exist statefs. Why ist statefs obsolate since 4.0.1.24?
For me not work follow important apps:
Battery log: no rest time possible (I also not understoud why this function not implement in SFOS 4)
Amazfish: no calendar on the watch
Can anybody give me an workarraound (maybe install the old statefs and a line to give the Amazfitapp access on the calendar)?
Some other apps are also affected in the jolla store. In my opinion should someone check before rollout a new SFOS update. :frowning:

2 Likes

re th calendar/events in Amazfish: I know @piggz is aware of it

Hi,

I have done some work with Batterylog, the results of which are currently available for testing here:

https://build.sailfishos.org/package/show/home:nephros:devel/harbour-batterylog

with source code here:

Changes to latest version:

  • read charge state from BMS sysfs files
  • ^^^ this restores the logging and the graph, BUT it now logs Charge instead of Energy
  • remove StateFS bits (which has been removed in SFOS >= 4.0)
  • compute “Energy” from charge and OCV voltage, like it was done in StateFS.
  • all references in the UI to “Energy” in [Wh] are not read from the battery but calculated using the current Charge ([mA]) and battery Voltage. ~This will be has always been somewhat inaccurate depending on how much the Voltage changes over time.
  • various small UI changes
  • use proper plurals in translations :wink:
  • added some things which can be read from the BMS in addition to Charge

Notes:

  • You MUST clear the database if you had Batterylog 1.3 one of my testing builds installed to get a meaningful graph. This is because BL now stores completely different values than previously. You can do that from the UI using Pulley Menu → Settings → Clear Logs
  • The prediction calculations have not been reviewed, they may or may not give meaningful or realistic times.
  • Tested on a couple of Xperia devices, including Xperia 10 (one), XA2, 10ii aarch64. Will probably not work on other devices which do not have /sys/class/power_supply/bms- reports of working/nonworking devices welcome.
  • The repo above is my development build space. I update it at random times with random changes. Things may break or start or stop working with each package. Also, you probably shouldn’t use any other packages from the repo…

I do not consider myself the new maintainer of this program. I merely tinkered a bit. I have not decided whether I will make a “official” release available at some point - but I will for sure not take over the version from the Jolla Store.

In case someone would like to take maintainership to do that they are more than welcome to do that, with or without my changes.

4 Likes

with the new version of Amazfish (available in Chum), the reminders of calendar entries are now also displayed. you should just be careful with all-day events to move the reminder forward. otherwise you always have fun at midnight when the clock starts to vibrate.

Thanks I had installed this since one week, but now I have problems with the GTS. If I sync the company calendar via exchange the GTS restartet some times and after this I have no events on the watch. It shows “no calendar app active”. I cannot find the reason. Maybe is the company calendar too big for this or the serial events makes trouble? No Idea. If I unshow the exchange calendar it works with the local and birthday calendar?

So my calendar/ contacts etc. is syncronized by the Nextcloud. on the GTR 8 appointments are shown in the preview. Also series appointments are included. Birthdays etc are also displayed as a reminder on the clock. As I said all my appointments are brought by the Nextcloud on my phone. These are also available after a manually triggered restart. whether it is now because the clock does not have enough memory for very very many appointments, I can unfortunately not say.

Well, let’s see, maybe in a few days. I’ve had this before with an older version on my Xperia 10 4.0 and then suddenly it worked. I’ll delete and test a few series invitations.

I have just “released” harbour-batterylog-1.4.0-1.22.1 at the above location.

This now again uses and stores “Energy”, not charge in the log and graph.
To do that I have tried to replicate the energy calculation from the StateFS source code, so in theory it should work the same as the old version (1.3.2).

IF you had one of my testing packages installed, do clean out the log database again after installing 1.4.0-1.22.1 or higher.

Known issue:

  • on XA2, /sys/class/power_supply/battery/charge_now_raw sometimes shows negative values, which approach and go above zero when charging. My own Xperia 10 does not do that. If someone knows how to correctly read sysfs on the XA2 (and similar), that info would be appreciated.
4 Likes

Thanks for your work on Battery Log @nephros. Your contributions are very nice improvements. Especially 1.4. I was unable to find if you accept donations and bug reports?

You’re welcome :slight_smile:

Donations are not required. If you want to contribute monetarily, please donate to someone like the FSF(e), EFF, NYOB or similar freedom-fighting organizations. Or buy another Sailfish OS license from Jolla - they do keep this community alive after all – despite all grievances.

I do appreciate bug reports, any other suggestions and especially patches/merge requests. For now, you can find the source code at Gitlab (linked above), which also has spaces for reporting issues and such.

3 Likes

Also from me many Thanks!!! Nice that we found here so easy solutions. For me is the 1,4 not optimal because I am 50+ :rofl: :rofl: an with the biggest Font are the textes to near on the border of the display. I use the version 1.3.2. This is perfekt for a long phone like 10ii.

1 Like

@nephros

harbour-batterylog-1.4.0-1.22.1 isn´t availble at the provided link.

I like to test it on XZ2 Compact. Version 1.3.3 gives me negative Values at Energie (-13344 mWh).

Here are all BMS-Values:

[defaultuser@XperiaXZ2Compact bms]$ ls
battery_type charge_full cycle_count_id resistance temp_warm
capacity charge_full_design debug_battery resistance_id time_to_empty_avg
capacity_raw charge_full_raw device soc_reporting_ready time_to_full_avg
cc_soc charge_now full_counter subsystem type
cc_step charge_now_raw learning_counter temp uevent
cc_step_sel constant_charge_voltage monotonic_soc temp_cold voltage_max_design
charge_counter current_now power temp_cool voltage_now
charge_counter_shadow cycle_count recharge_counter temp_hot voltage_ocv
[defaultuser@XperiaXZ2Compact bms]$ cat -n *
1 1310-1071
2 5
3 14
4 -1348272840
5 0
6 0
7 -1349316
8 80832
9 1113000
10 2899000
11 0
12 0
13 -3606823
14 4369879
15 215820
16 1
17 1
18 0
19 0
20 0
21 5
22 0
23 159179
24 336000
25 1
26 317
27 50
28 100
29 550
30 450
31 863
32 25349
33 BMS
34 POWER_SUPPLY_NAME=bms
35 POWER_SUPPLY_CAPACITY=5
36 POWER_SUPPLY_CAPACITY_RAW=14
37 POWER_SUPPLY_TEMP=317
38 POWER_SUPPLY_TEMP_COLD=50
39 POWER_SUPPLY_TEMP_COOL=100
40 POWER_SUPPLY_TEMP_WARM=450
41 POWER_SUPPLY_TEMP_HOT=550
42 POWER_SUPPLY_VOLTAGE_NOW=3677969
43 POWER_SUPPLY_VOLTAGE_OCV=3638433
44 POWER_SUPPLY_CURRENT_NOW=215820
45 POWER_SUPPLY_RESISTANCE_ID=336000
46 POWER_SUPPLY_RESISTANCE=159179
47 POWER_SUPPLY_BATTERY_TYPE=1310-1071
48 POWER_SUPPLY_CHARGE_FULL_DESIGN=2899000
49 POWER_SUPPLY_VOLTAGE_MAX_DESIGN=4380000
50 POWER_SUPPLY_CYCLE_COUNT=1
51 POWER_SUPPLY_CYCLE_COUNT_ID=1
52 POWER_SUPPLY_CHARGE_NOW_RAW=-3606823
53 POWER_SUPPLY_CHARGE_NOW=0
54 POWER_SUPPLY_CHARGE_FULL=1113000
55 POWER_SUPPLY_CHARGE_COUNTER=-1349316
56 POWER_SUPPLY_CHARGE_COUNTER_SHADOW=80832
57 POWER_SUPPLY_TIME_TO_FULL_AVG=25349
58 POWER_SUPPLY_TIME_TO_EMPTY_AVG=863
59 POWER_SUPPLY_SOC_REPORTING_READY=1
60 POWER_SUPPLY_DEBUG_BATTERY=0
61 POWER_SUPPLY_CONSTANT_CHARGE_VOLTAGE=4369879
62 POWER_SUPPLY_CC_STEP=0
63 POWER_SUPPLY_CC_STEP_SEL=0
64 POWER_SUPPLY_CC_SOC=0
65 POWER_SUPPLY_CHARGE_FULL_RAW=0
66 POWER_SUPPLY_LEARNING_COUNTER=0
67 POWER_SUPPLY_RECHARGE_COUNTER=0
68 POWER_SUPPLY_FULL_COUNTER=0
69 POWER_SUPPLY_MONOTONIC_SOC=5
70 4380000
71 3677969
72 3638433

The battery was changed, and while the charge counter was reset correctly, the BMS did not calculate the new real capacity; it only shows the values of the old battery (1113000). It now has 7 complete charge cycles. I discharged it to 0%, which resets the charge cycles back to 1. Maybe this is a bug with this port because it uses alpha software binaries:
( SW_binaries_for_Xperia_Android_10.0.7.1_r1_v12a_tama.img ).

I have restructured my OBS repos since the original post.

New location is here:
https://build.sailfishos.org/package/show/home:nephros:devel:forks/harbour-batterylog

I haven’t looked at this software for a long time so YMMV.

2 Likes

Where to download the aarch64.rpm-build, that website is very confusing in its structure. Clicking on the Download-Icon does nothing.

Sorry, my fault, forgot to publish the packages.

Download should work now.

Still not working, is a login/account there needed for the download?

You can download from here:
https://repo.sailfishos.org/obs/home:/nephros:/devel:/forks/sailfishos_latest_aarch64/aarch64/

2 Likes

Thank you @carmenfdezb, you are once again my rescue :heart:

1 Like

Negative values occur if the battery needs calibration (after a change or after a long period of usage).

Look here: