
Sending and Receiving SMS on Linux (2015) - dnate
https://www.20papercups.net/programming/sending-receiving-sms-on-linux/
======
hardwaresofton
I've long suspected that the only way to make an actually private/secure
cellular phone is by bypassing 3G all-together and making it optional --
forcing the SMS/SIP features of the phone were actually on separate hardware
that had very limited integration with the phone itself (essentially as
dangerous as any external USB device would be)?

Most smart phones are considered pwned-by-default due to the inclusion of the
3G/4G/whatever chip you have no control over.

Of course, there's the whole issue of distributed trust by way of pre-loaded
X509 certs but there are some relatively secure ways around that (keybase,
meeting in person and swapping PGP keys, etc) that would move the goalpost far
enough to where it might not even matter any more.

Does anyone know anything that's close to this? basically a phone that only
uses SDR for connectivity?

~~~
confounded
> _SMS /SIP features of the phone were actually on separate hardware...
> basically a phone that only uses SDR for connectivity?_

Not exactly what you’re after, but the Librem 5 (crowd-funded, at the head-
scratching stage) aims to put the baseband processor in an optional M2 slot
with killable power. On a device that runs Debian. From following progress on
that project I’ve got the impression that everything to do with chips for
mobile connectivity are so patent/IP-law encumbered that there’s little hope
for Free Software replacements.

[https://puri.sm/shop/librem-5/](https://puri.sm/shop/librem-5/)

However, hacking on that handset is the best chance I’m aware of for you
getting the device you want (perhaps with something else in the M2 slot).

~~~
znpy
> but the Librem 5 aims to put the baseband processor in an optional M2 slot
> with killable power.

If that comes true I am definitely getting one.

------
znpy
This was an awesome read. I finally decided to resuscitate my old ThinkPad
x200s who had a modem card in it, put SIM card in the spot and do some
testing. Sammy/fammi worked after some quarrel with ModemManager (not really
it's fault, it was doing his job).

By the way this read has resuscitated an old fantasy of mine: adding an
indirection layer to my mobile phone presence.

After this testing I am finally sure I can leave my SIM card at home and just
use a regular internet connection to poll messages from home. My bigger
fantasy is to be able to proxy calls too, so that I can finally leave this
third-millennium-leash (my phone) at home.

~~~
rohit2412
Just buy Google fi, and access/dial your phone calls/sms in hangouts.

~~~
znpy
> Just buy Google fi, and access/dial your phone calls/sms in hangouts.

Please, tie yourself to Google a bit more.

FTFY.

------
smcl
It’s also possible to do this by sending AT commands via serial - I wrote some
python scripts to do so on my Thinkpad:
[http://blog.mclemon.io/thinkpad-x250-sms-and-gps-via-
python](http://blog.mclemon.io/thinkpad-x250-sms-and-gps-via-python)

~~~
digi_owl
I seem to recall that Openmoko was built this way.

------
songzme
Great read, this spiraled me down a rabbit hole of research, posting it here
in case someone has the same questions:

How phone numbers / phones work:
[https://www.youtube.com/watch?v=FZsajM6M3UY](https://www.youtube.com/watch?v=FZsajM6M3UY)

How to buy a block of phone numbers: [https://www.siptrunk.com/2015/12/how-to-
find-did-number-bloc...](https://www.siptrunk.com/2015/12/how-to-find-did-
number-blocks/)

I'm trying to do a thought exercise on how I might approach building a Twilio
side project, but after I buy phone numbers from sipTrunk, I wouldn't know how
to connect it to sim cards.

~~~
techsupporter
Depending on what you want your project to do, you don't need to connect a
phone number to a SIM card. Twilio does that for you, letting you use their
API to send and receive SMS (text) messages with other phone numbers. It's the
recipient's phone number, not your Twilio one, that's connected to a SIM card.

What the linked post here talks about is using a device that's basically a
mobile phone in a USB stick form factor to send and receive SMS like you'd do
on a mobile phone. You buy a SIM, insert it into the device, and start
texting. That's the other side of what your Twilio project would do.

~~~
songzme
Oops I reread my statement and I think I miscommunicated. I meant I'm trying
to figure out how I might build Twilio (the product). OP's article shows how
to send/receive texts (check). I don't know how Twilio buys numbers, and how I
might build a service that buys numbers for people.

------
Symbiote
I've inherited (then reinstalled) a monitoring system using SMS Tools. The
modem has a long USB cable, and an external antenna. I positioned the antenna
on top of the rack.

It's in the middle of the ground/machine floor of a large building, so there's
a lot of thick concrete walls around, but it gets a good signal and reliably
sends SMS alerts to me.

------
babayega2
The same project using an SMS modem , kannel and Django
[https://hackernoon.com/build-an-sms-center-with-python-
kanne...](https://hackernoon.com/build-an-sms-center-with-python-kannel-and-a-
gsm-modem-9c0d29560d82)

Edit: and a repository of modems that can send SMS on Linux is here :P
[https://wammu.eu/phones/](https://wammu.eu/phones/)

------
mateuszf
For personal usage: if you have an Android phone and are not bothered by web
ui, you can use [https://messages.android.com/](https://messages.android.com/)

~~~
gh02t
Side note, is it just me, or is the Android Messages app really laggy?
Especially on the phone, there is a significant delay from when I hit send to
the message popping up on screen, to the point that I frequently get the
"Messages has stopped working, would you like to stop it" dialog. It has been
slowly getting better, but it's still surprising in such a high-profile app so
I'm wondering if it's something specific to me.

That said, I recently switched to AM from Pulse (which also has a webui). I
quite liked Pulse, but the web interface had a lot of trouble staying in sync,
plus it requires a subscription to use the web interface. Also tried
MightyText, but $7/mo is ridiculous and it also had sync issues. Android
Messages seems to have really nailed sync across several devices, which is
pretty important to me.

~~~
bradstewart
I have the exact same issue (on a Pixel 2 XL). It started a few months ago,
and has been getting progressively worse.

------
magnat
> So, we got hold of a USB GSM modem and used a prepaid phone SIM. This
> allowed us to receive unlimited messages for free.

Keep in mind it is common (at least in EU) for mobile providers to forbid M2M
and M2P traffic when using typical customer tariff plan, especially ones with
unlimited messages. It's quite easy to detect it and SIM cards used in such
way are blocked rather quickly.

~~~
gsich
Read again, it was receiving.

------
diftraku
The first mistake in the article is using smstools. Having personally had to
deal with smstools for the past two years, using Gammu SMSD or even a paid SMS
Gateway would have been a better choice.

Granted, this was on OpenWRT using a frozen version of smstools and largest
issues were with trying to get Å, Ä & Ö to work (fun times with
UCS-2/UTF-8/WTF-8 and Latin1/CP-1502/ISO-8859-1). It sure was an experience
and in the end, the problem was blown away by just using UTF-8 (which had the
unfortunate side-effect of doubling the amount of sent messages due to the
space taken by the encoding).

What puzzles me is how easily large entities go for services that send from a
random phone number (for example, VR in Finland sends "mobile train tickets"
via random numbers that change with every message) where as some opt to "fake"
the from number to have the company/service name.

------
arendtio
Btw. if its just about replying to an SMS manually, tools like kdeconnect [1]
can be handy which allow you to write SMS messages on your desktop and send
them via your smartphone.

[1]: [https://albertvaka.wordpress.com/2016/08/26/kde-
connect-1-0-...](https://albertvaka.wordpress.com/2016/08/26/kde-
connect-1-0-is-here/)

~~~
flak48
I worked on adding SMS support through 3g sticks for KDE too, using KDE
IM/Telepathy a while ago. Fun times.

[https://hashpling.wordpress.com/2013/08/22/sms-messaging-
wit...](https://hashpling.wordpress.com/2013/08/22/sms-messaging-with-
telepathy-gsoc-update/)

------
walrus01
Before anyone thinks of implementing this for large-scale
notifications/outbound SMS with one SIM card and an "unlimited" SMS plan for
$40/mo, be aware that your cellular carrier will rate limit or cut you off
completely pretty quickly if you use it for bulk SMS.

There's a reason why various VoIP providers have APIs and bulk SMS rate
pricing.

------
ebrinkster
Great project, definitely going to do this. I've been wanting a setup like
this to use with the Gnokii(1) toolkit for sending SMS class 0 messages. Maybe
this toolkit can do this as well.

Curious if anyone else here has tried this as well...

1: [https://www.gnokii.org/](https://www.gnokii.org/)

------
spoiledtechie
You don't need any of this stuff. It might be technically cool to do SMS now,
but there is an android app for SMS Gateways. Just have an extra phone that
sits around and sends SMS all day long. Much cheaper than Twilio if your
sending large amounts of text messages.

------
pknopf
Is it possible to write an Android/OS app that has full control over SMS, and
have that app connect (as a "node") to a central server for sending/receiving
messages? Then, if you need more throughput, just turn on some more phones?

------
syntaxing
Is there a way to something similar to this but for MMS?

------
pmlnr
gammu-smsd looks simpler to me.

