A raspberry pi telegram bot to send you the ip address of raspi without the need of monitor sdasd
- First you need to install and setup telegram on your mobile phone or laptop from https://telegram.org/
- Next search for the BotFather bot on telegram by searching
@BotFather
or by visiting https://telegram.me/BotFather - Send
/newbot <your new bot name>
command to BotFather and it will create a new bot by that name - Send
/token
command to get a auth token for this bot
- Replace token in line 10 of myaddress.py with the token received from step 4 above
- Start chatting with your new bot by sending some message.
- Make sure the path to the log file exists in line 4 of myipaddress.py
- Install some dependecies
sudo apt-get install libffi-dev libssl-dev
- Install telegram library for python
pip install python-telegram-bot netifaces
- Just run the bot with
python myipaddress.py
and you should be getting the ip address of the raspi
Hey Dude. My new IP Address is 192.168.1.111
- Open Crontab using
crontab -e
- Add an entry at the bottom like this (Make sure the script exists on the path)
@reboot sleep 60 && python dev/scripts/myipaddress.py &
- Send a test message to the bot everytime when you need the ip address before boot.