libera/#maemo/ Thursday, 2023-11-23

ac_laptopjoerg: ok I put the script into /usr/bin00:01
ac_laptopit doesn't seem to change anything though, the service is not running after a reboot00:02
ac_laptopoh, right00:14
ac_laptopupstart doesn't seem to be aware of the existence of my script00:14
ac_laptopI thought there was a conversion layer like with systemd00:14
sixwheeledbeastbusybox may mean some of the programs you call fail00:15
sixwheeledbeastbasic upstart scripts are normally laid out:- description; author; start on; script; end script;00:17
ac_laptopI see plenty of scripts under /etc/init.d , how does maemo start those ?00:18
sixwheeledbeastit may read them fine and it's something else. I only ever used upstart back when I made stuff for maemo. there are several errors i pointed out about it will likely ignore the file completely with errors00:21
sixwheeledbeastbusybox date doesn't have -I flag for example.00:22
sixwheeledbeastprobably more.00:22
sixwheeledbeast/etc/event.d00:25
joergmessybox is nasty, lots of stuff doesn't work as you think it should00:26
joergsleep 1m only one of them00:26
ac_laptopsixwheeledbeast: oh, ok , I was looking for some /etc/init/ directory00:28
joergIroN900:/home/user# busybox date -Is00:28
joergBusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso31+0cssu0) multi-call binary00:28
joergUsage: date [OPTION]... [MMDDhhmm[[CC]YY][.ss]] [+FORMAT]00:28
joergIroN900:/home/user# busybox sleep 1m00:28
joergsleep: invalid number '1m'00:28
ac_laptopI might have installed something like the gnu coreutils when I bought the device because date -Is works00:29
sixwheeledbeastand then who knows if messybox-power was installed and something else happens...00:29
ac_laptopI also have bash400:29
joerghttps://termbin.com/f5qq00:29
sixwheeledbeasthow to make messybox more messy00:29
joergIroN900:/home/user# which date00:31
joerg/usr/bin/gnu/date00:31
joergIroN900:/home/user# file `which date`00:31
joerg/usr/bin/gnu/date: symbolic link to `/opt/maemo/usr/bin/gnu/date'00:31
sixwheeledbeastbut you don't call bash and it's not the default shell so more messy00:31
joerg^^^00:31
bencohto be fair, the s/m/d thing doesn't seem to be standard according to the opengroup anyway00:31
bencohhttps://pubs.opengroup.org/onlinepubs/000095399/utilities/sleep.html00:31
bencohhere is the latest version: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sleep.html00:32
joergIroN900:/home/user# echo $BASH_VERSION00:32
joerg3.2.33(2)-release00:32
sixwheeledbeastthere is bash4.2 (well 2 versions of 4.2 actually)00:33
sixwheeledbeastbash4-opt and bash400:33
ac_laptopI don't want to make you unnecessarily scratch your head over this guys00:34
joergIroN900:~# exit00:34
joerg~ # date -Is00:34
joergBusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso31+0cssu0) multi-call binary00:34
joergUsage: date [OPTION]... [MMDDhhmm[[CC]YY][.ss]] [+FORMAT]00:34
ac_laptopall I need is to log the output of lshal -u /org/freedesktop/Hal/devices/bme regularly so I can know what is up with my battery / power management00:35
ac_laptop:)00:35
bencohac_laptop: you might want to have a look at the bq27200.sh script for that purpose00:36
sixwheeledbeast^00:36
bencohhere is a copy: https://github.com/maemo-leste/bugtracker/files/2332967/bq27200.txt00:39
joerghttp://wiki.maemo.org/User:Joerg_rw/tools00:39
joerghttp://reisenweber.net/maemo5/usr/local/sbin/00:41
ac_laptopI mean in fremantle00:41
bencohac_laptop: yeah, me too00:41
ac_laptopI need to compare the battery stats of fremantle with the ones of leste to see what's going on00:41
joergmy server is only fremantle (well and a tad of harmattan)00:42
joerghttp://reisenweber.net/maemo5/usr/local/sbin/bq27200.sh00:42
bencoh(the fact I gave you a link from leste's github is just because that's the first source I found for that script, but it definitely comes from fremantle's era)00:42
joergI *guess* my last URL is one of the earliest incarnations of bq27000.sh00:43
joergiirc I got it from speedevil and modified it a tad. http://reisenweber.net/maemo5/usr/local/sbin/bq27k-detail2 predates it though, it's based on my implementation of this stuff fir Openmoko Neo00:44
ac_laptopok I'm going to use this one00:44
sixwheeledbeasthttps://wiki.maemo.org/N900_Hardware_Power_Consumption00:45
ac_laptopshould I put it in /usr/bin and make an upstart service file ?00:45
joerg#!/bin/bash00:46
joerg# NEEDS BASH! won't run on busybox, sorry00:46
joerg# v1.2 (c) 2009 2011-10-20 DocScrutinizer00:46
joerg#00:46
joerg# this script decodes the smartbattery BQ27000 Coulomb-Counter00:46
joerg# v1.2 tries to deal with sysfs path changes on OM kernels, and supports N900 directly00:46
joergac_laptop: I *think* upstart is not what you want. There's a .desktop file way to implement autostart apps00:48
ac_laptopthe bq27200.sh script needs i2cget00:49
sixwheeledbeastdoes it really need to start automatically? I'd just run manually, it's not something you will want permanent00:49
ac_laptopsixwheeledbeast: well for now I can afford to run it by hand yes00:51
joergI can't remember where those damn *.desktop files are00:52
joergthought I'd find them in /home/user/.local/share/applications/hildon/* but no00:53
ac_laptopbut there are some cases on leste where I boot the device, then it believes the battery is at 0%, and shuts down. I'm not sure if this happens on fremantle too, it's not regular00:53
ac_laptopok so apt-get install i2c-tools should not be done from an SSH connexion00:54
ac_laptopbecause it shows a popup requiring an agreement00:55
ac_laptopok the bq27200.sh script works fine00:55
sixwheeledbeastjoerg: /usr/share/applications/hildon/ ?00:56
joerghttps://termbin.com/a2rl00:56
joergyeah00:56
ac_laptopthanks !00:58
joergyw. and yes, you need i2get00:58
ac_laptopjoerg: your .desktop does not autostart, right ?01:11
joergno, but I'm getting closer: /etc/X11/Xsession.d/01:12
joergplace some script in there, 80-up range so it gets executed late01:17
ac_laptopthe sudo /usr/bin/bq27200.sh 60|tee -a /home/user/MyDocs/syslogs/bq.log works on the command line01:21
ac_laptopbut there are problems with /usr/bin/osso-xterm 'sudo /usr/bin/bq27200.sh 60|tee -a /home/user/MyDocs/syslogs/bq.log'01:22
ac_laptopI don't get anything written in /home/user/MyDocs/syslogs/bq.log01:22
joergI bet there needs to be made some sudo entry01:23
joerghere's autostart pretty   https://termbin.com/kb0501:24
joergI admit I might have messed up the `tee -a /home/user/MyDocs/syslogs/bq.log` part, maybe never checked if it's working01:28
ac_laptopmaybe osso-xterm ignores the pipe ?01:31
joergpossibly01:31
joergI edited this stuff years after initially creating it (without pipe and tee):  -rw-r--r-- 1 root root 313 2018-09-28 13:14 /usr/share/applications/hildon/bq27k.desktop01:32
joergsorry01:32
ac_laptopyeah that was it, osso-xterm ignores the pipe01:40
ac_laptopwrapping it in an other script, it works01:40

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