Chatty cli for texting over ssh

Does chatty currently offer a CLI? I’d prefer to ssh into my phone when having to use another device to monitor text.

Looked here but didn’t find anything that looked like a cli was available.

haha, would die if I was also able to use vim when composing text.

1 Like

Good question. I already asked this in the context of scanning QR codes that purport to send text messages. And an actual answer emerged here: Librem 5 Capabilities That No Other Phone Has and subsequent replies.

It definitely worked for me. It hasn’t made it into the Wiki yet though. It’s a little untidy but it does work.

I added it to the Wiki: https://source.puri.sm/Librem5/community-wiki/-/wikis/Tips-&-Tricks#send-sms-text-message-from-terminal

3 Likes

I saw that but hit a road block and decided to ask the question before I burned too much time.

your the best! Thanks for the wiki.

Ideally though, I think it would be preferable to keep chatty running and interface with the running process via cli.

1 Like

Yes. It’s untidy.

Right now if you don’t pause or terminate chatty then it somehow just eats the SMS without sending it. If you were to create a script then chatty would be paused for such a short amount of time that maybe it’s OK.

Before putting those instructions in the Wiki yesterday I did actually type those commands by hand (on the Librem 5 on-screen keyboard, cough, yes, really) and that meant that chatty was paused for several minutes - and even then there were no ill-effects.

However you are of course right. A better long-term solution is an interface into chatty that is compatible with keeping chatty running.

If scripting this then it might be wise to wait until the text message is actually sent before resuming chatty. You can see the status of the message with: mmcli -m any --messaging-list-sms

PS Many different people have contributed to the Tips and Tricks Wiki, not just me.

This is pretty cool! It might be made a bit more interactive with a couple of read for the text and phone number and storing them as variables. :smiley:

also this ticket might be relevant for this topic of sending sms:

2 Likes

That was left as an exercise for the reader. :wink:

The Ubuntu mobile does this with a script too, here to get an idea:

$  /usr/share/ofono/scripts/send-sms /ril_0 +4915122xxxxxx "hola amor" 0

See also my booklet:
https://guru-1.gitbook.io/bq-aquaris-e-4-5-ubuntu-phone/en/chapter17

The script send-sms (delivered as default) is:

#!/usr/bin/python3

import sys
import dbus

if len(sys.argv) < 4:
    print("Usage: %s [modem] <to> <message> <delivery report>" %\
                    (sys.argv[0]))
    sys.exit(1)

bus = dbus.SystemBus()

if len(sys.argv) == 5:
    path = sys.argv[1]
else:
    manager = dbus.Interface(bus.get_object('org.ofono', '/'),
                    'org.ofono.Manager')
    modems = manager.GetModems()
    path = modems[0][0]

print("Send message using modem %s ..." % path)


mm = dbus.Interface(bus.get_object('org.ofono', path),
                    'org.ofono.MessageManager')

if len(sys.argv) == 5:
    mm.SetProperty("UseDeliveryReports", dbus.Boolean(int(sys.argv[4])))
    path = mm.SendMessage(sys.argv[2], sys.argv[3])
else:
    mm.SetProperty("UseDeliveryReports", dbus.Boolean(int(sys.argv[3])))
    path = mm.SendMessage(sys.argv[1], sys.argv[2])

print(path)
1 Like

I have this image of all these dudes hunkering around a mobile phone that is hooked up as a sms server on remote. God that would be great for business marketing sms, especially if one could then actually pickup and hold the sms txt-server in ones hands… and then walk out with it while talking to a client on it.