Notices


Reply
Thread Tools
Posts: 169 | Thanked: 56 times | Joined on Jan 2010 @ Italia
#31
Hi guys, nice app!

I'm trying the best way to starting/stopping after network connection/disconnection. Moreover it would be nice to send messages to multiple IPs : home, work, etc.

Last edited by cipper; 2010-10-31 at 19:45.
 
antezz's Avatar
Posts: 172 | Thanked: 160 times | Joined on Jan 2010 @ Sweden
#32
@cipper Growl supports forwarding notifys to other PCs
 
Posts: 169 | Thanked: 56 times | Joined on Jan 2010 @ Italia
#33
Originally Posted by antezz View Post
@cipper Growl supports forwarding notifys to other PCs
I don't need growl since I'm runing on debian/ubuntu. Plus I prefer to to not open ports from wan on the firewall.
 
Posts: 169 | Thanked: 56 times | Joined on Jan 2010 @ Italia
#34
I tried with these up/down scripts for automatic run/stop:

N900:/etc/network# cat if-pre-up.d/00_notifier_up
#!/bin/sh

MYIP=`ifconfig -a wlan0 | grep "inet addr" | sed 's/inet addr://g' | awk '{print $1}'`

if [ "$MYIP" == "192.168.0.5" ]
then su user -c /home/user/bin/notifier_client_home.py &
else su user -c /home/user/bin/notifier_client_work.py &
fi

N900:/etc/network# cat if-post-down.d/00_notifier_down
#!/bin/sh

PIDS=`ps | grep "notifier_client" | grep "/home/user/bin" | awk '{ORS=" ";print $1}'`
for i in $PIDS ; do kill -9 $i ; done

N900:/etc/network#



these work fine when executed in terminal but dont work automatically on network connection/disconnection

Last edited by cipper; 2010-10-31 at 20:19.
 
Posts: 334 | Thanked: 45 times | Joined on Jan 2010
#35
Okay Im not sure what ive done wrong but this is the error message I get



I hope someone can help. I am trying to get this to work with windows.
 
Posts: 71 | Thanked: 88 times | Joined on Dec 2009
#36
Originally Posted by badboyuk View Post
Okay Im not sure what ive done wrong
It means that the variable HOST has not be set. Have you got the latest client.py and did you put the desktop pc ip address in?

Code:
HOST, PORT = "192.168.0.1", 50007
 
Posts: 334 | Thanked: 45 times | Joined on Jan 2010
#37
Originally Posted by Cas07 View Post
It means that the variable HOST has not be set. Have you got the latest client.py and did you put the desktop pc ip address in?

Code:
HOST, PORT = "192.168.0.1", 50007
Yeah I did, I changed it in the place where it was marked.

Server.py

# Change this to your computer's hostname
# We might do this automatically in the future!
HOST, PORT = "192.168.0.1", 50007

I changed it to this:

# Myhostname# We might do this automatically in the future!
HOST, PORT = "192.168.0.2", 50007

And i changed the port to my static ip to which i have forwarded the port.


client.py

# CHANGE THE HOSTNAME TO THE HOSTNAME OR IP OF THE PC RUNNING THE SERVER COMPONENT
HOST, PORT = "192.168.0.1", 50007

changed it to:



# Myhostname, PORT = "192.168.0.2", 50007

Last edited by badboyuk; 2010-10-31 at 20:37.
 
antezz's Avatar
Posts: 172 | Thanked: 160 times | Joined on Jan 2010 @ Sweden
#38

Windows XP working example.

@badboyuk
That looks strange, line 85? client.py is only around 68 lines.
Try use a clean/original client.py file then change the IP to your desktop/servers internal IP.

After that you just take the server.py also change the IP to your internal IP in my case it was "192.168.0.199" then you go to line 62 and replace it with the line i posted previous, or you can change it however you want it to be formated. Thats pretty much it if you want to have "custom names" showed up on some numbers then you add them "numbers" varibel in the client.py just like the examples.
 
Posts: 334 | Thanked: 45 times | Joined on Jan 2010
#39
Originally Posted by antezz View Post

Windows XP working example.

@badboyuk
That looks strange, line 85? client.py is only around 68 lines.
Try use a clean/original client.py file then change the IP to your desktop/servers internal IP.

After that you just take the server.py also change the IP to your internal IP in my case it was "192.168.0.199" then you go to line 62 and replace it with the line i posted previous, or you can change it however you want it to be formated. Thats pretty much it if you want to have "custom names" showed up on some numbers then you add them "numbers" varibel in the client.py just like the examples.
Okay ive done it all again but still the same error. And there are still over 80 lines even as default, and I downloaded the file again from the site.
Im not sure what it is that im not doing right here......any suggestions?
 
Posts: 71 | Thanked: 88 times | Joined on Dec 2009
#40
Originally Posted by badboyuk View Post
client.py

# CHANGE THE HOSTNAME TO THE HOSTNAME OR IP OF THE PC RUNNING THE SERVER COMPONENT
HOST, PORT = "192.168.0.1", 50007

changed it to:

# Myhostname, PORT = "192.168.0.2", 50007
That line should read:

Code:
HOST, PORT = "192.168.0.2", 50007
Putting a # in front of any line, comments the line out and would explain why the script would not work.
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:48.