All you need to connect to a WiFi hotspot is wpa_supplicant, its dependencies, and a DHCP client (udhcpc is included with BusyBox and is therefore already present in the base system).
Just follow 3 easy steps:
Now you are ready to connect to any WiFi hotspot. You can do so manually or use a shell script to help you (e.g., https://github.com/bdantas/autowifi/)
Note: As of Tiny Core Linux 4.x you can probably just use the wpa_gui extension from the appbrowser and start the application from wbar. It will automatically start wpa_supplicant and udhcpc for all found wireless devices.
You should configure your network and choose File → Save Configuration. If you want to automatically restart the WPA wireless connection after reboot, put “/usr/local/etc/init.d/wpa_gui start” to your /opt/bootlocal.sh and put /etc/wpa_gui.conf to your backup. This way it will start wpa_supplicant and udhcpc for your wireless devices with the configured networks. The wpa_gui service can also be en-/disabled from Panel/Services.
Another way to set up a wireless connection is to use wpa_supplicant with it's associated GUI interface. wpa_supplicant is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA Authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wlan driver.
wpa_supplicant is designed to be a daemon program that runs in the background and acts as the backend component controlling the wireless connection. wpa_supplicant supports a text-based frontend (wpa_cli) and a GUI (wpa_gui). See http://hostap.epitest.fi/wpa_supplicant/ for more information.
Install wpa_supplicant and wpa_gui. Then configure wpa_supplicant for remote control by creating a configuration file (this has to be done only once):
Create a configuration file /opt/wpa.cfg with the following content:
ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=staff update_config=1
It's recommended to add this file to your backup, or use a persistent opt.
After creating the configuration file start the wpa_supplicant daemon using the following command and to have wpa_supplicant start every boot, add this to /opt/bootlocal.sh:
wpa_supplicant -Dwext -iwlan0 -c/opt/wpa.cfg -B
Replace wlan0 with the name of your wireless card.
Afterwards, all you need to do to connect to various networks is to run wpa_gui from the menu.
1. Boot tinycore and install the needed wireless packages if you haven't already (if you have an Intel wireless card, you need to install firmware-intel.tcz first, and iwlwifi.tcz if it doesn't install it as a dependency).
| wireless_tools.tcz | gives you iwconfig and other tools | | wireless-`uname -r`-tinycore.tcz | in-kernel wifi drivers | | wpa-supplicant.tcz | wpa_supplicant tool for negotiating secured access points |
If you will be installing to a system that depends on wifi access you may find it easier to pre-download these files and copy them to your tinycore tce directory so that they are installed at boot time (or use tce-load to install them after boot).
2. Check whether you can see your wireless hardware. in the console run: iwconfig
You should see a list of interfaces with some status info. your wireless interface may show up as wlan0 (but maybe ath0 or eth0?). You need to remember the name of this interface as it will be used later
If you don't see a connection, you may need to load or install drivers. The wireless-`uname -r`-tinycore contains all in-kernel wifi drivers. You can verify the drivers are present using something like (assuming Atheros card): modprobe -l | grep ath you should see the ath9k.ko.gz and ath5k.ko.gz device driver files
Verify they are loaded using: lsmod | grep ath
You can use modprobe to temporarily load and unload drivers as needed. For instructions on setting up alternative Atheros drivers, see Network Setup - Atheros Wireless Cards
Before you start, you need to look up your access point id (ssid) and passphrase (a string).
network={ ssid=mynetwork proto=WPA key_mgmt=WPA-PSK pairwise=TKIP group=TKIP psk=f242925f83787084d58101d5eb52485989e2a553983bfe6fc5b8d27fdfa063bd }
Note: This assumes a fairly conventional WPA-PSK setup. If you need to use other security (e.g. WEP) or are connecting to a more sophisticated network you may have to tweak this file. See the wpa_supplicant manual for more info. (What if you connect to more than one WPA-PSK network? You can add as many network sections to the conf file as needed.) save it as /opt/wpa_configure.conf (then to ensure it is persistent in the system, add the line opt/wpa_configure.conf to /opt/.filetool.lst)
Alternately, instead of running netcardconfig you could just issue the udhcpc command, e.g.: udhcpc -i *interface*
Connect to non-secured access point. (Script that displays local Access Points to connect to. Only works with unsecured APs.)
#!/bin/sh - Example usage: - - sudo sh mywifi.sh - - Can automate this stuff by putting into /opt/bootlocal.sh (without the need for sudo) - using cpanel, network autocreates /opt/my* - Determine device name (assume one wifi device; use head, etc. to restrict to first, last...) |wlan=`iwconfig 2>/dev/null |grep IEEE |awk '{print $1}' `| echo $wlan essid=myessid - set wepkey to hex digits, leave blank if no wep-security is used wepkey=deadbeafdeadbeaf echo SID ${essid} if [[ -n "${wep}" ]] then echo WEPKEY $wepkey fi iwconfig ${wlan} iwconfig ${wlan} essid ${essid} if [[ -n "${wep}" ]] then iwconfig ${wlan} enc ${wepkey} iwconfig ${wlan} key ${wepkey} fi iwconfig ${wlan} commit - now setup IP address, route, gateway, etc. - Use DHCP - after netcardconfig and save settings - TC@BOX:~$ cat /opt/eth1.sh - !/bin/sh pkill udhcpc udhcpc -H box -b -i ${wlan}