• First Steps
  • General
  • Projects
Facebook Twitter YouTube
Tutorials for Raspberry Pi Tutorials for Raspberry Pi
  • Hardware & GPIO
  • Sensors & Components
  • Scale
  • Cases
  • Fingerprint
  • Gas Sensor
  • Heartbeat
  • German
Tutorials for Raspberry Pi Tutorials for Raspberry Pi
Home»Software»Telegram Messenger on the RaspberryPi

Telegram Messenger on the RaspberryPi

Facebook Twitter LinkedIn Tumblr Email Reddit
Raspberry Pi Telegram Messenger
Share
Facebook Twitter LinkedIn Email Tumblr Reddit Telegram WhatsApp

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.

android ios messenger secure chat securechat telegram whatsapp
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleFan control for better Overclocking of the Raspberry Pi
Next Article Control Raspberry Pi via Telegram Messenger

Related Posts

Control all GPIOs with the Raspberry Pi REST API via Python

Using TensorFlow Lite with Google Coral TPU on Raspberry Pi 4

Raspberry Pi Samba Server: Share Files in the Local Network

Build Live Text Recognition with the Raspberry Pi (OCR)

7 Comments

  1. Vice on 12. March 2018 21:43

    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.

    Reply
  2. Adrian on 16. August 2018 20:05

    Hi,
    I have some issues when I execute the “make” comand… can you write me by mail?
    Thank you in advance.

    Reply
  3. viswa on 14. February 2019 8:18

    am getting comand not found error

    Reply
  4. viswa on 14. February 2019 14:46

    hi i got some reply in unknown language to me, could send me in english?

    Reply
  5. Marcel on 5. June 2020 22:54

    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!

    Reply
  6. Jack on 19. June 2020 16:51

    https://github.com/vysheng/tg/issues/1664 – go to the part where you have to disable the openssl when running ./configure

    Reply
  7. Eckard on 5. May 2022 4:55

    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

    Reply

Leave A Reply Cancel Reply

7 Segment Display (Anode) with MAX7219 / MAX7221 and Raspberry Pi

How to build a Smart Agriculture System using IoT

Let Raspberry Pi Robots Follow Their Own Voice (Part 5)

Build Live Text Recognition with the Raspberry Pi (OCR)

ESP32 Cam Livestream Tutorial – Camera Module for the ESP8266

How to use a Raspberry Pi Fingerprint Sensor for Authentication

Subscribe to Blog
Subscribe to Raspberry Pi Tutorials and don't miss any new Tutorial!
Subscribe

Thank you!

We will contact you soon.

Tutorials for Raspberry Pi
Facebook Twitter YouTube
  • Contact & Disclaimer

Type above and press Enter to search. Press Esc to cancel.