<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Alex Sleat &#187; fail</title>
	<atom:link href="https://alexsleat.co.uk/tag/fail/feed/" rel="self" type="application/rss+xml" />
	<link>https://alexsleat.co.uk</link>
	<description>/home/alex</description>
	<lastBuildDate>Wed, 20 Jun 2012 11:02:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Ubuntu Disconnecting from Wi-Fi and Failing to Reconnect.</title>
		<link>https://alexsleat.co.uk/2010/11/05/ubuntu-disconnecting-from-wifi-and-failing-to-reconnect/</link>
		<comments>https://alexsleat.co.uk/2010/11/05/ubuntu-disconnecting-from-wifi-and-failing-to-reconnect/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 09:43:57 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[blog1]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[10.10]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[disconnected]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[isadora]]></category>
		<category><![CDATA[julia]]></category>
		<category><![CDATA[katya]]></category>
		<category><![CDATA[linux mint]]></category>
		<category><![CDATA[lisa]]></category>
		<category><![CDATA[lucid]]></category>
		<category><![CDATA[maverick]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">https://alexsleat.co.uk/?p=6456</guid>
		<description><![CDATA[<br/><p> I have an updated fix for this issue using a startup script to connect and a time scheduled script for checking the connection, rather than having one constantly running in the background, avalible here &#8211; https://alexsleat.co.uk/2011/01/09/a-more-elegant-solution-to-ubuntu-wi-fi-reconnecting-issue/ </p> <p>I&#8217;ve been having some trouble with my wifi on Ubuntu recently but I think it&#8217;s because [...]]]></description>
			<content:encoded><![CDATA[<br/><blockquote><p> I have an updated fix for this issue using a startup script to connect and a time scheduled script for checking the connection, rather than having one constantly running in the background, avalible here &#8211; <a href="https://alexsleat.co.uk/2011/01/09/a-more-elegant-solution-to-ubuntu-wi-fi-reconnecting-issue/">https://alexsleat.co.uk/2011/01/09/a-more-elegant-solution-to-ubuntu-wi-fi-reconnecting-issue/</a> </p></blockquote>
<p>I&#8217;ve been having some trouble with my wifi on Ubuntu recently but I think it&#8217;s because I&#8217;m almost out of range of the access point. The problem is that once it disconnects it never seems to be able to reconnect unless wireless is disabled and re-enabled. No doubt there is another way of fixing this issue but it gives me a chance to write my first shell script.</p>
<p>In short the script disables network-manager (it was trying to do things auto which was screwing with things), sets up the connection and connects then checks for a string in the wireless card parameters which will only occur if it&#8217;s disconnected, if the string appears it&#8217;ll disable and re-enable the wireless device which seems to allow it to connect again. If it&#8217;s connected it&#8217;ll wait 3 minutes (180 seconds) before checking again where as if it does disconnect it&#8217;ll check again 30 seconds after it&#8217;s tired rebooting the device. </p>
<p>Here&#8217;s the script, be sure to try it if you&#8217;re having the same problem (you might need to change the wireless device &#8216;wlan1&#8242; to yours) and comment if I&#8217;m doing something wrong or there&#8217;s another way around this, cheers.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re3">#!/bin/bash</span></p>
<p>service network-manager stop</p>
<p>iwconfig wlan1 essid NETWORKNAME<br />
iwconfig wlan1 key NETWORKKEY<br />
ifconfig wlan1 up<br />
dhclient3 wlan1</p>
<p><span class="kw1">while</span> <span class="kw2">true</span>;<br />
<span class="kw1">do</span></p>
<p><span class="kw1">if</span> <span class="br0">&#40;</span>iwconfig wlan1<span class="br0">&#41;</span> | <span class="kw2">grep</span> -o <span class="st0">&quot;Access Point: Not-Associated&quot;</span><br />
<span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ifconfig wlan1 down<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;not connected, rebooting Wifi&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ifconfig wlan1 up<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">sleep</span> <span class="nu0">30</span><br />
<span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;connected&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">sleep</span> <span class="nu0">180</span><br />
<span class="kw1">fi</span></p>
<p><span class="kw1">done</span></div>
]]></content:encoded>
			<wfw:commentRss>https://alexsleat.co.uk/2010/11/05/ubuntu-disconnecting-from-wifi-and-failing-to-reconnect/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
