Jump to content
  • 0

Telegram CLI - not able to receive or send msg


Hello - Forgive me first off as I am very new to Raspberry PI.  I just hooked everything up today and am trying to complete the initial Using Telegram CLI on the Raspberry Pi tutorial.  I have successfully registered my phone.  However, when I go to send a msg or try to get a msg from my husband's phone, nothing happens.  I have added a couple of screen shots for your view.  My ultimate goal is to be able to execute the tutorial called 'Control you Raspberry Pi using Telegram'.  However, this initial tutorial is a prerequisite.

I am working on these tutorials for a class project and am very nervous overall since I have never used a Raspberry PI or done any CLI type work.  I would appreciate any help you could provide to help me trouble-shoot my issue.

Thank you.




Share this post

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @Victoria,

I took a look into this issue and was able to get the messages sending via the two bash scripts. 

The scripts that were mentioned within the existing tutorial, however, need to be modified slightly.


In the tg.sh file you need to modify the following line,

(echo "msg $1 $2"; echo "safe_quit") | ${tgpath}/bin/telegram-cli -k tg-server.pub -W


(sleep 3; echo "msg $1 $2"; echo "safe_quit") | ${tgpath}/bin/telegram-cli -k tg-server.pub -W

Additionally, the tg_photo.sh file also has the same problem, so that also needs to be adjusted as shown below.

(echo "send_photo $1 $2"; echo "safe_quit") | ${tgpath}/bin/telegram-cli -k tg-server.pub -W


(sleep 3; echo "send_photo $1 $2"; echo "safe_quit") | ${tgpath}/bin/telegram-cli -k tg-server.pub -W

The issue was caused by the Telegram CLI not having retrieved the contacts list from the server before it was fed the "msg" command. The addition of the sleep command into the script should pause the msg command being sent long enough that the CLI tool should have retrieved the contact list.

Let me know if you have any issues.


Share this post

Link to post
Share on other sites
  • 0

Hi Emmet - Thank you for looking into the script.  I updated the first file tg.sh and wanted to make sure it worked before modifying the photo file.  I am still not receiving any msgs on my phone when i type from the Telegraph CLI.  Nor am I receiving any msgs to the Telegram when someone sends me a text.

I am on step #4 under the 'automating the telegram CLI on the raspberry pi' section of the main tutorial 'using telegram cli on the raspberry pi'.  Below is my screen shot, I don't see any errors but just not getting any msgs to/from telegram.



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now