Project

General

Profile

WiFiAdapter » History » Revision 16

Revision 15 (Wolfgang Wiedmeyer, 04/16/2017 08:02 PM) → Revision 16/43 (Wolfgang Wiedmeyer, 04/16/2017 08:03 PM)

h1. Enabling WiFi with an USB WiFi adapter 

 All Replicant-supported devices need non-free firmware to be loaded to make the internal WiFi component work. See the [[Wifi|WiFi research page]] for more information. Free replacements for these non-free firmwares do not yet exist. 

 However, free firmware does exist for WiFi adapters with the AR9271 chipset. Such adapters can be used with a device running Replicant 6.0. A USB OTG (On-The-Go) cable is needed to connect the WiFi adapter to the phone. 

 WiFi adapters work best with the [[GalaxyNote2N7100|Galaxy Note 2]] because of its large battery. Otherwise, the [[GalaxyS3I9300|Galaxy S 3]] works well, while the [[GalaxyS2I9100|Galaxy S 2]] is more unstable and has a smaller battery life. See [[WifiAdapter#Known-issues|known issues]] for more details. 

 h2. Supported WiFi adapters 

 More adapters exist that have the AR9271 chipset than are listed below. The listed adapters are the ones that are known to us. 

 h3. Known to work 

 * "Penguin Wireless N USB Adapter for GNU / Linux (TPE-N150USB)":https://www.thinkpenguin.com/gnu-linux/penguin-wireless-n-usb-adapter-gnu-linux-tpe-n150usb 
 * "Technoethical N150 Mini Wireless USB Adapter":https://tehnoetic.com/adapters/tehnoetic-wireless-adapter-gnu-linux-libre-tet-n150 
 * "Technoethical N150 High Gain Antenna Wireless USB Adapter":https://tehnoetic.com/adapters/tet-n150hga 
 * TP-Link TL-WN722N 

 h3. Should work but not tested 

 * "Penguin Wireless N USB Adapter /w External Antenna for GNU / Linux (TPE-N150USBL)":https://www.thinkpenguin.com/gnu-linux/penguin-wireless-n-usb-adapter-w-external-antenna-gnu-linux-tpe-n150usbl 

 

 h2. WiFi adapter usage 

 Using the WiFi adapter with the RepWifi app is the recommended and most convenient way. 

 It is not possible to configure WiFi connections through the adapter with the pull-down quicksettings or the regular WiFi menu in the settings. These are only meant to work with the internal WiFi component of the device. 

 h3. With the RepWifi app 

 Replicant 6.0 ships with the RepWifi app. [[UsageNotes#Enabling-root-access|Root access for apps]] needs to be enabled to make the app work. 
 
 The app has the following capabilities: 
 * searching for WiFi access points 
 * connecting to WPA/WPA2 secured and unsecured networks 
 * storing network connections (including passwords) 
 * managing stored network connections (viewing and deleting them) 

 "Forum thread about the app and its development":http://redmine.replicant.us/boards/9/topics/14079?r=1410 

 h3. With the WiFi scripts 

 While the RepWifi app should be preferred, use cases might exist where the WiFi scripts yield better results. The scripts were developed before work on the RepWifi app was started. Scripts both for Replicant 6.0 and Replicant 4.2[1] exist. It is unlikely that the WiFi scripts will be improved further as the development focus lies on the RepWifi app. 

 The scripts can be retrieved by cloning the user-scripts repository: 
 <pre> 
 git clone https://git.replicant.us/replicant/user-scripts.git -b replicant-6.0 
 </pre> 

 for Replicant 6.0 and 
 <pre> 
 git clone https://git.replicant.us/replicant/user-scripts.git -b replicant-4.2 
 </pre> 

 for Replicant 4.2. 

 For the next steps, [[ADB]] needs to be set up and [[ADB#Accessing-root-shell|running as root]]. Connect the device to your PC. The scripts are in the @networking/wifi@ folder. Run the setup script the folder to push the scripts to the device: 
 <pre> 
 ./setup.sh 
 </pre> 

 Then disconnect the device and attach the WiFi adapter. Make sure [[UsageNotes#Enabling-root-access|root access for apps]] is enabled. Open a [[UsageNotes#Terminal-emulator|terminal emulator]]. If the terminal is not running as root, you can gain root by running: 
 <pre> 
 su 
 </pre>  

 Navigate to the @data/misc/wifi@ directory and run the script to scan and select the network access point: 
 <pre> 
 bash select_network.sh 
 </pre> 

 After selecting the preferred AP and entering the password (if required), a WiFi connection should be successfully established. 

 "Forum thread about the WiFi scripts and their development":http://redmine.replicant.us/boards/9/topics/13932 (contains some more usage notes, especially for Replicant 4.2) 

 fn1. Replicant 4.2 does not include the required drivers to make these adapters work. Custom kernel images are necessary for Replicant 4.2. The scripts for Replicant 4.2 run services with greater privileges and do not restrict file access as good as the scripts for Replicant 6.0 do, so using them is less secure. 

 

 h2. Known issues 

 The adapter usage causes high battery drain. Frequent usage might result in a shortened lifecycle of the battery and battery damage is possible. 

 It is possible that the adapter is not powered in the case of low battery charge. It is then not possible to use the WiFi adapter until after the next recharge. 

 The displayed battery charge level can be inaccurate and not up-to-date. As the adapter causes an unusually quick battery drain, the actual battery charge level can be a lot lower than what is currently displayed. This can be observed when the phone is rebooted after adapter usage. The displayed level can be a lot lower than before the reboot.  

 The above battery issues especially happen with the Galaxy S 2 (see #1791). 

 [[ReplicantUSBNetworking#Known-issues|Known issues for USB networking]] apply here, too (see #1792).