I already have a vnc server running for use without a monitor.
Right now im trying to setup a script that will allow me to send myself an email with the Pi's ip address
following this guide:
http://elinux.org/RPi_Email_IP_On_Boot_Debian
I never recieve a email upon startup. Running the program itself replies with
Code: Select all
pi@raspberrypi ~/Code $ sudo python startup_mailer.py
Traceback (most recent call last):
File "startup_mailer.py", line 46, in <module>
split_line_b = ip_lines[2].split()
IndexError: list index out of range
pi@raspberrypi ~/Code $
Google is letting me down on this one. Does anyone have expirence with this
setup? Any input with be appriciated.
Code: Select all
arg='ip route list' # Linux command to retrieve ip addresses.
# Runs 'arg' in a 'hidden terminal'.
p=subprocess.Popen(arg,shell=True,stdout=subprocess.PIPE)
data = p.communicate() # Get data from 'p terminal'.
# Split IP text block into three, and divide the two containing IPs into words.
ip_lines = data[0].splitlines()
split_line_a = ip_lines[1].split()
split_line_b = ip_lines[2].split()
Code: Select all
pi@raspberrypi ~/Code $ ip route list
default via 192.168.0.1 dev wlan0 metric 303
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.103 metric 303
pi@raspberrypi ~/Code $