Created
April 6, 2018 15:35
-
-
Save DylanGore/aacefbeb99644db6c9cec59dd3b50756 to your computer and use it in GitHub Desktop.
Simple python script designed with RPi headless in mind. It will get the local IP address on boot and send it as a PushBullet notification.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/local/bin/python3 | |
import netifaces | |
from pushbullet import Pushbullet | |
#Setup PushBullet | |
pb = Pushbullet("YOUR_PB_API_KEY") | |
#Gets the local IP of the wlan0 interface | |
localip = netifaces.ifaddresses('wlan0')[netifaces.AF_INET][0]['addr'] | |
#Send push | |
pb.push_note("Raspberry Pi IP", localip) | |
#print(localip) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment