[XPERIA X8 Android Development] AnDyX:
I will try write here some steps to find problem with WifiTether.

Prerequisites:

- modules v003 installed before Wifitether from 1st post was installed,

- started tethering in WifiTether and tethering does not works.

1. check loaded modules using 'lsmod' command. Wifitether automatically load needed modules and there is no need to load it manually. The most important - related to Wifi itself - are listed below:

tiwlan_drv 950068 0 - Live 0xbf2b8000
sdio 20724 1 tiwlan_drv, Live 0xbf04a000

2. check dmesg log. look for lines looks like:

TIWLAN: driver init
wlan0 (): not using net_device_ops yet
TIWLAN: 3615.699570: pInitParams->RoamingScanning_2_4G_enable

TIWLAN: 3616.521953: CHIP VERSION... set 1273 chip top registe

TIWLAN: 3616.524516: Working on a 1273 PG 2.0 board.
TIWLAN: 3616.529490: Starting to process NVS...
TIWLAN: 3616.536121: NVS found, EEPROM Image addr=0xc3675a00,

TIWLAN: 3616.543846: Chip ID is 0x4030111.
TIWLAN: 3616.549365: FEM Type 1
TIWLAN: 3616.596136: Firmware successfully downloaded.
TIWLAN: 3616.596735: FW download OK...
TIWLAN: 3616.609716: Firmware successfully downloaded.
TIWLAN: 3616.610295: FW download OK...
TIWLAN: 3616.615428: Firmware successfully downloaded.
TIWLAN: 3616.621245: FW download OK...
TIWLAN: 3616.628886: Firmware successfully downloaded.
TIWLAN: 3616.632166: FW download OK...
TIWLAN: 3616.638861: Firmware successfully downloaded.
TIWLAN: 3616.643106: FW download OK...
TIWLAN: 3616.648941: Finished downloading firmware.
TIWLAN: 3616.653846: Firmware running.
TIWLAN: 3616.683628: Firmware successfully downloaded.
TIWLAN: 3616.683855: FW download OK...
TIWLAN: 3616.684016:
TIWLAN: 3616.684046: -----------------------------------------
---------
TIWLAN: 3616.684590: Driver Version : WiLink_Driver_6.1.0.0.1

TIWLAN: 3616.686341: Firmware Version: Rev 6.1.0.10.314
TIWLAN: 3616.687376: Station ID : 30-17-C8-79-A0-6B
TIWLAN: 3616.687413: -----------------------------------------
---------
TIWLAN: 3616.687453:
TIWLAN: 3616.747761: Interrogate TX/RX parameters
ADDRCONF(NETDEV_UP): wlan0: link is not ready
TIWLAN: 3616.790615: smeSm , CONSOLE:%%%%
S, bssid: 2-0-0-92-9D-88 %%%%

TIWLAN: 3616.790688: %%%%%%% SELF SELECT SUCCESS, bssid: 02.0
%%%

ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
init: untracked pid 3434 exited
wlan0: no IPv6 routers present
TIWLAN: 3628.062616: smeSm , CONSOLE:%%%%
S, bssid: 2-0-0-92-9D-89 %%%%

TIWLAN: 3628.069970: %%%%%%% SELF SELECT SUCCESS, bssid: 02.0

it means that driver was loaded and initialised.

3. check iptables. results should look like:

# iptables -L
iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination
DROP 0 -- anywhere anywhere state INVALID
wireless-tether 0 -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain wireless-tether (1 references)
target prot opt source destination
ACCEPT 0 -- anywhere anywhere state RELATED,ESTAB
LISHED
FIX ME! implement getnetbyaddr() bionic/libc/bionic/stubs.c:372
ACCEPT 0 -- 192.168.2.0/24 anywhere
FIX ME! implement getprotobynumber() bionic/libc/bionic/stubs.c:384
ACCEPT 47 -- anywhere anywhere
DROP 0 -- anywhere anywhere
# iptables -t nat -L
iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
FIX ME! implement getnetbyaddr() bionic/libc/bionic/stubs.c:372
DROP 0 -- 192.168.2.0/24 anywhere

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
FIX ME! implement getnetbyaddr() bionic/libc/bionic/stubs.c:372
MASQUERADE 0 -- 192.168.2.0/24 anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
#

4. check WifiTether configuration:

run following commands:

# [B]cd /data/data/android.tether/conf[/B]
cd /data/data/android.tether/conf
# [B]cat tether.conf[/B]
cat tether.conf
ip.gateway=192.168.2.254
wifi.encryption=open
tether.mode=wifi
ip.netmask=255.255.255.0
tether.fix.persist=true
wifi.txpower=disabled
wifi.interface=wlan0
wifi.setup=wpa_supplicant
wifi.encryption.key=none
wifi.channel=10
ip.network=192.168.2.0
wifi.driver=wext
wifi.essid=AndroidTether
tether.fix.route=false
device.type=shakira
#

the most important things are here:

tether.fix.persist=true
device.type=shakira

5. run tethering manually

stop tethering

and run following commands:

cd /data/data/android.tether/bin
./tether start 1
./tether stop 1

result should look like:

# ./tether start 1
./tether start 1
about to run: [/system/bin/tiwlan_loader -i /etc/wifi/tiwlan.ini -f /etc/wifi/ti
wlan_firmware.bin -e /data/etc/wifi/fw]
Set property wlan.driver.status = ok - Ok
about to run: [/data/data/android.tether/bin/ifconfig wlan0 192.168.2.254 netmas
k 255.255.255.0]
about to run: [/data/data/android.tether/bin/ifconfig wlan0 up]
about to run: [/data/data/android.tether/bin/iwconfig wlan0 mode ad-hoc]
about to run: [/data/data/android.tether/bin/iwconfig wlan0 essid AndroidTether]

about to run: [/data/data/android.tether/bin/iwconfig wlan0 channel 10]
about to run: [/data/data/android.tether/bin/iwconfig wlan0 commit]
Error for wireless request "Commit changes" (8B00) :
SET failed on device wlan0 ; Operation not supported on transport endpoint.
about to run: [/data/data/android.tether/bin/fixpersist.sh wlan0 AndroidTether 1
0 & echo $! > /data/data/android.tether/var/fixpersist.pid]
about to run: [/data/data/android.tether/bin/iptables -N wireless-tether]
about to run: [/data/data/android.tether/bin/iptables -F wireless-tether]
about to run: [/data/data/android.tether/bin/iptables -t nat -F PREROUTING]
about to run: [/data/data/android.tether/bin/iptables -t nat -F POSTROUTING]
about to run: [/data/data/android.tether/bin/iptables -t nat -F]
about to run: [/data/data/android.tether/bin/iptables -A wireless-tether -m stat
e --state ESTABLISHED,RELATED -j ACCEPT]
about to run: [/data/data/android.tether/bin/iptables -A wireless-tether -s 192.
168.2.0/24 -j ACCEPT]
about to run: [/data/data/android.tether/bin/iptables -A wireless-tether -p 47 -
j ACCEPT]
about to run: [/data/data/android.tether/bin/iptables -A wireless-tether -j DROP
]
about to run: [/data/data/android.tether/bin/iptables -A FORWARD -m state --stat
e INVALID -j DROP]
about to run: [/data/data/android.tether/bin/iptables -A FORWARD -j wireless-tet
her]
about to run: [/data/data/android.tether/bin/iptables -t nat -I POSTROUTING -s 1
92.168.2.0/24 -j MASQUERADE]
about to run: [/data/data/android.tether/bin/dnsmasq -i wlan0 --resolv-file=/dat
a/data/android.tether/conf/resolv.conf --conf-file=/data/data/android.tether/con
f/dnsmasq.conf]
script result was []
#
# ./tether stop 1
./tether stop 1
about to run: [/data/data/android.tether/bin/iptables -D FORWARD -j wireless-tet
her]
about to run: [/data/data/android.tether/bin/iptables -D FORWARD -m state --stat
e INVALID -j DROP]
about to run: [/data/data/android.tether/bin/iptables -F wireless-tether]
about to run: [/data/data/android.tether/bin/iptables -X wireless-tether]
about to run: [/data/data/android.tether/bin/iptables -t nat -F PREROUTING]
about to run: [/data/data/android.tether/bin/iptables -t nat -F POSTROUTING]
about to run: [/data/data/android.tether/bin/iptables -t nat -F]
about to run: [/data/data/android.tether/bin/ifconfig wlan0 down]
script result was []

There should be only error regarding 'commit' on Wifi driver.

6. check if there is free channel. Use Wifi Analyzer to verify that channel is free. I noticed that whatever channel I choose - AdHod run at channel 1.

If something comes to my mind I will write it here.