Ticket #260 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

GetSimReady returns 0 after Zhone restart; GSMd fails to be killed.

Reported by: PaulFertser Owned by: mickey
Priority: critical Milestone: milestone5
Component: framework/ogsmd Version:
Keywords: Cc: fercerpav@…, xbmodder@…

Description

The problem is that org.freesmartphone.GSM.SIM.GetSimReady returns 0 after Zhone restart. According to log the modem doesn't send a %CSTAT status, though it was reset by ATZ and answered OK on AT%CSTAT=1 request.

I can send a log that shows that after a minute after ATZ the modem still didn't send a %CSTAT report. It didn't send it later as well (or else the icons in Zhone would have become highlighted).

As the exact documentation on %CSTAT is unavailable (thank you, TI), i looked it up in Enfora's. It says that the %CSTAT codes will be delivered only after power on. If it is really the case with calypso it is no surprise that we never get SimReady signal as we don't power-cycle the modem (ATZ seems to be not equivalent, and we can't do $RESET). So it seems that %CSTAT should be avoided altogether...

Attachments

func.patch Download (2.4 KB) - added by sdhillon 3 years ago.
Better killall function
new.patch Download (2.5 KB) - added by sdhillon 3 years ago.
New Patch, use this one.

Change History

comment:1 Changed 3 years ago by PaulFertser

  • Cc fercerpav@… added

comment:2 Changed 3 years ago by PaulFertser

The root of the problem is that frameworkd powers off the GSM modem by killing gsm0710muxd with "killall" which is not present in default Debian install (it has pkill instead). Therefore modem is not power-cycled and we don't get %CSTAT.

comment:3 Changed 3 years ago by mickey

  • Status changed from new to assigned

Good find. I have since rewritten this function to use a proper POSIX call, please test and close this ticket, if applicable.

comment:4 Changed 3 years ago by PaulFertser

  • Status changed from assigned to closed
  • Resolution set to fixed

Thanks for the fast fix!

But it still should be considered a workaround. Mixing dbus calls with POSIX signals is inconsistent. What if we have 2 modems on the same device? Or what if gsm0710muxd is running on another machine and uses dbus over TCP/IP? And so on...

Moreover, i still don't like the idea of counting on %CSTAT which is not properly documented and which we can miss for whatever reason and it won't repeat. It doesn't feel right. And if you decide to count on it, the gsm0710muxd behaviour should be documented, i.e. the power-cycling part should be made mandatory.

And, in general, i suggest to document every single command that is used by ogsmd and is not covered by the official documentation. It is so very frustrating to read the code and see some magic command nobody ever mentioned.

Changed 3 years ago by sdhillon

Better killall function

comment:5 Changed 3 years ago by sdhillon

  • Priority changed from major to critical
  • Cc xbmodder@… added
  • Status changed from closed to reopened
  • Resolution fixed deleted
  • Summary changed from GetSimReady returns 0 after Zhone restart to GetSimReady returns 0 after Zhone restart; GSMd fails to be killed.

Mickey's killall function isn't POSIX compatible, and doesn't work. This new function has been tested for functionality under Debian/FSO. -Thanks

Changed 3 years ago by sdhillon

New Patch, use this one.

comment:6 Changed 3 years ago by sdhillon

This patch has error handling (very menial), and returns the list of killed pids, but doesn't check if they've been successfully killed.

comment:7 Changed 3 years ago by mickey

  • Status changed from reopened to closed
  • Resolution set to fixed

sent to master and stabilization/milestone4, thanks.

Note: See TracTickets for help on using tickets.