Now I tried myself and then realized that some more options are helpful to get more verbose output from chatty. Instead of just chatty --debug you can do this (I’m sorry I did not mention that before, did not realize it was needed):
G_MESSAGES_DEBUG=all chatty --debug --verbose
Then I get output saying things about MMS, it looks like this when an MMS arrives:
(sm.puri.Chatty:1596): mm-sms-DEBUG: 23:15:21.331: pur_mm_get_new_sms path /org/freedesktop/ModemManager1/SMS/11
(23:15:21) mm-sms: New SMS at '/org/freedesktop/ModemManager1/SMS/11'(sm.puri.Chatty:1596): mm-sms-DEBUG: 23:15:21.331: cb_dbus_signal_sms_added: New SMS at /org/freedesktop/ModemManager1/SMS/11
(sm.puri.Chatty:1596): mm-sms-DEBUG: 23:15:21.375: pur_mm_check_pdu_type: pdu type deliver
(sm.puri.Chatty:1596): mm-sms-DEBUG: 23:15:21.375: cb_sms_list_new_ready
(sm.puri.Chatty:1596): mm-sms-DEBUG: 23:15:21.429: Received SMS WAP! Sending proxy call to mmsd
(sm.puri.Chatty:1596): mm-sms-DEBUG: 23:15:21.430: cb_sms_state_change: state received
(sm.puri.Chatty:1596): mm-sms-DEBUG: 23:15:21.460: cb_pur_mmsd_push_notify
(sm.puri.Chatty:1596): mm-sms-DEBUG: 23:15:21.495: Couldn't delete SMS - error: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized: PolicyKit authorization failed: not authorized for 'org.freedesktop.ModemManager1.Messaging'
(sm.puri.Chatty:1596): mm-sms-DEBUG: 23:15:22.089: pur_mmsd_get_new_mms_cb
(sm.puri.Chatty:1596): mm-sms-DEBUG: 23:15:22.089: pur_mmsd_receive_message: New MMS at /org/ofono/mms/modemmanager/556045CCC6C9DC237E9636145C6AB575E785CD94
[...]
Another thing you could do to find out more is to see what the dbus-monitor command shows when an MMS is received. For me dbus-monitor shows the following, among other things:
To check that, maybe @francepat could look at the full path to mm-sms.so shown by the lsof command, to see if that is the mm-sms.so file you want or if it is another such file located somewhere else?
And I verified via lsof that /usr/lib/purple-2/mm-sms.so was being used. I will try the additional debug.
I also noticed with the lsof command that it was referencing a log under /.purple/logs/mm-sms/sms/…/2021-04-13.175846-0400EDT.html and in that file was the last message sent that went along with the image.
I will try the additional debug that @Skalman mentioned.
I found this to be a nicer way to test it, using grep to see only the stuff I care about:
dbus-monitor | grep -A40 "member=MessageAdded"
The above command will output the dbus info for each received MMS message.
So why is mmsd giving that dbus message for me but not for you? Maybe @kop316 has an idea about how to figure that out?
In the mmsd source code it looks like the “MessageAdded” dbus message is sent in the emit_message_added() function, then it corresponds to the following line in the mmsd debug output:
Do you get such a “emit_message_added()” line in your mmsd debug output? If not, a next step could be to find out why mmsd does not get to calling that function in your case.
I don’t think so. I get such errors also when running chatty manually, but receiving MMS still works in spite of those errors. I guess it’s just that it is not authorized to remove messages, which it normally does after processing them.
Maybe, but the only configuration we have as far as I know is those 5 lines in the ~/.mms/modemmanager/ModemManagerSettings file.
GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized: PolicyKit authorization failed: not authorized for ‘org.freedesktop.ModemManager1.Messaging’
(sm.puri.Chatty:2084): mm-sms-DEBUG: 20:16:07.908: Couldn’t delete SMS - error: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized: PolicyKit authorization failed: not authorized for 'org.freedesktop.ModemManager1.Messaging
That is a new error to me.
EDIT: Sorry shoudl be more verbose. I have never seen that error across Pinephones/Librem 5s, and in any distro, so I really don’t know what is causing it.
@kop316 I have been trying to capture debug output from chatty, but not having any luck. If I don’t daemonize (–daemon option) it then it doesn’t keep running. If I daemonize it then I can’t capture the output because it seems to capture only the output before it forks. Also, is it possible that you are using a special version of chatty. When I followed the instructions from Julius there were a bunch of steps, but I didn’t see anything about a new version of chatty.
But you did post debug output from chatty earlier, in your comment above where you wrote this:
that was debug output from chatty. As noted earlier in this thread, chatty can be started with debug output enabled in the following way:
G_MESSAGES_DEBUG=all chatty --debug --verbose
Note that you need to kill the existing chatty process first, maybe two times so that the autostart mechanism gives up.
Alternatively, if you want to get debug output from chatty akready for the autostarted chatty, you can get that by changing the following two files:
(1) Change the Exec line in the /etc/xdg/autostart/sm.puri.Chatty-daemon.desktop file so that it looks like this:
Exec=chatty --daemon --debug --verbose
(so you add “–debug --verbose” in the end of that line)
(2) Add the following line in the end of the /etc/profile.d/librem5.sh file:
export G_MESSAGES_DEBUG=all
Then reboot, and after reboot the chatty debug output will go to the journalctl log, you can then view it using the following command:
sudo journalctl -b | grep -i chatty
Does that help?
You should not need to install any special version of chatty, at least for me all this (both getting chatty debug output and receiving MMS) works with the default chatty in PureOS amber-phone. You “only” need the modified libqmi and ModemManager and purple-mm-sms and mmsd versions.
I have seen that error a lot. My understanding is that it comes in PureOS when running chatty “manually” from the command-line. However, I have not worried much about it because it does not stop me from receiving MMS messages.
As far as I can tell, that error does not come when chatty runs in the default way, that is when chatty is started automatically. It says “PolicyKit authorization failed”, I’m not very good at that stuff but it has something to do with different processes being authorized to do certain things, my guess is that when chatty is started automatically in the proper way, the chatty process somehow gets the authorization it needs, but when I start it manually the process is not considered authorized to do the delete SMS operation. Anyway I got the impression that it is not critical because for me, receiving MMS works even if that error message comes.
Yes, that is exactly why I was trying to figure out how to run it from /etc/xdg/autostart and capture the output, because I looked at the policy file in /usr/share/polkit-1/actions and saw that it was different whether run from remote terminal or not.
How do you see that? You are looking in the /usr/share/polkit-1/actions/org.freedesktop.ModemManager1.policy file, at the “org.freedesktop.ModemManager1.Messaging” part? Then I guess it must be this part of that file:
So I tried this but for some reason it appears the log file I capture (by redirecting) doesn’t continue to capture after a certain point. So I sent in a message and get nothing. So I again ran it from the command line:
chatty --daemon --verbose --debug
and redirect to a file. I get output from that:
(sm.puri.Chatty:1744): mm-sms-DEBUG: 19:48:49.431: pur_mm_get_new_sms path /org/freedesktop/ModemManager1/SMS/2
(19:48:49) mm-sms: New SMS at ‘/org/freedesktop/ModemManager1/SMS/2’(sm.puri.Chatty:1744): mm-sms-DEBUG: 19:48:49.431: cb_dbus_signal_sms_added: New SMS at /org/freedesktop/ModemManager1/SMS/2
(sm.puri.Chatty:1744): mm-sms-DEBUG: 19:48:49.441: pur_mm_check_pdu_type: pdu type deliver
(sm.puri.Chatty:1744): mm-sms-DEBUG: 19:48:49.441: cb_sms_list_new_ready
(sm.puri.Chatty:1744): mm-sms-DEBUG: 19:48:49.963: Received SMS WAP! Sending proxy call to mmsd
(sm.puri.Chatty:1744): mm-sms-DEBUG: 19:48:49.964: cb_sms_state_change: state received
(sm.puri.Chatty:1744): mm-sms-DEBUG: 19:48:50.026: cb_pur_mmsd_push_notify
(sm.puri.Chatty:1744): mm-sms-DEBUG: 19:48:50.054: Couldn’t delete SMS - error: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized: PolicyKit authorization failed: not authorized for ‘org.freedesktop.ModemManager1.Messaging’
Because I got the policy kit error again, I tried this time from the terminal on the phone instead of in a shell after ssh’ing in and I captured this:
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:55:21.360: Received SMS WAP! Sending proxy call to mmsd
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:55:21.360: pur_mm_check_pdu_type: pdu type deliver
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:55:21.360: cb_sms_list_all_ready
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:55:21.361: Need to unlock sim /org/freedesktop/ModemManager1/SIM/1 (89014104279702124090)
(sm.puri.Chatty:1797): dconf-DEBUG: 19:55:21.361: change_fast
(sm.puri.Chatty:1797): dconf-DEBUG: 19:55:21.361: change_notify: /sm/puri/Chatty/country-code
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:55:21.451: cb_pur_mmsd_push_notify
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:55:21.477: Couldn’t delete SMS - error: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: Couldn’t delete 2 parts from this SMS
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:56:30.328: pur_mm_get_new_sms path /org/freedesktop/ModemManager1/SMS/3
(19:56:30) mm-sms: New SMS at ‘/org/freedesktop/ModemManager1/SMS/3’(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:56:30.329: cb_dbus_signal_sms_added: New SMS at /org/freedesktop/ModemManager1/SMS/3
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:56:30.348: pur_mm_check_pdu_type: pdu type deliver
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:56:30.348: cb_sms_list_new_ready
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:56:30.754: Received SMS WAP! Sending proxy call to mmsd
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:56:30.754: cb_sms_state_change: state received
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:56:30.780: cb_pur_mmsd_push_notify
(sm.puri.Chatty:1797): mm-sms-DEBUG: 19:56:30.809: Couldn’t delete SMS - error: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: Couldn’t delete 2 parts from this SMS
I am getting an error, but not a policy kit error. I don’t know if this is why I am not receiving the notification from chatty on the phone.