Showing posts from October, 2016

Smart Headless RPi - Sends you a direct message in Twitter

Smart headless RPi
Tweeting RPi
Problem: Ever find your self wondering what the IP address is for your raspberry pi is once its headless and you need to remote into it, or even which network its connected to?
I wanted to know which access point my RPi is connected to and its IP address, and so i wrote a little clever program that lets me know just that.  This python program looks up its SSID and IP address then sends you message on twitter. You can use crontab to run this program on start up.

on github:

sys,socket, fcntl, struct, socket, array,os
from time import sleep
from twython import Twython

Device_Name="Your Device Name"

#get IP address
def get_ip(ifname):
        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        return socket.inet_ntoa(fcntl.ioctl(
                struct.pack('256s', ifname[:15])


IP_address = ge…