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
./configure
and created (that may take a while):
make
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
add_contact <phone-number> <first-name> <last-name>
Example: add_contact 4917612345678 Raspberry Pi
Send Message
msg <peer> Text
Example: 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
create_secret_chat <user>
Example: create_scret_chat Raspberry_Pi
Search
global_search <peer>
Example: global_search Hello
All messages are searched for the term(s).
Show Contact Information
user_info <user>
Example: user_info Raspberry_Pi
All commands are as I said here.
7 Comments
Madison Square Garden (MSG), which owns the Forum, filed the suit claiming that the city of Inglewood, Butts and the Inglewood City Council defrauded and deceived them out of the lease to a 15-acre site the city held.
Hi,
I have some issues when I execute the “make” comand… can you write me by mail?
Thank you in advance.
am getting comand not found error
hi i got some reply in unknown language to me, could send me in english?
the make command gives some erronous output:
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_new’:
tgl/crypto/rsa_pem_openssl.c:41:6: error: dereferencing pointer to incomplete type ‘RSA’ {aka ‘struct rsa_st’}
ret->e = unwrap_bn (TGLC_bn_new ());
^~
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_n’:
tgl/crypto/rsa_pem_openssl.c:52:1: warning: control reaches end of non-void function [-Wreturn-type]
RSA_GETTER(n);
^~~~~~~~~~
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_e’:
tgl/crypto/rsa_pem_openssl.c:53:1: warning: control reaches end of non-void function [-Wreturn-type]
RSA_GETTER(e);
^~~~~~~~~~
make: *** [Makefile.tgl:20: objs/crypto/rsa_pem_openssl.o] Error 1
And it doesn’t find the telegram-cli command either:
pi@raspberrypi:~/tg $ bin/telegram-cli -k tg-server.pub
-bash: bin/telegram-cli: No such file or directory
I have tried several procedures that I found on the net, but none of them seem to work. Is there anyone experiencing the same problem? Anyone maybe with a solution please?
Thanks for any help in advance!
https://github.com/vysheng/tg/issues/1664 – go to the part where you have to disable the openssl when running ./configure
prpi@sannehome:~/tg $ sudo make
cat tgl/scheme.tl tgl/encrypted_scheme.tl tgl/binlog.tl tgl/append.tl tgl/mtproto.tl > auto/scheme.tl
gcc -I. -I. -I./tgl -g -O2 -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2 -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl/tl-parser -c -MP -MD -MF dep/tl-parser.d -MQ objs/tl-parser.o -o objs/tl-parser.o tgl/tl-parser/tl-parser.c
tgl/tl-parser/tl-parser.c: In function \u2018tl_parse_args134\u2019:
tgl/tl-parser/tl-parser.c:1907:26: error: \u2018sprintf\u2019 may write a terminating nul past the end of the destination [-Werror=format-overflow=]
sprintf (s, “%lld”, lrand48 () * (1ll << 32) + lrand48 ());
^
tgl/tl-parser/tl-parser.c:1907:9: note: \u2018sprintf\u2019 output between 2 and 21 bytes into a destination of size 20
sprintf (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile.tl-parser:4: objs/tl-parser.o] Fehler 1