libera/#maemo/ Monday, 2023-08-28

siceloi want to make a (simple) dbus 'server'. what languages are easy enough to learn and do this? i know python can do it, but hopefully something lighter than it if possible16:24
sicelospecifically, i want to spoof upower ... so upower clients will talk to this fake 'server.' it will/should provide all the expected interfaces/responses16:25
sicelothe why: on N900 that has broken USB, upower will always want to shutdown the device, because battery capacity, charge_now, and power_now are always reported as 0% (due to our bq27200)16:27
sicelounfortunately getting upower (freedesktop) patches accepted can be like climbing Everest, so I'm looking for alternatives. A lot of stuff nowadays relies on upower, so it's not easy to just, for example,  handle the battery via own scripts16:29
pabs3upower reads kernel interfaces right? perhaps you could fake those?16:30
pabs3or block upower's access to them16:30
sicelokernel people don't like reporting fake info, so i wouldn't be able to upstream that either :-)16:33
siceloand i actually agree with the kernel people16:34
pabs3I was thinking overlayfs mounted on /sys diverting some files to /dev/null or similar :)16:35
sicelommm, i can have a look at that. never tried it before16:35
pabs3not upstreamable either, but not much to maintain, just an additional command before upower runs16:36
Wizzupsicelo: maybe patch your upower locally?16:37
pabs3hmm, I feel like the kernel does a lot of working around broken hardware, so I'm surprised they would reject supporting ways to fake info16:37
siceloWizzup: yes, that's the simplest option, but ... i want this to work on postmarketOS. not very easy to carry patched packages there too, which is somewhat understandable - you might break some other device out of the 200+ they support16:39
sicelohttps://gitlab.com/postmarketOS/pmaports/-/merge_requests/4117#note_140773750416:39
sicelopabs3: the thing is - somewhat usable info is available once the device is connected to a charger (and better still, calibrated). the problem only occurs when you don't have USB port on the N90016:40
siceloso i thought spoofing upower would be way easier solution - i can easily confine it to N900 (and Droid 4, where it can be useful too), and leave everything else in vanilla state (kernel, upower, etc.)16:45
siceloit's somewhat easy to do in python - in fact i'd have close to no work at all, since python-dbusmock already has the code/functions specific to upower16:47
joergaiui there's no way to upstream patches for broken hardware that would beak the system for everybody who doesn't have that particular hardware defect in their device19:14
joergask pali19:24
joerghe wrote the bq27xxx.ko iirc, and also iirc this module falls back to some more primitive and generic (LUT for bat voltage -> bat state of charge?) method to find out what's battery status, when the BQ27200 reports CI=1 (callibration incorrect)19:27
* joerg wonders what you get from upower when you unload (modprobe -r ?) the bq27200.ko completely19:30
joergI might be wrong and the module been completely different name. Sorry, I don't have the module handling battery here, this system still running genuine (braindead) BME19:45
joergI'm pretty sure I suggested (requested) module parameters to adjust battery-design-capacity, end-of-discharge-voltage etc, sinc4e people were using all sorts of frankenstein battery contraptions, like 3* AA MiMH or the like19:48
joergNiMH even19:49
joerghttps://mg.pov.lt/maemo-ssu-irclog/%23maemo-ssu.2014-12-13.log.html#t2014-12-13T16:25:19  ...  https://mg.pov.lt/maemo-ssu-irclog/%23maemo-ssu.2014-12-13.log.html#t2014-12-13T17:23:1520:59
joergbq27x00_battery  is the module name21:00

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!