Both sides previous revisionPrevious revisionNext revision | Previous revision |
dcore:wireless_set-up [2015/05/19 14:09] – [Configure wireless network] sm8ps | dcore:wireless_set-up [2017/09/18 16:19] (current) – [Configure wireless network] sm8ps |
---|
======Setting up Wireless====== | ====== dCore Wireless====== |
| |
A network connection is necessary for down-loading extensions from within dCore. If the computer only has wireless connection then one must set that up from the command line as first thing. Once one has a functional graphical desktop the tools are more comfortable to use. | A network connection is necessary for down-loading extensions from within dCore. If the computer only has wireless connection then one must set that up from the command line as first thing. Once one has a functional graphical desktop the tools are more comfortable to use. |
====Assumptions==== | ====Assumptions==== |
| |
We assume a basic dCore installation, notably with already set-up tce-directory 'tce/' (cf. sample [[dcore:welcome#installations|installations]]). | We assume a basic dCore installation, notably with already set-up tce-directory 'tce/' (cf. sample [[dcore:installations|installations]]). |
| |
====Import extensions==== | ====Import extensions==== |
Setting up dCore on a computer without Ethernet connection, wireless extensions must be "side-loaded" into the tce-directory, that is the down-load must be performed from another installation. | Setting up dCore on a computer without Ethernet connection, wireless extensions must be "side-loaded" into the tce-directory, that is the down-load must be performed from another installation. |
| |
Down-load all the 'wireless*' files from the 'sce/'-folder at the [[http://tinycorelinux.net/dCore/x86/release/ub-dCore-trusty/sce/|download repository]] into 'tce/sce'. If you need [[http://en.wikipedia.org/wiki/NDISwrapper|NDISwrapper]] for using Windows-drivers then also down-load those files. | Down-load all the 'wireless*' files from the 'sce/'-folder at the [[http://tinycorelinux.net/dCore/x86/release/dCore-trusty/sce/|download repository]] into 'tce/sce'. If you need [[http://en.wikipedia.org/wiki/NDISwrapper|NDISwrapper]] for using Windows-drivers then also down-load those files. |
| |
//wireless-<KERNEL>-tinycore.sce// consists of drivers for wireless radios whereas //wireless// consists of the necessary utilities like 'iwconfig' etc. | //wireless-<KERNEL>-tinycore.sce// consists of drivers for wireless radios whereas //wireless// consists of the necessary utilities like 'iwconfig' etc. |
==From within dCore== | ==From within dCore== |
| |
If you have a function network connection then launch ''sce-import'' for //wireless//, //wireless-<KERNEL>-tinycore// and, if applicable, //ndis-wrapper-modules-<KERNEL>-tinycore//. | If you have a functional network connection then launch ''sce-import'' for //wireless//, //wireless-<KERNEL>-tinycore// and, if applicable, //ndis-wrapper-modules-<KERNEL>-tinycore//. |
| |
| |
====Configure wireless network==== | ====Configure wireless network==== |
| |
<IF> stands for the wireless interface name (e.g. "wlan0"); it can be determined by issueing ''iwconfig''. The recommended way to go about establishing a wireless network connection is by using 'wifi.sh'; only more complex situations should necessitate the manual calling of 'wpa_supplicant'. | Let <IF> denote the wireless interface name (e.g. "wlan0"); it can be determined by issueing ''iwconfig''. The recommended way to go about establishing a wireless network connection is by using 'wifi.sh'; only more complex situations should necessitate the manual calling of 'wpa_supplicant'. |
| |
=== Using 'wifi.sh' === | === Using 'wifi.sh' === |
| |
*Optional step for determining the available wireless networks: issue ''sudo iwlist scanning | less'' and search for "ESSID" | *Optional step for determining the available wireless networks: issue ''sudo iwlist scanning | less'' and search for "ESSID" |
*Create a file '/etc/wpa_supplicant /wpa_supplicant.conf' to contain the following and ''chmod'' it to 600-permissions. | *Create a file '/etc/wpa_supplicant.conf' to contain the following and ''chmod'' it to 600-permissions. |
<code> | <code> |
network={ | network={ |
} | } |
</code> | </code> |
| |
| Alternatively, one may use 'wifi.sh' which will create the file with the password hashed. The clear-text password is commented out and may be deleted. |
| |
== Set-up key file by use of WPA-cli== | == Set-up key file by use of WPA-cli== |
| |
| Alternatively, the key file may be generated by use of the configuration tool WPA-cli. |
Following the excellent presentation in the [[https://wiki.archlinux.org/index.php/WPA_supplicant|Archlinux wiki]], this procedure will automate the writing of the configuration file by use of the semi-interactive tool 'wpa_cli'. It has quite an impressive list of features and probably can be helpful in many kinds of situations; ''wpa_cli --help'' gives a complete list of available commands. | Following the excellent presentation in the [[https://wiki.archlinux.org/index.php/WPA_supplicant|Archlinux wiki]], this procedure will automate the writing of the configuration file by use of the semi-interactive tool 'wpa_cli'. It has quite an impressive list of features and probably can be helpful in many kinds of situations; ''wpa_cli --help'' gives a complete list of available commands. |
| |
In order to use WPA-cli, a control interface must be specified for WPA-supplicant, and it must be given the rights to update the configuration. Do this by creating a minimal configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' with 600-permissions. | In order to use WPA-cli, a control interface must be specified for WPA-supplicant, and it must be given the rights to update the configuration. Do this by creating a minimal configuration file '/etc/wpa_supplicant.conf' with 600-permissions. |
| |
<code> | <code> |
| |
<code> | <code> |
sudo wpa_supplicant -B -i <IF> -c /etc/wpa_supplicant/wpa_supplicant.conf | sudo wpa_supplicant -B -i <IF> -c /etc/wpa_supplicant.conf |
sudo wpa_cli | sudo wpa_cli |
</code> | </code> |
set_network 0 psk "<YOUR_PASSWORD>" | set_network 0 psk "<YOUR_PASSWORD>" |
</code> | </code> |
| NB: the hyphens around the strings are mandatory! |
| |
Connect to the network and save the configuration | Connect to the network and save the configuration |
| |
==Connect to the network== | ==Connect to the network== |
<code> | <code> |
sudo wpa_supplicant -i <IF> -c /etc/wpa_supplicant/wpa_supplicant.conf & | sudo wpa_supplicant -i <IF> -c /etc/wpa_supplicant.conf & |
</code> | </code> |
connects to the network (possibly a driver has to be specified; try ''-D wext'' if the command should fail with an error message about the standard driver nl80211; cf. ''wpa_supplicant --help''). ''iwconfig'' will then show the connection. | connects to the network. ''iwconfig'' should then show the connection. |
| |
<code> | <code> |
sudo udhcpc -b -i <IF> -x hostname <HOSTNAME> -p /var/run/udhcpc.wlan0.pid' | sudo udhcpc -b -i <IF> -x hostname <HOSTNAME> -p /var/run/udhcpc.<IF>.pid' |
</code> | </code> |
acquires a DHCP-lease. 'ifconfig' will then show the IP-address as "inet addr". | acquires a DHCP-lease. 'ifconfig' should then show the IP-address as "inet addr". |
| |
Pinging any IP-address should work now. | Pinging any IP-address should work now. |
==Persistence== | ==Persistence== |
| |
The configuration file can be made persistent by adding "/etc/wpa_supplicant/wpa_supplicant.conf" to '/opt/bootlocal.sh' and issue ''backup''. | The configuration file can be made persistent by adding "/etc/wpa_supplicant.conf" to '/opt/.filetool.lst' and issueing ''backup''. |
| |
Note that the folder '/etc/wpa_supplicant' will be mounted from the wireless extension as an overlay-filesystem, though that does not interfere with the configuration file. | Note that the folder '/etc/wpa_supplicant' will be mounted from the wireless extension as an overlay-filesystem, though that does not interfere with the configuration file. |
| |
<code> | <code> |
/sbin/wpa_supplicant -B -i <IF> -c /etc/wpa_supplicant/wpa_supplicant.conf | /sbin/wpa_supplicant -B -i <IF> -c /etc/wpa_supplicant.conf |
/bb/udhcpc -b -i <IF> -x hostname $(hostname) -p /var/run/udhcpc.wlan0.pid | /bb/udhcpc -b -i <IF> -x hostname $(hostname) -p /var/run/udhcpc.<IF>.pid |
</code> | </code> |
If Syslog is running, one may want to add the option ''-s'' for WPA-supplicant and ''-S > /dev/null 2>&1'' for UDHCP-client. | If Syslog is running, one may want to add the option ''-s'' for WPA-supplicant and ''-S > /dev/null 2>&1'' for UDHCP-client. |
| |
Once a graphical desktop is available, the installed extensions (//wireless//, //wireless-<KERNEL>-tinycore// and, if applicable, //ndis-wrapper-modules-<KERNEL>-tinycore//) provide a menu item (for instance in Wbar and the entry "Wifi" in the applications section of the Flwm-menu). It will launch 'wifi.sh' in a terminal window, while accessing the same database of credentials in '~/wifi.db'. | Once a graphical desktop is available, the installed extensions (//wireless//, //wireless-<KERNEL>-tinycore// and, if applicable, //ndis-wrapper-modules-<KERNEL>-tinycore//) provide a menu item (for instance in Wbar and the entry "Wifi" in the applications section of the Flwm-menu). It will launch 'wifi.sh' in a terminal window, while accessing the same database of credentials in '~/wifi.db'. |
| |
| ===== Trouble-shooting ===== |
| If ''wifi.sh'' takes a long time trying to connect to the network, it will eventually hit a time-out and then continue with ''udhcpc'' which won't succeed either, naturally. |
| A useful first step for localizing the cause of trouble is the manual configuration as outlined above. ''wpa_supplicant'' prints out debug-messages with the ''-d'' option (or even ''-dd''). |
| |
| ==== Driver of wpa_supplicant ==== |
| For older wireless hardware (e.g. Intel PRO/Wireless 2100), the modern driver nl80211 (user space, i.e. the one of wpa_supplicant, not the kernel driver) may need to be replaced. Try ''-D wext'' if the command should fail with an error message about the standard driver nl80211 (cf. ''wpa_supplicant –h'' or also the [[https://wiki.archlinux.org/index.php/WPA_supplicant#nl80211_driver_not_supported_on_some_hardware|respective section]] of the Archlinux-Wiki). |
| |
| === Persistence === |
| Unfortunately, there is no way to specify the driver in 'wpa_supplicant.conf'. Thus one has to either manually call 'wpa_supplicant' with the ''-D wext'' option; or one may patch the file 'wifi.sh'. For the latter, follow these steps: |
| - Load the ''wireless'' extension |
| - Copy the file '/tmp/tcloop/wireless/usr/local/bin/wifi.sh' aside |
| - Re-boot |
| - Do //not// load the ''wireless'' extension yet! |
| - Move 'wifi.sh' to '/usr/local/bin/'. |
| - Add the option ''-D wext'' to line 113 containing the call to 'wpa_supplicant' |
| - Add "usr/local/bin/wifi.sh" to '/opt/.filetool.lst' |
| - Issue ''backup'' |
| From then on, 'wifi.sh' will call 'wpa_supplicant' with the desired driver. |
| |
| **[[http://wiki.tinycorelinux.net/dcore:welcome|> Return to the dCore Wiki Welcome page]]** |