frimtec / pikett-assist

:rotating_light: PAssist is an Android application to assist you while doing on-call duties. PAssist works for SMS based alerting systems.
Apache License 2.0
27 stars 3 forks source link

PAssist does not generate allert, but S2MSP receives message #412

Closed rck closed 1 year ago

rck commented 1 year ago

Hi,

first of all thanks for the app. I tried it some weeks ago and it looked like it works, but now does not (same behavior with a second phone from a working colleague).

Versions: PAssist: 2.7.5-National; Build 1170925 S2MSP: 2.5.2; Build 1097353 both from izzyondroid

In PAssist everything looks like it is setup successfully, all lights are green, I'm on call. The call centers number is set in PAssist and allowed in S2MSP and when I send a test SMS I see a "SmsListener: SMS received" message in S2MSP at the same time when the message pops up in the regular SMS app. Never the less, it never generates any notification in PAssist. The only notification is that I'm on-call. In PAssist the only log entries are about "Expecting binder but got null!" and "OpenGLRenderer" messages that look harmless. Both apps have "pause app activity if unused" disabled in their app settings. S2MSP has SMS permissions. S2MSP notifications are off and I can not enable them, but I guess that is normal?

All of that happens when the phone is on, so for now I'd assume we can rule out some sleep modes. Any hints? Any information you would need that could help to resolve the issue? The Android version in use is 13, LineageOS from 20230314. The second test phone with the same behavior runs latest stock one plus firmware.

frimtec commented 1 year ago

Hi @rck, thank's for your question. I will read in detail and think about your issue as soon as possible and get back to you.

frimtec commented 1 year ago

First of all, you are the first user I know using LineageOS. Maybe it has something to do with that. But anyway, I'm very intressted to get it working for you, to make PAssist usable for more people.

The first thing to check is, if S2MSP and PAssist can exchange SMS messages.

This can be done in PAssist with the conext menu of the SMS-adapter tile (the top tile in the overview). Push and hold the SMS-adapter tile and then choose "Send test SMS". You should then see two toast pop ups in PAssist:

Can you please check if this is the case? If not, please send me the Logcat logs from PAssist and S2MSP in the time frame of the "Send test SMS" call.

During this test no real SMS are exchaned. It is a kind of loopback communication. PAssist sends a message to a special loopback number to S2MSP. If S2MSP receives this loopback message it just sends the message back to the sending application.

rck commented 1 year ago

hi and thanks for your efforts,

I tested that on both phones (the lineageos one and the one running the official oxygen os) and that works on both.

what I also tried during my other tests was "schedule bogus alarm" and "create alert manually" which both work fine as well.

frimtec commented 1 year ago

That is good so far :-)

When S2MSP receives an SMS it decodes the numer of the SMS sender. This number is matched to the registered numbers. When there is a match, the SMS is delivered to the application that has registered this number.

If the number matches a registered number you see the following log sequence:

I guess the second log is missing in your log, as of your first posting.

The number decoded from the SMS is normaly a string with the full number in the form +41791231212 (international form). Some rare carriers do not deliver the "+" character in the number but that is ok and handled by S2MSP.

The number registerd on S2MSP therefore should also be in the international format including the "+" character, can you please check that in the S2MSP UI? If this is not the case, check if the phone number of your operation center contact in the contact application is stored in the full international form. If you need to change it, open PAssist afterwards and register the changed number on S2MSP.

If the numbers are setup correctly but it is still not working, let me know, I will prepare some extra log-statements in S2MSP to log the effective number decoded from the SMS.

frimtec commented 1 year ago

S2MSP 2.5.3 is available with enhanced logging: Example:

SmsListener: SMS received from numbers: [+41791230000]
SmsListener: broadcastReceivedSms,  count: 1; to application: com.github.frimtec.android.pikettassist

It will be available on izzyondroid from tomorrow evening or you can take it directly from github: https://github.com/frimtec/secure-sms-proxy/releases/download/2.5.3/app-release.apk

rck commented 1 year ago

we are getting there...

and now the log (I added the ..., but the interesting part is the first one):

03-23 07:16:23.534 19195 19195 I SmsListener: SMS received from numbers: [+082...]
--------- beginning of main

so in this case the + is there but the 43 (for Austria) is lost and the local 0 added again. wild guess would be that the number is received as "local" 082 and then you add the "missing" +. but that is all guessing, you know that better.

these messages show up in the normal SMS app under the appropriate account. fwiw these messages are sent via the websms.com api

frimtec commented 1 year ago

Good to know, this is it - thanks for your analysis.

Not sure if this local numbers are related to your carrier or the OS version. Anyway I opened an issue on S2MSP (https://github.com/frimtec/secure-sms-proxy/issues/203).

Will try to get a proper solution for that. Would be great if you @rck can support me for testing, as I cannot reproduce the situation. I keep you informed as soon as I have a S2MSP version to test.

frimtec commented 1 year ago

There is a beta release of S2MSP available with a fix for local numbers (PR https://github.com/frimtec/secure-sms-proxy/pull/204). Tests with the simulator (with simulated local numbers) and on my own phone (with fixed international numbers) are fine.

The APK of 2.6.0-beta1 can you get from Github: https://github.com/frimtec/secure-sms-proxy/releases/download/2.6.0-beta1/app-release.apk

Please @rck, let me know if this fixes your number issue. If all is fine I will make a official release and mark S2MSP release 2.6.0 as must update for PAssist.

chrboe commented 1 year ago

I just tested the beta (I'm the mentioned other user with the OnePlus) and FWIW it works perfectly for me!

Thanks a lot for your efforts and the quick turnaround 👏

frimtec commented 1 year ago

Thanks @chrboe for the feedback👍 Will release the final version tomorrow.

rck commented 1 year ago

works like a charm, thanks for your effort

frimtec commented 1 year ago

Released new PAssist Version 2.7.6 that requests update of SMS adapter to new S2MSP 2.7.0.

S2MSP 2.7.0 is available already on Github and on izzyondroid at around 20 PM/UTC today.

rck commented 1 year ago

piggybacking on this issue: I installed PAssist from izzyondroid and there the donation option then does not work, which I assume is expected, because "This version of the application is not configured for billing through Google Play". If you have some paypal link or anything that could be added to the README that might make it easier for people to donate.

frimtec commented 1 year ago

Nice that you ask about that! I will think about it. I'm also happy with stars on the github repos of PAssist and S2MSP ;-)