Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 23 Nov 2014, 07:08
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to reconnect wifi on waking from hibernation?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
n0ukf


Joined: 14 Feb 2012
Posts: 129

PostPosted: Fri 07 Dec 2012, 13:32    Post subject:  How to reconnect wifi on waking from hibernation?  

How do I get my wifi connection to reconnect automatically after waking from suspended/hibernate mode?
_________________
"Cogito, ergo es. I think, therefore you is." Ray D. Tutto (King of the Moon) to Baron Munschaussen
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 440

PostPosted: Sun 09 Dec 2012, 01:15    Post subject:  

I use shell scripts to connect to wireless instead of using wizards. I would imaging there would be a way to get puppy to execute a script upon resuming.

Code:


#!/bin/sh
# Find our wifi device.
#
WIFI=$(iwconfig  | grep IEEE|awk {'print $1'})

# Bounce wifi device
ifconfig $WIFI down
ifconfig $WIFI up

# Configure for WEP encryption on open/wep network
#
iwconfig $WIFI essid JR-MiFi
iwconfig $WIFI key "s:<<pwd-key>>"
iwconfig $WIFI mode managed
iwconfig $WIFI freq 2.452G
iwconfig $WIFI channel 9

# now to obtain an automatic IP address (DHCP)
# for Puppy 4.0 onwards
rm -f /var/lib/dhcpcd/*.info
rm -f /var/run/*.pid
dhcpcd -t 30 -h Lucid-Puppy -d $WIFI

# Display connection info. (Optional; Rem if unwanted)
#
ipinfo

Back to top
View user's profile Send private message 
n0ukf


Joined: 14 Feb 2012
Posts: 129

PostPosted: Thu 27 Dec 2012, 12:48    Post subject:  

Is this good for any available wifi or just reconnecting to the last one? Can I have a list of previously configured router connections (both open and encrypted) and autoconnect to whichever is available?

Does anyone know how to execute a script on wake?

_________________
"Cogito, ergo es. I think, therefore you is." Ray D. Tutto (King of the Moon) to Baron Munschaussen
Back to top
View user's profile Send private message 
n0ukf


Joined: 14 Feb 2012
Posts: 129

PostPosted: Sun 13 Jan 2013, 00:50    Post subject:  

Okay, ignoring the wake from hibernation for now...

I connect to one open router at home, one at my brother's home, one open but MAC-filtered at work, and have been trying to get connected to a secure one at church (but can't get the AES protocol that's being used there, only TKIP), as well as others. Can I have a list of connections for a connect script to connect to whichever (encrypted or unencrypted) router is available without specifying which myself?

_________________
"Cogito, ergo es. I think, therefore you is." Ray D. Tutto (King of the Moon) to Baron Munschaussen
Back to top
View user's profile Send private message 
chiron


Joined: 30 Oct 2006
Posts: 87
Location: Franken, Bavaria, Germany

PostPosted: Sun 13 Jan 2013, 14:20    Post subject:  

You need to find your suspend.sh file in /etc/acpi/actions.

In this file are all actions that are carried out on suspend.

In my file, it looks like this

Code:

#suspend

/etc/rc.d/rc.network stop
killall wpa_cli
killall dhcpcd-wpagui
killall dhcpcd
killall wpa_supplicant
echo mem > /sys/power/state

# process at recovery from suspend
modprobe ehci_hcd
/etc/rc.d/rc.network
/etc/init.d/50-Wpagui start


I am using fatdog64, but I remember in Lupu it was similar.

WPAGUI seems to be a pretty good way to manage wireless. I don't know whether it is available for a lot of puppies.
Back to top
View user's profile Send private message 
n0ukf


Joined: 14 Feb 2012
Posts: 129

PostPosted: Mon 14 Jan 2013, 13:13    Post subject:  

Will that only reconnect to the last router or also connect to another if I've moved from work to home or wherever while suspended?
_________________
"Cogito, ergo es. I think, therefore you is." Ray D. Tutto (King of the Moon) to Baron Munschaussen
Back to top
View user's profile Send private message 
chiron


Joined: 30 Oct 2006
Posts: 87
Location: Franken, Bavaria, Germany

PostPosted: Mon 14 Jan 2013, 15:15    Post subject:  

since it starts a new instance of wpagui (after the oldone is killed when entering suspend), I suppose that it connects to whatever network is in reach. It usually takes some seconds from flipping the lid open to being connected again.
Back to top
View user's profile Send private message 
n0ukf


Joined: 14 Feb 2012
Posts: 129

PostPosted: Mon 14 Jan 2013, 17:14    Post subject:  

Flipping the lid? All that does here is blank the screen, not suspend. And the power switch only turns it on, not off (except for the long-press hard stutdown) or hibernate. Unless someone can tell me how to fix that on Asus Eee900.
_________________
"Cogito, ergo es. I think, therefore you is." Ray D. Tutto (King of the Moon) to Baron Munschaussen
Back to top
View user's profile Send private message 
chiron


Joined: 30 Oct 2006
Posts: 87
Location: Franken, Bavaria, Germany

PostPosted: Tue 15 Jan 2013, 01:09    Post subject:  

I think you need some kind of acpi-support, and acpi tools. What puppy are you running? I assumed you had figured out suspend and hibernation, sorry.

The script I mentioned also uses acpi.
Back to top
View user's profile Send private message 
n0ukf


Joined: 14 Feb 2012
Posts: 129

PostPosted: Tue 15 Jan 2013, 16:33    Post subject:  

Lucid 528. All I have for suspend right now is a one-line script:
Code:
acpitool -s

with a symlink icon on the desktop that I doubleclick when I want it to sleep.

_________________
"Cogito, ergo es. I think, therefore you is." Ray D. Tutto (King of the Moon) to Baron Munschaussen
Back to top
View user's profile Send private message 
chiron


Joined: 30 Oct 2006
Posts: 87
Location: Franken, Bavaria, Germany

PostPosted: Wed 16 Jan 2013, 11:49    Post subject:  

The Lucid528 should have all the acpi support out of the box, which is good. Looong time ago I set up Lucid 510/520 to do the sleep thing on my thinkpad and that was quite complicated, it involved tinkering with the kernel etc.

You need to find the folder /etc/acpi/events in this folder, there should be some files, among them lid. This file tells the acpi subsystem what to do on closed lid. In my case it points to a script that is located in /etc/acpi/actions, with the name of suspend.sh.

One question though, does your eeepc have a lid switch? Or any means of detecting whether the lid is open or closed? Without it, you naturally won't be able to suspend on lidclose. Maybe you nee dspecial drivers/modules for lid-switch detection for the eeepc, I don't know, don't have one.

When you put your eeepc to sleep by clicking on the symlink, how do you wake up again? Pressing any key? Anyhow, you could put the lines I posted previous in your script, if all else fails.
Back to top
View user's profile Send private message 
n0ukf


Joined: 14 Feb 2012
Posts: 129

PostPosted: Tue 09 Apr 2013, 13:53    Post subject:  

After the
Code:
acpitool -s

I added the
Code:
# process at recovery from suspend
modprobe ehci_hcd
/etc/rc.d/rc.network
/etc/init.d/50-Wpagui start

and now it reconnects to both open and encrypted routers on wake (pressing any key). It must be automatically seeing my settings somewhere.

chiron wrote:
One question though, does your eeepc have a lid switch? Or any means of detecting whether the lid is open or closed? Without it, you naturally won't be able to suspend on lidclose. Maybe you nee dspecial drivers/modules for lid-switch detection for the eeepc, I don't know, don't have one.

It has a magnetic lid switch which used to suspend it under Xandros. Currently with Puppy it only blanks the screen/backlight until I open it again. I'll look for those files you mentioned.

_________________
"Cogito, ergo es. I think, therefore you is." Ray D. Tutto (King of the Moon) to Baron Munschaussen
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0698s ][ Queries: 12 (0.0068s) ][ GZIP on ]