Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: KHarvey on November 04, 2011, 02:39:43 PM

Title: iwconfig persistence settings
Post by: KHarvey on November 04, 2011, 02:39:43 PM
It took me a while but I was finally able to get my wireless working.  I had an older version of TC that I was using, and when I downloaded the new version it solved most of my worldly wifi issues.
Now I have a working solution, but I am not sure I like how it works, which makes me think that I am not doing it right.

I created a /opt/wlan0.sh file with the following:
Quote
pkill udhcpc
sleep 13
iwconfig wlan0 essid xxx mode managed key xxxx
ifconfig wlan0 up
udhcpc -i wlan0
I then added this file to the filetool.lst so that it would be backed up.

So now I have 2 questions: 
I just don't like using sleeps because I am just adding an arbitrary amount of loading time, I believe I should either check for a process to complete or just load in the proper order.

Any advice?

Once again sorry about the quote's rather than the code, I am not allowed to use code yet as it states I cannot post external links.
Title: Re: iwconfig persistence settings
Post by: gerald_clark on November 04, 2011, 02:45:04 PM
You need to call if from /opt/bootlocal.sh or /opt/bootsync.sh.
Title: Re: iwconfig persistence settings
Post by: KHarvey on November 04, 2011, 03:32:00 PM
Perfect, thank you very much gerald_clark.  wlan0 is actually in bootlocal.sh, not sure how it got there as I did not put it there, but it works for me.  It looks like it is in the right spot as bootlocal.sh is used for processing background commands, while bootsync.sh is used to process boot commands.

So now I am just wondering if there is a better way to handle the sleep problem, as all of the other wlan0.sh scripts that I have seen do not have a wait time in them.  Also I guess I should clarify a little bit on what is happening.  If I do not use the sleep timeout then iwconfig never connects to a WAP, but it is up and has an IP.  I am assuming the IP is a carry over from before the computer was rebooted.
Also I think I have a problem with when the computer goes to sleep it appears to disconnects the wireless.  I'm currently testing this now, as I didn't notice it until I started writing this response.
Title: Re: iwconfig persistence settings
Post by: Rich on November 04, 2011, 08:41:02 PM
Hi KHarvey
If  udhcpc  is actually taking 10 seconds to shut down, you could try using the  nodhcp  boot code.
Title: Re: iwconfig persistence settings
Post by: KHarvey on November 07, 2011, 10:10:53 AM
Thank you so much Rich.  You were actually right it was the pkill udhcpc that was causing the slow down.  So I removed that line and the sleep line and now it works perfectly.

For anyone else it now looks like
Quote
iwconfig wlan0 essid "xxxx" mode managed key xxxx
ifconfig wlan0 up
udhcpc -i wlan0

Once again thank you gerald_clark and Rich for your help.