libera/#maemo-leste/ Thursday, 2022-08-25

Wizzupuvos: ping on my sphone changes00:04
Wizzupshould I make a pr?00:20
Wizzuphm, did I not push it?00:20
* Wizzup checks00:20
WizzupAh, no, it's fine, I squashed/rebased00:22
uvosWizzup: what should i be looking at?00:50
uvosa pr is better to get my attetion00:50
uvosim not going to follow what you do in your branches00:50
uvoswip-rtcom is nolonger wip i gues?00:51
Wizzupyeah00:52
WizzupI'll make a PR now00:52
Wizzupuvos: https://github.com/maemo-leste/sphone/pull/100:53
Wizzupnote that the <unkown> to <unknown> change will also affect dbs00:54
Wizzupactually probably not, nvm00:54
freemangordonWizzup: uvos: is it save to remove/insert sim card while droid4 is powered?07:50
freemangordonWizzup: also, please elaborate on https://github.com/maemo-leste-upstream-forks/ofono/commit/cbffe1d6d3a1872db5454327a4f8c6f20419bd5f08:07
uvosfreemangordon: yes10:24
Wizzupfreemangordon: so there are several radio interfaces and what ended up happening is that it'd reset the tech to NULL when it iterated over the interfaces10:53
Wizzupiirc it was probably cdma or something (I'd have to check the logs)10:53
Wizzupso this simple checks if the radio tech is set to anything sensible10:53
Wizzups/NULL/-1/10:53
Wizzupsimple->simply10:53
uvoswhats wrong with haveing those? they may work in some contires after all11:05
Wizzupuvos: huh?11:06
Wizzupthe problem is that ofono will report no technology in dbus because it nukes the good one11:06
Wizzupif you're in a cdma place with no 2g then it will use the cdma tech11:06
uvosok then i read that wrong11:06
uvosi sounded to me like you nixed them11:06
Wizzupfreemangordon: so one of the ofono problems that I think are maybe at the root of the problems: on the d4, when you boot with a sim that has a pin, it just will not detect the sim until you issue some operation, like SetProperty Online true, or just restart ofono (and even then it won't always pick it up)11:14
Wizzupon the bionic this particular problem with pin doesn't exist11:14
Wizzupsimilarly there are other problems I think with messages to ofono "getting lost", or at least they don't make it all the way to the right handlers11:15
Wizzupfor example when I set the context to active, it sometimes just times out, unless in the meantime I poke ofono in some other way, like by sending a sms to my other phone number11:15
Wizzupwhat might be worth trying it setting up the 'regular' qmi modem driver which uses usb only (and uses a lot of pm and doesn't idle well) to see if that shows any of these problems11:16
WizzupI don't know how to do it anymore, but can try to help to figure it out11:16
freemangordonWizzup: do you know a way to re-create the issue without rebooting the device?11:26
Wizzupno11:26
Wizzupthere are definitely other issues, but not as reproducible as this one11:26
freemangordondid you try to re-plug the card?11:26
WizzupI did not11:26
Wizzuplike if you restart ofono, it will only pick up the modem some of the time11:26
freemangordonok11:26
Wizzupand if you set Online to false and then back to true, I think it just aborts11:27
freemangordonhmm11:27
Wizzupbut that's likely a separate problem11:27
uvosi think you can reboot the modem via the at interface11:27
uvosmaybe tmlind remembers11:27
uvosthat might simulate a system reboot (if you also restart ofono)11:27
WizzupI suppose you can unload and reload the kernel module11:27
uvosi dont know if that reboots the modem11:27
Wizzupit definitely powers it, not sure about unload11:28
freemangordonwhich module?11:28
uvosmotorolamodem11:28
freemangordonWizzup: I see no issues here doing offline<->online11:28
freemangordonbut sim has no pin11:28
Wizzupmaybe it's powered false/true11:29
freemangordonok11:29
* freemangordon tries11:29
Wizzuplet me try now11:29
uvosi dont think powerd fals true dose anything11:29
uvosat least it dosent change power consumption11:29
Wizzupwell it makes it abort iirc11:29
uvos(which cfun dose)11:29
uvossure but i mean in terms of affecting the modem firmware11:30
freemangordonnot here (abort)11:30
Wizzuproot@maindroid:~# mdbus2 -s org.ofono /motmdm_0 org.ofono.Modem.SetProperty Powered false11:31
Wizzup^R11:31
Wizzup[ERR]: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying11:31
Wizzuproot@maindroid:~# mdbus2 -s org.ofono /motmdm_0 org.ofono.Modem.SetProperty Powered false11:31
Wizzup[ERR]: There is no method with name org.ofono.Modem.SetProperty on path /motmdm_0!11:31
Wizzupthis -might- be expected, perhaps11:31
freemangordonwell, I am using ofono scripts11:31
Wizzupno, ofono is gone11:31
freemangordonenable-modem and disable-modem11:31
Wizzupfyi there is /var/log/maemo/ofonod.log11:31
freemangordonbut they do the same IIUC11:31
Wizzupyou can check if they set powered?11:31
freemangordonlemme check11:32
WizzupAug 25 11:30:16 localhost ofonod[2878]: Aborting (signal 11) [/usr/sbin/ofonod]11:32
freemangordonWizzup: you mean the scripts?11:32
freemangordonmodem.SetProperty("Powered", dbus.Boolean(0), timeout = 120)11:32
WizzupI don't use the scripts, but I doubt it makes a difference, it's just dbus11:32
freemangordonthis is disable-modem11:32
freemangordonok, lemme set pin to that card11:33
WizzupI doubt the pin matters to the abort11:34
Wizzupbut yeah, ok11:34
freemangordonit does not abort here11:34
freemangordonmaybe different initial state?11:34
freemangordonlike modem is opnline?11:35
freemangordon*online11:35
freemangordonor, could you attach gdb and provide backtrace? that might give me a clue how to repro11:35
Wizzupthe modem is online yeah11:36
Wizzuphttp://dpaste.com/AYTJL8R6R11:37
freemangordonnope. makes no difference11:37
Wizzupit took two tries for me just now11:37
freemangordonwell, lemme put sim with pin11:37
Wizzup(see backtrace above btw)11:37
Wizzuplooks like it might get RSSI after the modem is off or something silly11:38
Wizzupcould relate to our mce mapphone module11:38
uvoswell mce only disables rssi11:38
freemangordonno matter what, it should not segfault11:38
Wizzupsure11:38
uvosit segfaults here to11:38
uvosdoing this btw11:38
uvosi gues it might be because disable-modem dosent do anything really11:39
freemangordonit does11:39
uvosyou can still talk to the modem via qmicli11:39
freemangordonsets powerd ot off11:39
uvosright11:39
uvosbut the modem dosent care11:39
uvosif you connect gsm via qmicli "powering it off" via ofono dosent even dissconnect the connection11:40
Wizzupso debugging wise there's etting n_gsm.debug to 0xff11:40
Wizzupand there's the ofono logs that can be made very verbose11:41
freemangordonok, but I want to repro first11:42
uvosi had to power the modem, online it, enter pin and have it be connected to an operator11:42
uvosbefore the segfault via off11:42
Wizzupyeah and there's the rssi msg in my backtrace11:43
Wizzupso maybe it relates to locking the device too11:43
Wizzup(which I do often)11:43
uvosi can do the whole seqence with out ever locking the device11:44
uvosso mce should not have issued any modem commands at all in that timespan11:44
freemangordonuvos: does it happen wwith sim without pin?11:46
uvosno idea11:47
freemangordonok, seems ofono does not detect hot-pluggin a card with pin11:58
Wizzupnot even sure if the modem does11:59
uvosin android it dose11:59
Wizzupif you remove the '#' you'll see all modem msgs /etc/modprobe.d/gps.conf:#options n_gsm debug=0xff11:59
uvostakse a couple of second or so tho12:00
uvosso maybe its just becuase android querys something and kicks the modem12:00
freemangordonI have no /etc/modprobe.d/gps.conf12:01
Wizzupfreemangordon: sure, make it :)12:01
Wizzupfor the record:12:01
Wizzup# cat /etc/modprobe.d/gps.conf12:01
Wizzup#options n_gsm debug=0xff12:01
Wizzupoptions gnss_motmdm rate_ms=100012:01
freemangordonyour statement (uncomment line...) implied I shoud already have one :)12:02
uvosWizzup: how manny seconds should the sphone window stay (after call)12:02
uvos5s?12:02
Wizzupfreemangordon: sry12:02
Wizzupuvos: yeah that's a start I think12:02
freemangordonwhy it should auto-close at all?12:03
uvosid prefer it to auto-close eventually12:03
freemangordonok, but why?12:03
uvosso i dont have to do anything when remote hangs up12:03
freemangordonat least make that an option12:03
freemangordonit is like if conversation closes 5s after last message12:04
freemangordonor if the remote party goes offline12:04
uvosi mean a call is totaly different12:04
uvosyour unlikely to immidatly call a person you just called again12:05
freemangordonit is not, but lets not go into that :)12:05
uvosbesides you cant even do that with this window12:05
freemangordonyous, you should be presented with last calls window ;)12:05
uvos(where talking about the window that shows the mute and hangup buttons here)12:05
freemangordonthis is how every dialer around works12:05
uvosit looses validity immidatly when your not in a call12:06
freemangordonyes, and you shoudl be presented with last calls12:06
freemangordonanyway12:06
uvosim not sure what dialer works like this12:06
uvosmaybe the fremantle one12:06
freemangordonyes12:06
freemangordonwhen GF is back, I will check what andoid one does12:07
Wizzupfremantle will close itself if it's not open and you got called12:07
freemangordonsure?12:07
Wizzupotherwise it will stay open at the window is just a stacked window12:07
freemangordonok12:07
Wizzupfreemangordon: the dial window specifically yes12:07
Wizzuperr not dial12:07
Wizzupbut the call window12:07
freemangordonyeah "in-call"12:07
freemangordonok12:07
uvossame with android12:08
uvosit kicks you back to the last window12:08
uvos(either contacts or the dialer or nothing)12:08
freemangordonok12:09
uvosso the only thing sphone dose different is that the dialer closes12:10
uvos(also the delay is missing, android has a delay to)12:10
uvosso you can look at the call time presumably12:10
freemangordonmhm12:10
uvosanyhow delay is now 5 sec12:10
uvoswe can also not close the dailer12:11
uvosif you like12:11
uvosWizzup: ?12:11
freemangordonall dialeres around do it, so I think it makses sense12:11
freemangordona typo day?12:11
uvoswat si tpo?12:12
Wizzupuvos: I think if the window is not open, and you get called, then no window ought to remain12:12
Wizzup(after 5s)12:12
uvosright12:12
Wizzupif it's open, I'd keep it open12:12
uvosok12:12
uvosrn it closes as soon as you press call12:12
Wizzupso ideally it would stack :)12:12
freemangordontypo? umm... when you type something wrongly, that's a typo12:12
Wizzupfreemangordon: I think it was a joke12:13
freemangordonah12:13
freemangordonI didn;t even see how it was typed :D12:13
freemangordonI am so used to how uvos type here :p12:13
Wizzupidk most of it is typo free12:13
freemangordonanyway, it seems n_gsm report at least SIM removal12:14
Wizzupright12:14
Wizzupit might take a bit to report sim insertion maybe?12:14
freemangordonlemme put back12:14
uvosbren si realy god at dicodeig12:14
uvosok ill remove the close12:14
uvosbut this makes the call button have very little feedback12:14
freemangordonyep, insertion is reported too12:14
freemangordonhttps://pastebin.com/g96gfdVq12:15
uvosany ideas on feedback?12:15
freemangordonyep, ofono issue, deffinitely12:15
freemangordonwill do some work work and will se what I can do about it12:16
uvosits good that its not the modem fw12:16
freemangordonmhm12:16
Wizzupuvos: if you close the call yourself it can hang up sooner12:17
Wizzups/hang up/close/12:17
uvossure that fixes the feedback on the hangup button12:18
uvosbut not the call button12:19
uvoswhen you press call, nothing happens for a while12:19
uvosas ofono needs to be contacted and then sphone has to spawn a new window12:19
uvoshildon also needs to rotate, takes about 1.5 seconds or so12:19
uvosall in12:19
Wizzupsometimes the button hangs for 30s because of ofono timeouts :P12:20
freemangordonWizzup: hmm, which ofono branch to use?12:32
freemangordonbeowulf-devel?12:34
Wizzuplet me look12:36
Wizzupmaemo-ofono should be ok12:36
Wizzuphttps://github.com/maemo-leste-upstream-forks/ofono12:36
freemangordonok12:37
freemangordonok, but why is that not in -devel?12:38
WizzupI think it is12:38
freemangordonmaybe that's the reason why it does not segfault her12:38
freemangordon*here12:38
Wizzupwe have same ofono everywhere12:38
Wizzupmaybe you're looking at a different repo?12:38
freemangordonurl = git@github.com:maemo-leste-upstream-forks/ofono.git12:39
Wizzupii  ofono          1:1.34.0-1+2m7.1 armhf        Mobile telephony stack (daemon)12:39
Wizzupofono (1:1.34.0-1) unstable; urgency=medium12:39
Wizzuplooks like the right version to me12:39
Wizzupwhat version do you have?12:39
freemangordon1:1.34.0-1+2m7.112:40
Wizzupso I think you have the same version as maemo-ofono as maemo/beowulf-devel12:40
freemangordonbut, git diff shows differences between beowulf-devel and maemo-ofono branches12:40
freemangordonunless I am doing something wrong12:40
Wizzupyour beowulf-devel or origin/beowulf-devel12:41
freemangordonumm...12:41
freemangordonoh :)12:41
Wizzup$ git diff --stat origin/maemo/beowulf-devel..origin/maemo-ofono  | wc 0       0       012:42
freemangordonyeah, it is better now12:42
Wizzup:)12:42
freemangordonthere is beowulf-devel branch I think we shall delete12:43
freemangordonbut anyway12:43
Wizzupah yeah12:43
Wizzupheh12:43
freemangordonmay I delete that?12:43
Wizzupsure12:44
buZzheh, never noticed that rightclicking actually works on touch? at least in chromium13:27
buZzjust holding touchscreen13:27
uvossome apps implement this13:32
uvosfirefox to13:32
uvosbut its not a universal thing13:32
freemangordonuvos: can I send AT commends to the modem?13:33
freemangordonsomehow13:33
uvosfreemangordon: well13:33
uvosfreemangordon: sorta13:33
uvosfreemangordon: so the modem dosent really have a at interface13:34
uvosfreemangordon: it has a interface that uses commands that start with at :P13:34
freemangordonah13:34
uvos(its really quirky)13:34
uvosits on one of the usb ttys13:34
uvossec13:34
freemangordondo we have it documented somewhere?13:34
freemangordon(commands set)13:34
uvosno13:35
uvoswe dont know what it supports13:35
freemangordonas I have the feeling that unsolicited messages shall be enabled13:35
uvosbesides messing with android13:35
uvosand seeing what it sends13:35
freemangordondo we have a log somewhere?13:35
uvosits very customized by motorola13:35
freemangordonok13:35
freemangordonbut do we have a log from android boot and communication with the modem13:35
uvossomewhere yeah13:35
uvosyeah13:36
uvosanyhow its on /dev/gsmtty113:36
uvosmostly the modem wants you to controll it via qmi13:37
uvosreally13:37
uvosrealy pali probubly knows best13:41
uvoshe wrote a hacked version of ofono that uses the at interface to do sms and calls13:41
uvosit never worked very well13:41
uvosbut he probubly knows which at commands work and in how far they dfo13:41
uvosor maybe it was pavel13:43
uvosi dont quite remember13:43
freemangordonpavel13:44
freemangordonhmm, AT+QSIMDET13:49
freemangordonuvos: anyway, do you have that andoid log around to share?13:49
uvosfreemangordon: im looking for it13:49
freemangordonok13:49
uvosi found this13:50
uvoshttp://uvos.xyz/maserati/stockinfo/call/AT_COMMANDS.txt13:50
uvosstringed from some android libarary iirc13:50
uvoslibmoto*ril.so13:51
uvoshttp://uvos.xyz/maserati/stockinfo/call/ril13:52
uvosif you want to re something13:52
uvosno debug symbols tho13:53
uvosso good luck :P13:53
freemangordonthanks13:59
Wizzupprobably not needed though?14:09
freemangordonhmm, AT+UNSOL14:17
freemangordonuvos: so, how to send command while ofono is running?14:24
uvosprintf 'U1234AT+UNSOL=1\r' > /dev/gsmtty114:29
uvosU1234+UNSOL:OK14:29
uvosworks fine here14:29
freemangordonok14:30
uvosnew sphone is on the way btw14:32
uvos@Wizzup14:32
uvosbesides the other things the missed calls from the distant past are also fixed14:32
freemangordonhmm, not good14:38
freemangordoneither FW or kernel issue14:38
freemangordon(missing sim events)14:38
Wizzupuvos: thx14:42
Wizzupfreemangordon: hm, maybe that is why we don't see it on bionic14:42
freemangordoncould you capture dmesg log when removing SIM (with n_gsm debug=0xff)14:43
WizzupI've never tried this14:47
WizzupI can try14:53
Wizzup(later today)14:53
freemangordonok14:53
freemangordontmlind: do you have some android boot log with modem commands tracing?15:34
tmlindfreemangordon: i recall you can trace them with logcat if using lineageos kernel15:39
freemangordondo I need serial attached?15:39
tmlindfreemangordon: no, adb is enough15:39
freemangordonok, but isn't it too late?15:40
tmlindfreemangordon: you also want to probably enable ts27010 debug if looking at the modem commands15:40
tmlindfreemangordon: pretty sure logcat shows you the boot time messages too15:40
freemangordonok, now I have to dig what is ts27010 and how to enable debug :)15:40
freemangordontmlind: does current mainline modem driver use apwake gpio?15:42
tmlindlet me try to find my notes15:42
tmlindfreemangordon: adb shell 'echo 0x7fffffff > /sys/module/ts27010mux/parameters/debug_level'15:43
tmlindthat allows you to see the ts27010 serial mux packets to the modem15:43
freemangordonok, but my concern is that maybe no irq is used from BP->AP15:43
tmlindfreemangordon: not sure if we use the apwake gpio.. the gpios are in the dts file15:44
freemangordonperhaps that's why we need to send something in order to receive unsol events15:44
* freemangordon checks gpio number in android kernel15:44
tmlindyeah maybe15:44
tmlindsee also what phy-cpcap-usb.c is already doing, maybe it already handles it15:45
tmlindno sorry, wrong phy driver.. the mdm6600 phy driver15:45
freemangordonok15:45
tmlindphy-mapphone-mdm6600.c15:46
freemangordonok15:46
tmlindfreemangordon: some mdm6600 gpios need to be remuxed to input after initial bootup to use them15:48
freemangordonyep, I see the comments in phy driver15:48
freemangordonbut I have to figure out what exactly gpio is needed15:49
tmlindmaybe apwake remuxed to input after boot if not done already?15:50
tmlindthat should be gpio_14915:51
freemangordonmdm6600-wake does not increase on SIM insert/remove15:52
tmlindi see /* Reconfigure mode1 GPIO as input for OOB wake */ so modem should already be waking up the soc15:53
freemangordon  p, li { white-space: pre-wrap; }  /* Reconfigure mode1 GPIO as input for OOB wake */15:53
freemangordonyep15:53
freemangordonthat's exactly   "mdm6600-wake"15:53
freemangordonwhat is "mode1"?15:54
tmlindit could be there's some handler missing in ofono and the message comes from uart just fine15:54
tmlindmode pins tell what usb mode to boot it to i think15:54
freemangordonI see nothing in n_gsm traces15:55
freemangordon(re missing handler)15:55
freemangordonshall I write a simple test program that opens /dev/gsmtty1 and reads?15:55
tmlindok then maybe sim insert does not trigger anything? it takes really long time with android too to see the sim sometimes15:55
freemangordonok, but sim remove?15:56
tmlinddon't remember if that produces anything15:56
freemangordonin android?15:56
freemangordonhmm15:56
tmlindif you modprobe n_gsm debug=0xff, then you should see the raw packets in dmesg15:56
freemangordonthat's why I did15:56
tmlindso probably no need to read /dev/gsmtty115:57
freemangordonnothing comes15:57
freemangordonunless you "kick" it by sending some command15:57
tmlindweird15:57
freemangordonhmm, wait15:57
freemangordonsee the note before  phy_mdm6600_wakeirq_thread15:58
freemangordon"Just use it for debug info only..."15:58
tmlindyeah maybe that triggers and means check status15:59
freemangordonmhm15:59
freemangordonlooks like15:59
tmlindoh so you see it trigger when inserting a sim then?16:01
freemangordonno, because it is dev_dbg16:01
freemangordonI am trying to find how to see dev_dbg messages16:02
tmlind#define DEBUG at the top, set loglevel to 8 or smaller i think16:02
tmlindor just change dev_dbg to dev_info temporarily..16:02
freemangordonwhat about "echo 'file phy-mapphone-mdm6600.c +p'>/sys/kernel/debug/dynamic_debug/control"?16:02
tmlindyeah that might work16:03
freemangordonugh, no dynamic_debug it seems :(16:03
tmlindok16:03
freemangordonbut I see irqs increasing16:03
tmlindi need to go deal with feeding, let's hope the oob gpio works :) bbl16:03
freemangordon:)16:04
freemangordonhmm, seems inserting seems gets registered by ofono16:06
freemangordonit just takes lots of time16:06
freemangordonor, it could be because I enabled unsol messages16:06
* freemangordon checks16:06
* tmlind waiting for a pizza16:21
* uvos intercepts pizza16:21
freemangordontmlind: do you know, where in ofono I shall send 'U1234AT+UNSOL=1' command?16:22
freemangordonit seems this has to be send after every unsol even in order to receive the next one16:23
tmlindno idea, seems it needs a new handler in ofono16:23
freemangordonumm, why handler?16:24
freemangordonthe handler is there16:24
freemangordonI just need to send that command when tty is opened16:24
tmlindbut something needs to parse the unsol message, then kick the usb interface16:25
freemangordonthe parser is already there16:25
tmlindah16:25
tmlindok then acking it is needed sounds like16:25
freemangordonsee   receive_notify in sim.c16:25
freemangordonbut, I think before receiving the first notify, the ^^^ commend shall be send16:26
freemangordonto enable unsol events16:26
freemangordonhmm, maybe you are right and this is ACK, lemme try16:26
tmlindafc, only on d4 right now, can't grep16:26
freemangordonok16:26
tmlindfyi to avoid implementing full modem support over serial at commands, we just kick the usb interface and let the existing code handle things..16:29
freemangordonumm... I am not sure I understand16:29
tmlindofono has good qmi support over usb16:29
freemangordonok16:29
tmlindbbl16:30
freemangordonlets first see that what I think is needed works16:30
freemangordonok, it seems   AT+UNSOL=1 shall be send only once18:10
freemangordonugh, why it needs 5 minut6es to report sim present?18:12
freemangordonhmm, not, this command must be send every time18:16
Wizzupfreemangordon: modem startup time maybe18:18
freemangordonno18:18
freemangordon10 minutes after boot18:18
freemangordonif there is no AT+UNSOL=1, SIM insertion is not reported18:18
Wizzupnot sure how that works18:18
Wizzupdo you have a bionic as well?18:18
freemangordonif there is, it is reported maybe a minute after it is inserted18:18
freemangordonno18:18
Wizzupuvos suggested we could try older or newer fw18:19
freemangordonlemme first see if I can make it work properly on d418:19
Wizzup:)18:20
freemangordonI just have to find the proper place to put it18:20
freemangordon(command)18:20
freemangordonand I am sure it will work18:21
freemangordonwell, sure(tm) :)18:21
Wizzup:)18:36
freemangordonugh, callback in ofono was not called :(18:38
freemangordonoh, PEBCAK18:38
tmlindfreemangordon: so are you seeing AT+UNSOL=1 do anything?18:59
freemangordonstill hard to say18:59
tmlindheh18:59
freemangordonyeah, seems ofono has bug so callback does not get called when sim insert is reported19:00
freemangordoninvestigation ATM19:00
tmlindusually if the modem has something it produces several WAKEUP on the dlci119:00
tmlindfreemangordon: maybe enable status notifications on dlci1 with AT+SCRN=1, then insert sim and see you that produces any new messages?19:02
tmlindmost likely it will just enable network status notfications though19:02
freemangordonlemme first fix ofono bug19:03
tmlindoh ok19:05
freemangordontmlind: hmm, why  g_at_chat_register() in sim.c is called with  expect_pdu set to true?19:07
tmlindjust a sec.. hmm maybe the sim detection i added only works with bionic firmware? there's a difference in the line break characters between bionic and d4..19:08
tmlindforgot the details on the expect_pdu, may be related to the different line breaks too19:09
tmlindor could be bug :)19:09
Wizzupit works in bionic I can confirm19:10
tmlindoh ok, might be the line break issue then19:10
tmlindfreemangordon: hmm maybe i used the pdu to strip out the moto U1234 packet id's19:11
tmlindsome more info on the varying line breaks in "gatsyntax: Allow '\n' to terminate line"19:13
tmlindif d4 produces ~+MSIM= but ofono is not parsing it and bionic is, chances are it's somehow related to the packet line breaks19:15
tmlindhmm or i guess d4 may produce ~+MSIM on a different dlci rather than /dev/gsmtty10 on bionic, seems unlikely though19:16
WizzupDoes n_gsm debug where the command goes?19:19
freemangordonno, it is there19:23
freemangordontmlind: ^^^19:23
freemangordonmaybe ofono cannot parse the pdu19:23
freemangordonpasring results in G_AT_SYNTAX_RESULT_LINE:19:24
freemangordonnot G_AT_SYNTAX_RESULT_PDU19:24
tmlindok19:25
tmlindbtw, i've noticed that doing ifdown wlan0 can hang the device at some point19:25
freemangordonI guess a0000000871002ff47f00189000001ff is the PDU in question?19:26
tmlindnot sure19:26
freemangordonhttps://pastebin.com/9c10jEjz19:26
tmlindok yeah so the notification is there, and ofono can't parse it somehow19:27
freemangordonmhm19:27
freemangordonon card remove:19:28
freemangordonU0003~+MSIM=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.19:28
freemangordonthis is parsed correctly19:28
tmlindthe pdu is the raw packet, but if there's no U1234 in the beginning, then pdu parsing will fail19:28
freemangordonwhy 1234?19:28
tmlindoh but the packet id is there, U0004 in your pastebin, never mind19:28
freemangordonU0004~+MSIM=1,0,a0000000871002ff47f00189000001ff,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.19:29
freemangordonon connect19:29
tmlindok19:30
freemangordonhmm, unplug has one more 'parameter' at the end19:30
freemangordonU0003~+MSIM=0,0,                                 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.19:30
freemangordonU0004~+MSIM=1,0,a0000000871002ff47f00189000001ff,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.19:30
tmlindmaybe try reverting or tweaking "gatsyntax: Allow '\n' to terminate line" and see if that helps on d4?19:30
freemangordonok19:30
tmlindfreemangordon: actually rather try reverting "gatsyntax: Allow terminating a PDU with a new line" on d4 and see if that helps19:32
tmlindprobably the reason for using pdu parsing rather than line parsing was the varying line breaks..19:34
freemangordonugh19:34
freemangordon"~+MSIM=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"19:34
freemangordonthere are 2 line feeds19:34
freemangordonwhy do we need "gatsyntax: Allow terminating a PDU with a new line"?19:35
freemangordontmlind: I see this is your commit, where did you see the issue it fixes?19:36
freemangordonok, I am confused19:38
freemangordonin dmesg there is only one 0x0a19:38
freemangordontmlind: is it possible that tty add new lines becasue of some "terminal line size" or something?19:42
freemangordon*adds19:42
freemangordon~+MSIM=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 len is 8719:44
freemangordonok, terminal seems to be opened in raw mode19:51
freemangordonso, where that additional line feed comes from?!?19:51
freemangordonoh, I see why19:59
freemangordondata comes from the modem on 2 packets19:59
freemangordonhttps://pastebin.com/xVgthPBJ20:00
tmlindok, yeah different on d4 and bionic20:40
freemangordonhmm, how to connect adb?20:41
freemangordonI already enabled "developer options" or whatever20:41
tmlindenable usb debugging too?20:42
freemangordonyeah20:42
freemangordontmlind: there is no /sys/module/ts27010mux/parameters/debug_level20:44
freemangordonugh20:51
freemangordonI had to connect as root20:51
tmlindit's only there on lineageos kernels, not with the stock kernel20:53
tmlindnot enabled in .config for the stock kernel i believe20:54
freemangordonI am on lineageos20:54
tmlindhmm weird20:54
freemangordonI was not connecting as root20:54
freemangordonas root, it is there20:54
tmlindoh ok20:54
freemangordonis there such thing as modprobe.d on android?20:55
tmlindso for the ofono serial read/write, the long term solution is to stop using gatchat and instead use ell to parse the raw packet data20:55
tmlinduvos might know how to enable loading modules20:56
freemangordontmlind: well, I see no '\r' at the end of the string20:56
tmlindheh annoying20:56
freemangordonand I think this is th eissue20:56
freemangordontmlind: I want to set ts27010mux parameter early in the boot process20:59
tmlindkernel cmdline?20:59
freemangordonif I only know how to modify it :)21:00
tmlindyou can tweak that in droid4-kexecboot boot.cfg i think21:00
freemangordonlike, this is some weird bootloader here21:00
freemangordonwhere is that? any idea?21:00
freemangordonmmcblk1p13?21:01
tmlindso droid4-kexecboot has an option to boot to stock android distro21:01
freemangordonthis is what I use21:01
freemangordonand it boots to lineageos21:01
tmlindif you edit that boot.cfg file, it just does pivot root to the stock21:01
freemangordonbut, where is that boot.cfg located?21:02
tmlindhmm where do you have lineageos installed/21:02
tmlind?21:02
freemangordonthat's how I got the device :)21:02
freemangordonI guess Wizzup installed it for me21:02
tmlindok21:02
tmlindso which boot option did you select for android in the bootloader menu? the "boot to stock android" one?21:03
freemangordonyes21:03
tmlindso mount the boot partition from android, and edit the boot.cfg file for that menu entry and you should be able to tweak the cmdline21:04
tmlindmount the bootloader partition i mean21:04
freemangordonwhich one is that?21:04
freemangordon/dev/mmcblk1p14 ?21:04
freemangordonthis is marked as boot21:05
tmlind/dev/mmcblk1p1321:06
tmlindbut looking at /boot/boot.cfg the cmdline is just "stock", so it's in the boot script instead21:06
freemangordonmount /dev/block/mmcblk1p13 /mnt/boot21:07
freemangordonmount: '/dev/block/mmcblk1p13'->'/mnt/boot': Operation not supported on transport endpoint21:07
freemangordon:(21:07
tmlindoh and looking at sbin/preinit.sh, it just does pivot_root so no way to tweak the cmdline21:08
freemangordonhmm, wait21:09
freemangordonflight mode shall do the trick21:09
tmlindyeah for modem communication21:09
tmlindand you could tweak mmcblk1p13 sbin/preinit.sh to enable debug before the pivot_root21:10
tmlindor you could add a lineageos kexec menu to the boot.cfg on your micro-sd card with a custom cmdline21:11
tmlindhmm actually i forgot if kernel cmdline even works properly with the android stuff..21:11
freemangordonI cannot mount mmcblk1p1321:12
freemangordonfrom android that is21:12
tmlindok21:12
tmlindyou can mount it from m-l kernel though :p21:12
freemangordonwell, yeah :)21:13
tmlindor check your micro-sd partitions for boot/boot.cfg file and yeah you can tweak the cmdline there21:13
tmlindmultiple boot.cfg file are ok with kexecboot21:14
tmlindbut if there's no lineage os kexec entry configured, don't bother wasting time with that21:15
freemangordonok21:18
freemangordontmlind: still, do you have any clue where that additional '\n' comes from?21:19
freemangordonfor sure the modem does not send it21:19
freemangordonbut it gets read from the tty21:19
freemangordonand this additional \n breaks it21:19
freemangordonhmm, it seems android pings the modem every 3 seconds21:20
freemangordon0416~+RSSI=0,22,99,99,0,0,021:21
freemangordonetc21:21
tmlindthat's with U1234AT+SCRN=1 set for status notifications21:24
freemangordonah21:24
tmlindi thought the extra \n comes from d4 firmware?21:24
freemangordonanyway, I don;t see "UNSOL" commend used21:24
freemangordonno21:24
freemangordonit sends \n at the end21:25
tmlindmaybe it's a \r in the middle?21:25
freemangordonbut, there is one more \n that comes from somewhere else21:25
freemangordonno, it is \n21:25
tmlindis it not in the n_gsm debug=0xff packet dump?21:25
freemangordonit is not21:26
tmlindweird21:26
tmlindyou sure?21:26
freemangordonsee https://pastebin.com/xVgthPBJ21:26
freemangordonthere is only one 0a21:26
freemangordonand this is printed by gdb:21:27
freemangordon "~+MSIM=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n"21:27
tmlindnot sure why the firmware sends it in multiple pieces, but it's packet data with a size and checksum so should not matter from ts27010 point of view21:28
freemangordonyou mean from n_gsm POV  guess21:29
freemangordonright, and it seems to process it correctly21:29
tmlindyeah21:29
tmlindso does ofono see the middle \n there too?21:30
freemangordononly ofono sees it21:30
freemangordonand that's why it fails to parese21:30
freemangordon*parse21:31
tmlindhmm21:31
freemangordonhmm ONOCR21:31
tmlindso doing ngsm 10 AT+MSIM? shows the sim with no line break in the middle21:32
freemangordoncfmakeraw does not set that flag21:32
tmlindwhere 10 is dlci1021:32
freemangordonso it seems tty outputs \n at col 0 for some reason21:33
tmlindso also with ngsm 10 AT+MSIM? the dmesg shows the data returned in two pieces21:34
tmlindngsm is my script for doing the commands fyi that adds the U123421:35
freemangordontmlind: lemme try to set ONOCR21:35
tmlindif ngsm 10 AT+MSIM? returns sim data to the terminal with no line break, why would ofono see the line break?21:38
tmlindthe line break in the middle i mean21:38
freemangordonwhere is ngsm script?21:38
tmlindmy ngsm script is just:21:38
tmlindtimeout 3 /bin/cat /dev/gsmtty${1} &21:38
tmlindbusybox usleep 10000021:38
tmlindprintf "U%04i%s\r" $(date +%M%S) ${2} > /dev/gsmtty${1}21:38
tmlindfirst param is the dlci number, second is the AT command without the U123421:39
freemangordonyes, it sees it correctly21:42
freemangordonso no idea what's going on with ofono21:42
tmlindwell ofono reads also dlci10, i suspect the middle \n is only in the dmesg21:43
freemangordonthere is no \n in dmesg21:43
freemangordon'middle \n' that is21:44
freemangordonit is only int the ofono vars21:44
tmlindweird21:45
freemangordonmhm21:45
tmlindadded by gatchat based on some timeout?21:46
freemangordonI was not able to find any place where '\n' is appended or set21:46
freemangordonlemme attach gdb again21:46
tmlindgdb on ofono?21:49
freemangordonmhm21:49
tmlindok21:50
freemangordonsee https://pastebin.com/4X79tuXs21:50
freemangordonthis is ...21:50
freemangordonridiculous21:50
freemangordonreceived_data is a callback to  g_io_add_watch_full21:51
tmlindnot sure if the ngsm packet in two pieces can even be decoded properly until both pieces have arrived :)21:52
freemangordonthe packet is there, it is just that there is some additional \n in the middle21:52
freemangordon"U0003~+MSIM=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n",21:53
tmlindmaybe it's some n_gsm.c bug21:53
freemangordonthis is the whole packet21:53
freemangordoncould be, but how to track21:53
tmlindand why would the ngsm script not see it?21:53
freemangordonmhm21:53
freemangordonI think it is some termio thing21:53
tmlindsometimes the ngsm 10 AT+MSIM? data comes back in three pieces looking at dmesg21:55
freemangordonyes, but it seems n_gsm manages to gather it21:56
freemangordonor not?21:56
tmlindyeah output from the script is just fine as is the whole packet in dmesg after the pieces21:57
freemangordonmhm21:57
tmlindcould it be some uncleared buffer in ofono?21:58
freemangordoncould be21:58
freemangordonlemme try to find21:58
tmlindalso check in your dmesg the parsed packet after "<-- 10) C: UIH(F)" is fine when ofono has a problem21:59
freemangordonalredy did21:59
freemangordon*already21:59
freemangordonit is fine21:59
tmlindok, so is the ofono extra \n always in the same place?22:00
freemangordonnot sure22:00
freemangordonstill debugging22:01
tmlindto me it seems the parsed packet from kernel should be ok with no extra \n in between, well should22:01
tmlindmaybe it somehow depends on the read size?22:02
tmlindfixed line lenght in ofono? :)22:03
tmlindwrapt to 80 chars? :)22:03
tmlind92 chars?22:04
freemangordonok, it gets correct data from g_io_channel_read_chars22:05
freemangordonlemme continue debugging22:05
tmlindhmm we skip past the first five chars in the pdu to ignore the U1234, maybe the math goes wrong there for the buffer size22:05
freemangordonwhat the? this time it is ok22:07
tmlindweird22:09
tmlindmaybe i introduced a hard to find bug with the p->hdrlen changes22:09
freemangordonmaybe it it gets read in chunks22:09
freemangordonor rather - the bug appears when data is read in chunks22:10
freemangordonand someone appends '\n'22:10
tmlinda good reason to replace gatchat with raw read and write functions using ell22:13
tmlindmaybe the change i did for at_chat_handle_command_response() fails to find anything if read in chunks22:19
freemangordonwill see22:19
tmlindresp = strstr(line, p->delimiter);22:20
tmlindwon't find the delimter and gatchat goes doing what it does22:20
freemangordonwhy response?22:21
freemangordonthis is unsolicited message22:21
tmlindhmm22:22
freemangordonhmm, modem does not report events anymore, rebooting22:25
tmlindnot sure but probably gatchat is parsing all the data coming from the line, it's been a while22:25
freemangordonbtw, it seems qmimodem received sim insertion notificationm22:26
tmlindok, zzz time here, ttyl22:28
freemangordongn22:28
Wizzupbtw, lenovo has an arm thinkpad laptop now23:50
Wizzupseems kinda nice, without fans23:50
Wizzupmostly random remark but yeah it's kinda cool23:50

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