Robert Cudmore    archive    tags    search    software


Raspberry startup tweet

Have a Raspberry send a tweet with its IP when it boots. This is incredibly useful when your Pi is headless with no monitor. There are tons of tutorials on this including one at instructables and another at opensource.

This is what you will get

Used to send email at boot but I can’t get the Pi to send email via gmail any more?

Create and configure a twitter app

Go to apps.twitter.com and make a twitter app. You will need a normal twitter account. Make sure you turn on read/write access. Once that is done, note down all the keys.

install tweepy (could also use twython)

pip install tweepy

Write a python script

Lets call it startup_tweeter.py. See Github Gist below.

Make the python script run at boot

Make script executable

chmod u+x startup_tweeter.py

Edit crontab

sudo crontab -e

Add one line at the end of crontab

@reboot (sleep 10; python /home/pi/startup_tweeter.py)

Python script to tweet IP

This is taken from RasPi.tv

Tags: linux, raspberry

©2020. Robert Cudmore.