updated netbook and wifi config

This commit is contained in:
Philip Sargent 2023-07-04 17:41:05 +01:00
parent af957ae839
commit be757d6bdc

View File

@ -37,15 +37,19 @@ still upright and have not been knocked sideways.
<p>If you are not actively using the internet, the Gasthof system will close the connection after a few minutes and you will have to re-login again, typing the password into the login page.
<h3>The potato hut wifi</h3>
<p>The potato hut wiFi has <a href="https://www.howtogeek.com/334935/what-is-an-ssid-or-service-set-identifier/">SSID</a> "tattyhut" with our usual cavey:beery password. Like almost every other wifi anywhere it is running DHCP and allocating IP addresses to your device.
<p>The DHCP system is issuing IP4 addresses of the form <samp>192.168.200.x</samp> where x is a number between 50 and 199
with a lifetime of 12 hours (the backup router, the tp-link WRT41N, issues addresses of the form <samp>192.168.250.x</samp> instead).
<p>The <em>Expo laptops</em> acquire a dynamic local address of this form, as does any other laptop or phone connecting to this wifi.
<p>The potato hut wiFi has <a href="https://www.howtogeek.com/334935/what-is-an-ssid-or-service-set-identifier/">SSID</a> "potatohut" with our usual cavey:beery password. Like almost every other wifi anywhere it is running DHCP and allocating IP addresses to your device.
<p>The DHCP system is issuing IP4 addresses of the form <samp>192.168.200.x</samp> or <samp>192.168.250.x</samp> where x is a number between 50 and 199
with a lifetime of 12 hours. (The Netgear router uses <samp>192.168.200.x</samp> and the tp-link WRT41N router iuses <samp>192.168.250.x</samp>.
In 2023 we are using the tp-link router.)
<p>The <em>Expo laptops</em> acquire a dynamic local address of this form,
as does any other laptop or phone connecting to this wifi. (Apart from Crowley, which has a reserved address of <samp>192.168.z.200</samp>.)
<h3>How it works - in words</h3>
<p>The <a href="https://en.wikipedia.org/wiki/Acer_Aspire_One">Acer Aspire One</a> netbook is running Debian Linux operating system with the lightweight <a href="https://xfce.org/">[xfce]</a> window mananger. It runs a script once every 60s which checks whether it can access the internet. If it can't, it attempts a re-login to the Gasthof wifi system, which takes 5-10 seconds. If it still can't access the internet it deletes nearly all the configuration and reloads everything - which takes about 30s. The mere fact that it accesses the internet every minute is enough for the Gasthof system to keep the connection open - until it times out completely which it does after an hour or so.
<p>The <a href="https://en.wikipedia.org/wiki/Acer_Aspire_One">Acer Aspire One</a> netbook is running Debian Linux operating system
(<em>Buster</em> oldstable v10.13 in 2023)
with the lightweight <a href="https://xfce.org/">[xfce]</a> window mananger. It runs a script once every 60s which checks whether it can access the internet. If it can't, it attempts a re-login to the Gasthof wifi system, which takes 5-10 seconds. If it still can't access the internet it deletes nearly all the configuration and reloads everything - which takes about 30s. The mere fact that it accesses the internet every minute is enough for the Gasthof system to keep the connection open - until it times out completely which it does after an hour or so.
<p>The <str>used</str> scripts on the netbook live in <var>/root/fakenet</var> so that the cron job (running as root) can access them and things work even if /home is not monted. [This is not the usual Linux place to keep such things.] The cron file lives in the usual place in <var>/etc/cron/cron.d/fakenet</var>.
<p>The <str>used</str> scripts on the netbook live in <var>/root/fakenet</var> so that the cron job (running as root) can access them and things work even if /home is not mounted. [This is not the usual Linux place to keep such things.] The cron file lives in the usual place in <var>/etc/cron/cron.d/fakenet</var>.
Ignore the backup copy in /home/expo/fakenet.
<p>When the netbook powers up, the script <var>/etc/init.d/fakenet</var> runs which sets everything going for the first time.
@ -60,21 +64,29 @@ Ignore the backup copy in /home/expo/fakenet.
<br><figcaption>TL-WR841N sockets and switches</figcaption>
</figure>
<p>In 2023 we also have a backup wifi/router in Austria, a <a href="https://www.expertreviews.co.uk/tp-link/1401766/tp-link-tl-wr841n-review">TL-WR841N</a> belonging to Wookey which is configured identically to the Netgear device except that the username is 'root' not 'admin'. It would be good to test this so we could give ARM their WNDR4000 back, and the TP-link router can become expo's.
<p>In 2023 we have an alternative wifi/router in Austria, a <a href="https://www.expertreviews.co.uk/tp-link/1401766/tp-link-tl-wr841n-review">TL-WR841N</a> belonging to Wookey which is configured identically to the Netgear device except that the username is 'root' not 'admin'. It would be good to test this so we could give ARM their WNDR4000 back, and the TP-link router can become expo's.
<p>One important difference is that the ethernet cable from the netbook is plugged into the blue socket on the WR841N (it is yellow on the Netgear), and the 4 white sockets on the Netgear are 4 yellow sockets on the WR841N. A word of warning: the WR841N has been flashed with new firmware (openWRT) and so any documentation you may read in online manuals for it will be wrong: notably the reset and wifi on/off buttons don't have any effect, and the lights don't flash in the way the manuals say they do. There is also no USB socket, no 5Ghz, slower ethernet (100Mbps not 1Gbps) and the wifi range out to the tents is probably worse than the Netgear wifi.
<h4>Alfa wifi device</h4>
<p>The Alfa AWUS036ACH is a high-power external wifi aerial to connect across the campsite to the gasthof. It uses the Realtek RTL8812AU chipset. Annoyingly this does not have a mainline kernel driver so we have to use a dkms driver '8812au'. This is not properly debianized so if you upgrade the kernel on the aspire it has to be rebuilt. The source and the rebuild scripts are in /home/expo/alfa-driver/morrownr. installing the kernel headers for the runing kernel, then running <tt>/home/expo/alfa-driver/morrownr/install-driver.sh NoPrompt</tt> will update it.
<p>I recommend not updating the kernel for the duration of expo. We are getting 25-30 Mbit/s download speed with this device at the Acer Aspire netbook (3 July 2023).
<p>The Alfa AWUS036ACH is a high-power external wifi aerial to connect across the campsite to the gasthof.
It uses the Realtek RTL8812AU chipset.
Annoyingly this does not have a mainline kernel driver so we have to use a dkms driver '8812au'.
This is not properly debianized so if you upgrade the kernel on the aspire it has to be rebuilt.
The source and the rebuild scripts are in /home/expo/alfa-driver/morrownr.
Installing the kernel headers for the runing kernel,
then running <tt>/home/expo/alfa-driver/morrownr/install-driver.sh NoPrompt</tt> will update it.
<p>I recommend not updating the kernel for the duration of expo.
We are getting 15-30 Mbit/s download speed with this device at the Acer Aspire netbook (3 July 2023).
<h4>IP6</h4>
<p>While you can use 5Ghz wifi and IP6 to connect within the hut, there is no IP6 connectivity to the external internet. Sorry. We are dependent on the Gasthof system for this. Use a phone and data roaming if you want it.
<p>While you can use 5Ghz wifi and IP6 to connect within the hut (if the Netgear router is being used),
there is no IP6 connectivity to the external internet. Sorry. We are dependent on the Gasthof system for this. Use a phone and data roaming if you want it.
<h3>4 different 'networks'</h3>
<p>To understand how the network is configured, you need to realise that we have to manage these different 'networks':
<ul>
<li><samp>192.168.2.x</samp> The Gasthof wifi network
<li><samp>192.168.200.x</samp> The potato hut wifi network
<li><samp>192.168.200.x</samp> The potato hut wifi network (or <samp>192.168.250.x</samp>)
<li><samp>10.0.1.x</samp> The network on the short bit of cable connecting the netbook with the Netgear box.
<li>The network on the longer length of cable connecting the Netgear box with the <var>expo laptop</var> (and sometimes the printer).
</ul>
@ -89,7 +101,7 @@ We bridge the hut wifi with the hut ethernet cable to the <var>expo laptop</var>
<p>We have done this in two different ways:
<ol>
<li>2017-2019 : in the netbook.
<li>2022 : in the router (Netgear or tp-link) box.
<li>2022-2023 : in the router (Netgear or tp-link) box.
</ol>
<p>1. The benefit of doing it in the router box is that you get to play with a graphical web interface not text files. But also you can test that the Netgear box is working separately from everything else.
<p>2. The benefit of doing it in the netbook is that all the configuration is in the same place, and you only have to learn one way of doing things instead of having to use text files <em>and</em> a web interface. Also, by making the Netgear box completely dumb, it is swap-replaceable if it dies with no reconfiguration required.
@ -105,6 +117,11 @@ We bridge the hut wifi with the hut ethernet cable to the <var>expo laptop</var>
plugged into a USB socket, and the netbook's ethernet cable socket (eth0) which is configured to have the address <samp>10.0.1.2</samp>.
wlan0 on the netbook is the internal wifi.
<p>The netbook also has a defunct interface 'wlan0' which is the internal wifi which is broken and unused.
However it can cause configuration problems (notably for the first few days of expo 2023). These are the runes to type on the netbook to stop it interfering:
<pre><code>sudo ip addr add 10.0.42.1/24 dev wlan0
sudo ip addr del 10.0.1.1/24 dev wlan0</code></pre>
<p>The Netgear box has its yellow ethernet cable socket set to the address <samp>10.0.1.1</samp>. The four other ethernet sockets are all on the address range <samp>192.168.200.x</samp> and the wifi network interface is set to <samp>192.168.200.1</samp> also in the network <samp>192.168.200.x</samp>.
<p>So the ethernet cable between the Netgear box and the netbook is <samp>10.0.1.1</samp> at the Netgear end and <samp>10.0.1.2</samp> at the netbook end. Nothing else uses any number like <samp>10.0.1.x</samp>.
@ -123,9 +140,7 @@ the black WiFi antennae on the small black Alfa box are still upright and have n
<p>Test whether the netbook is actually running and responding by sitting at the <var>expo laptop</var> and logging into the netbook remotely. Do this in a terminal window:
<pre><code>ssh expo@tclaspire3.potatohut</code></pre>
or
<pre><code>ssh expo@10.0.1.2</code></pre>
(The last of these may not actually work: this is a non-routable IP address.)
<p>If you get a login prompt, the netbook is running. It is a slow machine so do not expect this to be instant.
<p>Login to the netbook (as user 'expo' using the cavey:beery password) and type this at a prompt:
<pre><code>/root/fakenet/runfakenet</code></pre>
@ -245,10 +260,10 @@ ${base}/${config}/gasthoflogin
<h4>Other vital configuration bits</h4>
<p>The file that configures the wifi, if it is not managed by the Netgear box and its web control panel, is the file <var>/root/fakent/expo/hostapd.conf</var>
<p>The file that configures the wifi, but only when it is not managed by the Netgear box and its web control panel, is the file <var>/root/fakent/expo/hostapd.conf</var>
<pre><code>interface=wlan0
driver=nl80211
ssid=tattyhut
ssid=potatohut
hw_mode=g
channel=1
macaddr_acl=0
@ -372,7 +387,7 @@ someone does a debian upgrade. The scripts use the <a href="https://wiki.debian.
<h2>Historical Notes</h2>
<p>Prior to 2017 we used to run an unconnected local network with our own DNS domain
name "potato.hut", our own server holding all the website and survey data, and published WiFi as SSID "tattyhut".
name "potato.hut", our own server holding all the website and survey data, and published WiFi as SSID "potatohut".
Updates to the rest of the world were done by taking an up-to-date laptop which had been in
the tatty hut to a real internet connection and
pushing the changes to the distributed version control system on
@ -385,9 +400,15 @@ the Gasthof. We continued with the wifi service in the hut but now it also conne
<p>In 2018 and 2019 we had good Internet access at basecamp, but the high-gain system (old Alfa) was returned to its owner (Sam) during Covid (2020-21). Wookey bought a new one, which proved to not live up to its advertising.
<p>In 2022 Wifi reception from the Gasthof was very poor. The connection script was improved so that dropped connections were restored more quickly. However the basic bandwidth with the new cheap antenna was not enough.
<p>In 2023 a new Wifi device (the new Alfa) should restore decent connectivity. We hope this will improve everything to how it was in 2019. However this new Alfa has proved to be a right bastard to find the right drivers for. Wookey has had to be inventive in using an Ubuntu PPA to make it work with the Acer Aspire 1.
<p>During winter 2023/23 Wookey upgraded the operating system on the Acer Aspire One netbook
from the ancient Debian Wheezy it had been running to a decently almost-modern Debian distribution. This required much coaxing.
<p>In 2023 a new Wifi device (the new Alfa) has restored decent connectivity: this is an external USB wifi which plugs into the netbook.
We hope this will improve everything to how it was in 2019.
However this new Alfa has proved to be a right bastard to find the right drivers for and
Wookey has had to be inventive in using an Ubuntu PPA to make it work with the netbook. Also
some ancient configuration of the (dead and unused) internal wifi system on the netbook caused 2 solid days of work early in the 2023 expo.
<p>Also during winter 2023/23 Wookey upgraded the operating system on the Acer Aspire One netbook from the ancient Debian Wheezy it had been running to a decently almost-modern Debian distribution. This required much coaxing.
<h4>History of the scripts</h4>
<p>The structure of the system was created by Wookey in 2013 who used the fakenet principle and the netbook to run training sessions in caving huts with no internet connection for the Cave Survey Group in the UK. [This is why the script has an extra level of parameter setting that might seem unnecessary: it has 'csg' and 'expo' options, but the two configurations have diverged so much over the years that this is merely a fossil.]