WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Attempt to connect to wifi indefinitely??  (Read 1572 times)

Offline mb0

  • Jr. Member
  • **
  • Posts: 86
Attempt to connect to wifi indefinitely??
« on: February 03, 2013, 08:59:25 PM »
I have a headless system that is essentially useless without wifi, but with the default script it rarely connects without manually re-running ('no lease, failing'), which would require a reboot.

How can i make the wifi.sh script indefinitely attempt to connect to wifi, or at least a large number of tries (eg 99) before giving up?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11515
Re: Attempt to connect to wifi indefinitely??
« Reply #1 on: February 03, 2013, 09:10:22 PM »
Maybe you can call the wifi script in a loop using something like:
http://forum.tinycorelinux.net/index.php/topic,14731.msg83695.html#msg83695
Replace the echo line with a call to wifi.sh.

Offline mb0

  • Jr. Member
  • **
  • Posts: 86
Re: Attempt to connect to wifi indefinitely??
« Reply #2 on: February 03, 2013, 11:17:01 PM »
Thanks rich, that works if i run bootlocal.sh manually, but it doesn't seem to automatically on boot :?

How do i get the script to echo into the console for debugging? or should it be doing that anyway??

If i want to get the network to automatically try to reconnect if it loses connection, what is the best way to handle that.. just make the loop never end??

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11515
Re: Attempt to connect to wifi indefinitely??
« Reply #3 on: February 03, 2013, 11:51:16 PM »
Hi mb0
Quote
If i want to get the network to automatically try to reconnect if it loses connection, what is the best way to handle that.. just make the loop never end??
You might consider monitoring  /sys/class/net/wlan0/carrier  to check if you are connected.