Some of you know about the safer WhatsApp Alternative – Telegram. If you also want to send and receive Messages, Pictures and Videos on your Pi, this is the place for you. All you need is an additional Sim Card to receive the SMS. In a later tutorial, we will use receiving Messages to perform Actions on the Pi.
I use the Telegram Messenger CLI for Ubuntu. For this, some Packages have to be installed:
sudo apt-get install libreadline-dev libconfig-dev libssl-dev libjansson-dev python-dev lua5.2 liblua5.2-dev libevent-dev lua-lgi
Now the Package is loaded by Git and changed into the folder.
git clone --recursive https://github.com/vysheng/tg.git && cd tg
Then it is configured
and created (that may take a while):
Now only the Mobile Number and First and Last Name (which should be in the Profile) must be specified. Attention: The number must be in the format +4917612345678. The Last Name can also be skipped with Enter.
Tip: Andreas has made me aware in the comments that a landline number is also possible. To do this, enter
call at the pin query and confirm with Enter. You will then be called on this number and get the pin code announced.
bin/telegram-cli -k tg-server.pub
Now you can use some commands to send Messages / Pictures / Videos or add Contacts.
An overview of the commands can be found here.
add_contact <phone-number> <first-name> <last-name>
add_contact 4917612345678 Raspberry Pi
msg <peer> Text
msg Raspberry_Pi 'Hello, this is a test.'
In the contact name, spaces become underscores. With Tab, you can automatically complete a contact name.
Start Secure Chat
All messages are searched for the term(s).
Show Contact Information
All commands are as I said here.