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 Thu 30 Oct 2014, 11:38
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 Posts_count  
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: 431

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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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