Running python code when wifi connects - Raspberry Pi Forums


i'm running latest version of raspbian stretch, , have python file run when connect internet. emails ip address of pi, plan on running headless, , way don't need static ip address. have put copy of in both /etc/network/interfaces.if-up.d/ , /etc/dhcp/dhclient-enter-hooks.d/, doesn't run when connect internet.
when

code: select all

sudo ifdown eth0 && sudo ifup eth0
send it.
how can working in raspbian stretch? managed working fine on ubuntu server doing this.

i came cludgy way - wrote python application loops every 30 seconds, checking state of internet connection. it's on github @ https://github.com/michaelcjhurst/internetchecker. this'll now, if there better alternative, please let me know.


raspberrypi



Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'