[script] Bandwidth Test & Network Info - Android General

This script is an adaptation of this post.
Click Me!
No root required for run.
I modify & add some option.
New option:
Limit the test to 10mb (original 100MB )
Added server 2 NL, 1 GB, 4 USA, 1 FR
Get your external IP
Ping average
Arp table
DNS
Interface & ip local
Kernel IP routing table
How to use:
Android Phone with busybox
Download script or copy
Open terminal & go to script directory
For print Usage:​
Code:
sh ./net_tool.sh
Terminal see said:
----Usage: sh ./net_tool.sh your_country.
----Country option: NL/NL2--GB--US/US2/US3/US4--FR
----Exemple for french: sh ./net_tool.sh FR
Click to expand...
Click to collapse
For Use:​
Code:
sh ./net_tool.sh FR
Terminal see said:
Code:
Connecting to 212.27.60.49 (212.27.60.49:80)
Speedfile 100% |*******************************| 8192k 0:00:00 ETA
*******Your IP: XXX.XX.XXX.XXX**********************
*******Average download Speeds:**********
*******0 MB/s
*******409 kB/s [COLOR="Orange"][B]<-- Yes my connection s**k[/B][/COLOR]
*******3 Mb/s
*******Average Time Ping:****************
*******90.912 ms
*******Kernel IP routing table***********
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.0 0.0.0.0 UG 0 0 0 wlan0
0.0.0.0 192.168.0.0 0.0.0.0 UG 307 0 0 wlan0
192.168.0.0 0.0.0.0 255.255.255.0 U 307 0 0 wlan0
192.168.0.0 0.0.0.0 255.255.255.255 UH 0 0 0 wlan0
********ARP******************************
box.home (192.168.1.1) at XX:XX:XX:XX:XX:XX [ether] on wlan0
*********Ifconfig ip interface **********
wlan0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX 192.168.1.333
lo Link encap:Local Loopback 127.0.0.1
********DNS SERVER***********************
[dhcp.wlan0.dns1]: [192.168.0.0]
[dhcp.wlan0.dns2]: []
[dhcp.wlan0.dns3]: []
[dhcp.wlan0.dns4]: []
[net.change]: [net.dns2]
[net.dns1]: [208.67.222.222]
[net.dns2]: [208.67.220.220]
[net.dnschange]: [1]
[net.rmnet0.dns1]: [208.67.222.222]
[net.rmnet0.dns2]: [208.67.220.220]
[net.rmnet1.dns1]: []
[net.rmnet1.dns2]: []
[net.rmnet2.dns1]: []
[net.rmnet2.dns2]: []
[net.wlan0.dns1]: [49.0.0.0]
[net.wlan0.dns2]: []
Done
Click to expand...
Click to collapse
Trouble:​I use ifconfig in script but some android phone use over command / For see tape "busybox" in terminal. This command list available command.

Related

Android with Wifi Thread - Cooler wifi

Update:
handsets are becoming very hot when wifi is used, you can make them use less power by using the rootfs.img provided, changes where made to tiwlan.ini during testing which keeps the wifi on active even when not in use, this version has reverted the changes and now power saving can be used once more.
http://drop.io/coolerwifikaiser
Aims:
Wakelocks?
Looks like this thread has served its purpose
Wow, are you actually doing all of these commands through the phone? >_<
I really want to see wifi rollin on android too, can't wait to load the ol' Tilt up with it.
the '-f' option
Hi,
a short question, you wrote...
Code:
'wpa_supplicant -f -Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf &'
...and I've allready seen this in different ohter posts, but I don't know what the '-f' option effects.
I allready browsed the manpages an this option ins't listed. I just tried the command without this statement and it also worked (but did not create the output '-Dtiwlan0' to '/data/local/tmp'). But wlan also doesn't work...
For Polaris users who might need this info:
First things first, make sure wlan works in Windows Mobile. This seems to be the procedure for getting the wlan into do something in Android. It seems to be very similar to the wifi tethering guides on the G1.
Custom Kernel
We need a kernel, the kernel config produced by make vogue_defconfig ARCH=arm leaves the wireless extensions disabled, so this might the cause of the missing mac address in ifconfig. Current attempts to produce a kernel with these extensions have caused the settings dialogues and ifconfig to hang, Ctrl+C does not force an exit. I'll continue to investigate this.
Tiwlan kernel module
I've found another version of the tiwlan driver, other than the one that is currently in git master which loads the firmware and gives the ok - OK
Download Update: This driver skipped checks, ignore it
so lets see if we can merge this with the newer driver to get a working one.
Initial Variables
Code:
setprop wifi.interface tiwlan0
WLan Commands
Modprobe Method:
Code:
mkdir -p /lib/modules/`uname -r`
cp /sdcard/wlan.ko /lib/modules/`uname -r`/
Insmod Method:
Code:
insmod /sdcard/wlan.ko
Tiwlan0 Mac address: No
Required Output: TIWLAN: Driver loaded
WLAN_Loader
Code:
wlan_loader -f /sdcard/Fw1251r1c.bin -e /proc/calibration -i /sdcard/tiwlan.ini
Tiwlan0 Mac address: No
Required Output: Set property wlan.driver.status = ok - Ok
ifconfig -a might need to show a mac address at this point, i'm still not sure when ifconfig -a gets the mac address info
Code:
wpa_supplicant -ddK -Dtiwlan0 -itiwlan0 -c/sdcard/wpa_supplicant.conf &
ifconfig -a must show a mac address or the next step will error out, you can assign one using the following command, just change it to mac address you see in windows. However simply assigning one with this command might not be enough, it could be the sign of a bigger problem.
Code:
ifconfig tiwlan0 hw ether 00:00:00:00:00:00
Code:
ifconfig tiwlan0 192.168.1.100 netmask 255.255.255.0
ifconfig tiwlan0 up
Log Collecting:
Dmesg - Its a ring buffer so as new info is added old info will be removed, you need to run the command right after insmod or modprobe to see if it worked ok.
Code:
[B]dmesg|grep -i wlan[/B]
TIWLAN: Found SDIO controller (vendor 0x104c, device 0x9066)
TIWLAN: Driver initialized (rc 0)
TIWLAN: 1251 PG [B]1.1[/B]
TIWLAN: Driver loaded
If i'm right The kaiser has 1.1. the G1 has 1.2, its a reference to the chip used.
Logcat
You can run logcat at the start to keep a log of everything the machine has done since android has started. If you run it like this it will keep logging to the file as you run other commands so when you boot back to WM and sync you can open the file in an editor like Notepad++ and see what happened. This is the first thing i run when i get to the root shell
Code:
logcat -f /sdcard/debuglog.txt &
After running the wlan_loader you can run this to check it worked ok:
Code:
[B]grep -i 'wlan' /sdcard/debuglog.txt[/B]
D/wlan_loader( 395): adapter tiwlan0, eeprom /proc/calibration, init /sdcard/tiwlan.ini, firmware /sdcard/Fw1251r1c.bin
D/wlan_loader( 395): Configuring adapter
D/wlan_loader( 395): Adapter configuration rc = 0
D/wlan_loader( 395): Starting configMge
D/wlan_loader( 395): ConfigMge start rc = 0
D/wlan_loader( 395): Driver configured
D/wlan_loader( 395): Firmware loaded and running OK
D/wlan_loader( 395): Set property wlan.driver.status = ok - Ok
i did once end up with the ok - Ok but it was hit and miss, and i've ended up with all sorts from ok - Fail to fail - Ok to fail - Fail but ifconfig has never shown a mac address on its own
Email to...
The terminal emulator in android should have an option in the menu to email everything you've seen to an email address, use that to keep logs of the entire session. Better terminal has this feature, but it stopped working, try
Files
Fw1251r1c.bin
The firmware filenames of the G1 and the Kaiser have the same name. So we should get a list of good kaiser firmware to rule firmware issues out as soon as possible. If you can connect in windows mobile to a wpa secured AP then the Fw1251r1c.bin in the windows folder on the rom should be the one you are using in Android.
File, Size in bytes, MD5SUM, Source
Fw1251r1c.bin, 185388, ebf5c2036d37bc56b4d41ddcbda4311e, 6.1 WWE ROM shifu, Download
tiwlan.ini
Lets get a good tiwlan.ini file, so we know if its causing issues.
Values:
Comming Soon...
wpa_supplicant.conf
Code:
ctrl_interface=tiwlan0
ap_scan=1
eapol_version=1
fast_reauth=1
eapol_version=1
update_config=1
network={
ssid="WIFISSID"
...
priority=1
}
-------------------------------------------------------------------------------------
Quick Scripts:
Its hard to type long commands on the keyboard so here are some scripts to help:
Code:
[B]/sdcard/cmd1[/B]
#!/bin/sh
echo 'Setting Variables...'
setprop wifi.interface tiwlan0
echo 'Variables Set!'
echo 'Logging to /sdcard/debuglog.txt...'
pkill logcat
logcat -f /sdcard/debuglog.txt &
echo 'Logger Started!'
echo 'Copying WLan Module...'
mkdir -p /lib/modules/`uname -r`
cp /system/lib/modules/wlan.ko /lib/modules/`uname -r`/
echo 'Module Coppied!'
echo 'Loading Module...'
modprobe wlan
lsmod
echo 'Module Loaded!'
#
Code:
[B]/sdcard/cmd2[/B]
#!/bin/sh
echo 'Running Loader...'
wlan_loader -f /sdcard/Fw1251r1c.bin -e /sdcard/calibration -i /sdcard/tiwlan.ini
echo 'Loder Completed'
echo 'Ifconfig Output'
ifconfig -a
dmesg|grep -i wlan
cat /sdcard/debuglog.txt... |grep -i wlan
#
Output:
$ su
~ # cd /sdcard/
/sdcard # ./cmd1
Setting Variables...
Variables Set!
Logging to /sdcard/debuglog.txt...
Logger Started!
Copying WLan Module...
Module Coppied!
Loading Module...
wlan 584168 0 - Live 0xbf000000
Module Loaded!
/sdcard # ./cmd2
Running Loader...
Loder Completed
Ifconfig Output
tiwlan0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
[ 96.701234] TIWLAN: Driver loading
[ 97.593872] TIWLAN: Found SDIO controller (vendor 0x104c, device 0x9066)
[ 97.599251] TIWLAN: Driver initialized (rc 0)
[ 97.599511] TIWLAN: 1251 PG 1.1
[ 97.599547] TIWLAN: Driver loaded
D/wlan_loader( 518): adapter tiwlan0, eeprom /sdcard/calibration, init /system/etc/wifi/tiwlan.ini, firmware /sdcard/Fw1251r1c.bin
D/wlan_loader( 518): Configuring adapter
D/wlan_loader( 518): Adapter configuration rc = 0
D/wlan_loader( 518): Starting configMge
D/wlan_loader( 518): ConfigMge start rc = 0
D/wlan_loader( 518): Driver configured
D/wlan_loader( 518): Firmware loaded and running OK
D/wlan_loader( 518): Set property wlan.driver.status = ok - Ok
thanks,
how did you manage that configMge doesn't fail on start? I still get 'rc = -1'. Did you build a new 'wlan.ko' with the Kernelsource from git (Vogue/Kaiser)? And what firmware are you using (the original or the extracted?)
maybe you can post your files for testing...
toasty_ said:
thanks,
how did you manage that configMge doesn't fail on start? I still get 'rc = -1'. Did you build a new 'wlan.ko' with the Kernelsource from git (Vogue/Kaiser)? And what firmware are you using (the original or the extracted?)
maybe you can post your files for testing...
Click to expand...
Click to collapse
Its either the variable being set or modprobe being used that does the trick, so try those, i'm in the middle of compiling a newer kernel to see if it works better
Thx for the short Tutorial and the scripts. Unfortunately I still get the message:
Code:
'ConfigMge start rc = -1'
I think the reason is the (my) wlan.ko module - it shows following message/warning while loading (insmod and modprobe)
Code:
wlan: version magic '2.6.25-00818-gf668526 preempt mod_unload ARMv6 ' should be '2.6.25-00832-g42c5da5 preempt mod_unload ARMv6'
but its loaded...
especialy lsmod gives me another value for the second number (think the allocated memory):
Code:
wlan 583852 0 - Live 0xbf000000
I use the firmware from '3.34.shifuv11F WWE':
Size: 185388 byte
MD5: ebf5c2036d37bc56b4d41ddcbda4311e
dmesg:
Code:
[ 114.718730] TIWLAN: Driver loading
[ 115.079288] TIWLAN: Found SDIO controller (vendor 0x104c, device 0x9066)
[ 115.084840] TIWLAN: Driver initialized (rc 0)
[ 115.084952] TIWLAN: Driver loaded
[ 122.852419] TIWLAN: TIWLAN: Failed to start config manager
logcat:
Code:
D/wlan_loader( 444): adapter tiwlan0, eeprom /proc/calibration, init /sdcard/wlan/tiwlan.ini, firmware /sdcard/wlan/Fw1251r1c.bin
D/wlan_loader( 444): Configuring adapter
D/wlan_loader( 444): Adapter configuration rc = 0
D/wlan_loader( 444): Starting configMge
D/wlan_loader( 444): ConfigMge start rc = -1
D/wlan_loader( 444): Driver configuration failed (-1)
E/wlan_loader( 444): init_driver() failed
D/wlan_loader( 444): Set property wlan.driver.status = failed - Ok
can you tell me what wlan.ko you are using - maybe a link...
Upon further investigation it turns out that a specific version of the firmware and a compatible wlan.ko are needed to get it to work, i'm rolling up a fresh system.img to test now, i'll post it if it works
http://forum.xda-developers.com/showthread.php?p=4231219
toasty_ said:
Thx for the short Tutorial and the scripts. Unfortunately I still get the message:
Code:
'ConfigMge start rc = -1'
I think the reason is the (my) wlan.ko module - it shows following message/warning while loading (insmod and modprobe)
Code:
wlan: version magic '2.6.25-00818-gf668526 preempt mod_unload ARMv6 ' should be '2.6.25-00832-g42c5da5 preempt mod_unload ARMv6'
but its loaded...
especialy lsmod gives me another value for the second number (think the allocated memory):
Code:
wlan 583852 0 - Live 0xbf000000
I use the firmware from '3.34.shifuv11F WWE':
Size: 185388 byte
MD5: ebf5c2036d37bc56b4d41ddcbda4311e
dmesg:
Code:
[ 114.718730] TIWLAN: Driver loading
[ 115.079288] TIWLAN: Found SDIO controller (vendor 0x104c, device 0x9066)
[ 115.084840] TIWLAN: Driver initialized (rc 0)
[ 115.084952] TIWLAN: Driver loaded
[ 122.852419] TIWLAN: TIWLAN: Failed to start config manager
logcat:
Code:
D/wlan_loader( 444): adapter tiwlan0, eeprom /proc/calibration, init /sdcard/wlan/tiwlan.ini, firmware /sdcard/wlan/Fw1251r1c.bin
D/wlan_loader( 444): Configuring adapter
D/wlan_loader( 444): Adapter configuration rc = 0
D/wlan_loader( 444): Starting configMge
D/wlan_loader( 444): ConfigMge start rc = -1
D/wlan_loader( 444): Driver configuration failed (-1)
E/wlan_loader( 444): init_driver() failed
D/wlan_loader( 444): Set property wlan.driver.status = failed - Ok
can you tell me what wlan.ko you are using - maybe a link...
Click to expand...
Click to collapse
So you'll have to compile a custom kernel, then a custom wlan.ko before you try this. I have also uploaded the wifi firmware, a link is in the first post
Custom Kernel:
I use the Kernelsources from git ("git.linuxtogo.org", vogue branch). I also tried to build the 'wlan.ko' from Android-source (I set 'KERNEL_DIR' to the Folder of my Kernel source). If I run make I get some errors because of missing include-files.
//Edit: just made symlink to arm-msm
If I'm home on weekend I try to build a new wlan.ko for my kernel. Is there anything, that needs to be patched for kernel 2.6.25?
btw. I found this page http://www.johandekoning.nl/index.php, there are some information about wlan and firmware loading issues (for the G1, but nearly the same problemes)
I didn't do anything special to get a wlan.ko, just compiled it as normal:
Code:
KERNEL_DIR=/Android/kernel make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
Current status from error log:
Code:
D/wlan_loader( 406): adapter tiwlan0, eeprom /proc/calibration, init /system/etc/wifi/tiwlan.ini, firmware /system/etc/wifi/Fw1251r1c.bin
D/wlan_loader( 406): Configuring adapter
D/wlan_loader( 406): Adapter configuration rc = 0
D/wlan_loader( 406): Starting configMge
D/wlan_loader( 406): ConfigMge start rc = 0
D/wlan_loader( 406): Driver configured
D/wlan_loader( 406): Firmware loaded and running OK
D/wlan_loader( 406): Set property wlan.driver.status = ok - Ok
D/dalvikvm( 161): GC freed 11747 objects / 572968 bytes in 363ms
V/WifiMonitor( 161): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=2]
V/WifiMonitor( 161): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=1]
D/SettingsWifiEnabler( 390): Received wifi state changed from Enabling to Enabled
V/WifiMonitor( 161): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=2]
V/WifiMonitor( 161): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=1]
[B]D/WifiHW ( 161): 'DRIVER RSSI' command timed out.[/B]
[B]D/WifiHW ( 161): 'DRIVER LINKSPEED' command timed out.[/B]
[B]D/WifiHW ( 161): 'DRIVER MACADDR' command timed out.[/B]
V/WifiStateTracker( 161): Connection to supplicant established, state=INACTIVE
[B]D/WifiHW ( 161): 'DRIVER RXFILTER-ADD 0' command timed out.[/B]
[B]D/WifiHW ( 161): 'DRIVER BTCOEXSCAN-STOP' command timed out.[/B]
V/WifiStateTracker( 161): Changing supplicant state: INACTIVE ==> SCANNING
I/WindowManager( 161): Setting rotation to 1, animFlags=1
I/WindowManager( 161): Config changed: { scale=1.0 imsi=0/0 locale=en touch=3 key=2/1/1 nav=1 orien=2 }
[B]D/WifiHW ( 161): 'DRIVER SCAN-PASSIVE' command timed out.[/B]
V/WifiStateTracker( 161): Changing supplicant state: SCANNING ==> INACTIVE
V/WifiStateTracker( 161): Changing supplicant state: INACTIVE ==> SCANNING
V/WifiStateTracker( 161): Changing supplicant state: SCANNING ==> INACTIVE
W/WindowManager( 161): Window freeze timeout expired.
W/WindowManager( 161): Force clearing orientation change: Window{43120508 StatusBar paused=false}
[B]D/WifiHW ( 161): 'SCAN_RESULTS' command timed out.[/B]
D/StatusBar( 161): updateResources
I/WindowManager( 161): Config changed: { scale=1.0 imsi=0/0 locale=en touch=3 key=2/1/2 nav=1 orien=2 }
D/dalvikvm( 161): GC freed 5792 objects / 384744 bytes in 220ms
D/StatusBar( 161): updateResources
[B]D/WifiHW ( 161): 'LIST_NETWORKS' command timed out.[/B]
W/SurfaceFlinger( 161): timeout expired mFreezeDisplay=1, mFreezeCount=1
W/WindowManager( 161): App freeze timeout expired.
W/WindowManager( 161): Force clearing freeze: AppWindowToken{43358af8 token=HistoryRecord{43358808 {com.android.settings/com.android.settings.wifi.WifiSettings}}}
D/WifiHW ( 161): 'STATUS' command timed out.
D/dalvikvm( 161): GC freed 946 objects / 43184 bytes in 188ms
D/dalvikvm( 317): GC freed 356 objects / 32824 bytes in 105ms
D/WifiHW ( 161): 'DRIVER RSSI' command timed out.
W/WindowManager( 161): Key dispatching timed out sending to com.android.settings/com.android.settings.wifi.WifiSettings
W/WindowManager( 161): Dispatch state: null
W/WindowManager( 161): Current state: {{null to Window{4335b828 com.android.settings/com.android.settings.wifi.WifiSettings paused=false} @ 1247587631205 lw=Window{4335b828 com.android.settings/com.android.settings.wifi.WifiSettings paused=false} [email protected] fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{4335b828 com.android.settings/com.android.settings.wifi.WifiSettings paused=false}}}
I/ActivityManager( 161): ANR (application not responding) in process: com.android.settings
I/ActivityManager( 161): Annotation: keyDispatchingTimedOut
I/ActivityManager( 161): CPU usage:
I/ActivityManager( 161): Load: 5.21 / 3.21 / 1.36
I/ActivityManager( 161): CPU usage from 9963ms to 28ms ago:
I/ActivityManager( 161): system_server: 8% = 7% user + 0% kernel
I/ActivityManager( 161): com.android.alarmclock: 1% = 1% user + 0% kernel
I/ActivityManager( 161): com.android.phone: 0% = 0% user + 0% kernel
I/ActivityManager( 161): loop0: 0% = 0% user + 0% kernel
I/ActivityManager( 161): rild: 0% = 0% user + 0% kernel
I/ActivityManager( 161): android.process.acore: 0% = 0% user + 0% kernel
I/ActivityManager( 161): com.android.inputmethod.latin: 0% = 0% user + 0% kernel
I/ActivityManager( 161): android.process.media: 0% = 0% user + 0% kernel
I/ActivityManager( 161): TOTAL: 8% = 7% user + 1% kernel + 0% irq
toasty_ said:
Custom Kernel:
I use the Kernelsources from git ("git.linuxtogo.org", vogue branch). I also tried to build the 'wlan.ko' from Android-source (I set 'KERNEL_DIR' to the Folder of my Kernel source). If I run make I get some errors because of missing include-files.
If I'm home on weekend I try to build a new wlan.ko for my kernel. Is there anything, that needs to be patched for kernel 2.6.25?
btw. I found this page http://www.johandekoning.nl/index.php, there are some information about wlan and firmware loading issues (for the G1, but nearly the same problemes)
Click to expand...
Click to collapse
Sorry, my mistake, i did in fact have a different driver version. I have uploaded it, check the first post. This driver does not seem to work and will need to be modified.
thanks for the files, where did you get them? Compiling worked without any failure (just had to create a symlink to 'arch-msm'
it seem as if the firmware is loaded (on my phone it only works with the fw of the G1). I think it is realiy loaded because you get 'failed - OK' if you try to load it a 2nd time.
by the way have you extraced wlan-eeprom ('/proc/calibration') http://projects.linuxtogo.org/tracker/index.php?func=detail&aid=32&group_id=37&atid=273
toasty_ said:
thanks for the files, where did you get them? Compiling worked without any failure (just had to create a symlink to 'arch-msm'
it seem as if the firmware is loaded (on my phone it only works with the fw of the G1). I think it is realiy loaded because you get 'failed - OK' if you try to load it a 2nd time.
by the way have you extraced wlan-eeprom ('/proc/calibration') http://projects.linuxtogo.org/tracker/index.php?func=detail&aid=32&group_id=37&atid=273
Click to expand...
Click to collapse
Yes, i have extracted my eeprom file and i have found my mac address in there 3 times, which seems strange. I found the area which has the same start as the carlibration of a G1 (found here) and extracted a chunk to get the same size file. I tried it but it doesn't seem to make a difference. Maybe the data is read after the point at which we are having errors?
So I've played a bit around with the files. At the moment the driver is loaded and the firmware is accepted. But the wlan adapter still doesn't get a Mac.
Btw. if you take a look at the eeprom-file you find the MAC from Offset 0x5C to 0x61 in reverse order. Would be interesting the G1 eeprom-file looks like. Maybe somebody can 'cat /proc/calibration > /sdcard/calibration.bin'.
//***OK nearly the same as you said - should write faster***//
OK, yes found the offset in my file, but the its a bit different
Code:
G1:
02 11 56 06 1C 06 01 16 60 03 07 01 09 56 12 00 00 00 01 0D 56 40
Kaiser:
02 11 56 06 1C 06 [COLOR="Red"]00[/COLOR] 16 60 03 [COLOR="Red"]02[/COLOR] 01 09 56 12 00 00 00 01 0D 56 40
Ah, i made a mistake, still need to find where the contents of calibration are in the rom dump
Ok in romdump there are some more Offsets (0x243E5C8, 0x2500040, 0x2500840, 0x2520040 from full rom-dump) that have nearly the same byte order
But only in 0x2500840 and 0x2500040 my MAC is included --> I've checked with 'diff' both extracted Offsets (752 Byte) and they are same
toasty_ said:
So I've played a bit around with the files. At the moment the driver is loaded and the firmware is accepted. But the wlan adapter still doesn't get a Mac.
Btw. if you take a look at the eeprom-file you find the MAC from Offset 0x5C to 0x61 in reverse order. Would be interesting the G1 eeprom-file looks like. Maybe somebody can 'cat /proc/calibration > /sdcard/calibration.bin'.
//***OK nearly the same as you said - should write faster***//
OK, yes found the offset in my file, but the its a bit different
Code:
G1:
02 11 56 06 1C 06 01 16 60 03 07 01 09 56 12 00 00 00 01 0D 56 40
Kaiser:
02 11 56 06 1C 06 [COLOR="Red"]00[/COLOR] 16 60 03 [COLOR="Red"]02[/COLOR] 01 09 56 12 00 00 00 01 0D 56 40
Click to expand...
Click to collapse
Ok i found the correct location, I searched for 021156061c in the eeprom dump and found it. I haven't had a chance to test this yet. Also another interesting thing to note is that both the kaiser' and G1's mac address started with 00:18 :41
Newbie16 said:
Ok i found the correct location, I searched for 021156061c in the eeprom dump and found it. I haven't had a chance to test this yet. Also another interesting thing to note is that both the kaiser' and G1's mac address started with 00:18 :41
Click to expand...
Click to collapse
yap, my does it too...

How to "Bridge the network interfaces" in Android to Windows?

I just read this article,
http://blog.mycila.com/2010/06/reverse-usb-tethering-with-android-22.html
and I'm stuck on step 3. I don't have Ubuntu. How can I Bridge the 2 network interfaces?
STEP 3:
On Linux Computer, setup a bridge:
# usb0 is the new network intreface
# eth0 is the main interface connected to internet (or a gateway)
sudo ifconfig eth0 0.0.0.0
sudo ifconfig usb0 0.0.0.0
sudo brctl addbr br0
sudo brctl addif br0 eth0
sudo brctl addif br0 usb0
sudo ifconfig br0 up
sudo dhclient br0
See https://help.ubuntu.com/community/NetworkConnectionBridge to setup bridges
On windows, Bridge the 2 network interfaces
Click to expand...
Click to collapse

[Q][DNS] Set DNS on Android 4.3 and 4.4

Hi,
I have a problem on Android 4.3 and 4.4 phone (Samsung GT-I9500 and Google Nexus 10)
Phone sends DNS requests to DNS server address obtained via DHCP. But it ignores setup changes in setprorp 1 and setprorp 2.
do it:
Code:
adb shell
# setprop net.dns1 <ip1>
# setprop net.dns2 <ip2>
How to change DNS server?
How to add DNS server?
Info:
Code:
[email protected]:/ # getprop |grep dns
getprop |grep dns
[dhcp.wlan0.dns1]: [192.168.1.1]
[dhcp.wlan0.dns2]: []
[dhcp.wlan0.dns3]: []
[dhcp.wlan0.dns4]: []
[net.change]: [net.dns1]
[net.dns.search]: []
[net.dns1]: [192.168.1.1]
[email protected]:/ # setprop net.dns1 8.8.8.8
setprop net.dns1 8.8.8.8
[email protected]:/ # setprop net.dns2 4.4.4.4
setprop net.dns2 4.4.4.4
[email protected]:/ # setprop dhcp.wlan0.dns1 8.8.8.8
setprop dhcp.wlan0.dns1 8.8.8.8
[email protected]:/ # getprop |grep dns
getprop |grep dns
[dhcp.wlan0.dns1]: [8.8.8.8]
[dhcp.wlan0.dns2]: []
[dhcp.wlan0.dns3]: []
[dhcp.wlan0.dns4]: []
[net.change]: [net.dns2]
[net.dns.search]: []
[net.dns1]: [8.8.8.8]
[net.dns2]: [4.4.4.4]
[email protected]:/ # ping google.com
[email protected]:/ # tcpdump -ns0 -i wlan0 'port 53'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on br0, link-type EN10MB (Ethernet), capture size 65535 bytes
14:37:40.246226 IP 192.168.1.177.3551 > 192.168.1.1.53: 52272+ A? google.com. (28)
--
Thanks
Alexander
[Resolved]
Change your DNS servers in Android.
You can change the same thing on your rooted Android Device.
[email protected]:/ # ndc resolver flushif -- flushes old DNS servers
[email protected]:/ # ndc resolver flushdefaultif -- flush resolver
[email protected]:/ # ndc resolver setifdns <iface> <domains> <dns1> <dns2> ... -- Add the new servers
[email protected]:/ # ndc resolver setdefaultif -- Set as the default device
KASRU said:
Change your DNS servers in Android.
You can change the same thing on your rooted Android Device.
[email protected]:/ # ndc resolver flushif -- flushes old DNS servers
[email protected]:/ # ndc resolver flushdefaultif -- flush resolver
[email protected]:/ # ndc resolver setifdns <iface> <domains> <dns1> <dns2> ... -- Add the new servers
[email protected]:/ # ndc resolver setdefaultif -- Set as the default device
Click to expand...
Click to collapse
Hi Kasru, to set your prefered DNS automatcailly and every time, you may want to have a look at this file in /system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf, in there, you can add lines like below:
setprop dhcp.eth0.dns1 8.8.8.8
setprop dhcp.eth0.dns2 8.8.8.4
i found this out from here: github.com/varunkumar/scratchpad/blob/master/static/20-dns.conf
cheers.
d8d8up said:
Hi Kasru, to set your prefered DNS automatcailly and every time, you may want to have a look at this file in /system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf, in there, you can add lines like below:
setprop dhcp.eth0.dns1 8.8.8.8
setprop dhcp.eth0.dns2 8.8.8.4
i found this out from here: github.com/varunkumar/scratchpad/blob/master/static/20-dns.conf
cheers.
Click to expand...
Click to collapse
i can note copy the link over, but here it is the file, note line 20 and 20, if you # it out, it should use the default gateway, or change it so it use one you prefer:
<code>
# Set net.<iface>.dnsN properties that contain the
# DNS server addresses given by the DHCP server.
set_dns_props()
{
case "${new_domain_name_servers}" in
"") return 0;;
esac
count=1
for i in 1 2 3 4; do
setprop dhcp.${interface}.dns${i} ""
done
count=1
for dnsaddr in ${new_domain_name_servers}; do
setprop dhcp.${interface}.dns${count} ${dnsaddr}
count=$(($count + 1))
done
setprop dhcp.eth0.dns1 8.8.8.8
setprop dhcp.eth0.dns2 8.8.8.4
}
unset_dns_props()
{
for i in 1 2 3 4; do
setprop dhcp.${interface}.dns${i} ""
done
}
case "${reason}" in
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT) set_dns_props;;
EXPIRE|FAIL|IPV4LL|RELEASE|STOP) unset_dns_props;;
esac
</code>
I long time search way, how to to communicate directly the daemon via the /dev/socket/netd
Besause the getprop/setprop method used by all the DNS changer apps does not work anymore (on Android 4.3+).
Application "Override DNS for KitKat" is cool!
For change DNS manually, use command for add new DNS server:
[email protected]:/ # ndc resolver setifdns <iface> <domains> <dns1> <dns2>
[email protected]:/ # ndc resolver setdefaultif <iface>
For example:
Code:
[email protected]:/ # ndc resolver setifdns eth0 "" 8.8.8.8 8.8.8.4 192.168.1.1
[email protected]:/ # ndc resolver setdefaultif eth0
---
If you liked my post, then don't hesitate to hit the thanks button
I have tried using other "dns changer" apps post 4.3, they successfully change the dns to public ones but they have no option to revert back to DHCP assigned. SetDNS used to have this function but now longer works on Lollipop. How can i get the DNS servers back to DHCP assigned for both celluar and wifi?

[TUT] Adblock using DNSMASQ [root]

After much struggling with high cpu loads using Androids own dnsmasq I finally came up with the solution to use dnsmasq for ad domain blocking.
[Q] Need root?
Yep.
[Q] Why dnsmasq?
Dnsmasq can use wildcards in domain names, no more lenghty /etc/hosts files.
[Q] Why did it have high cpu?
This happens because dnsmasq keeps reading stdin after it starts. You can close stdin with a command <&-
[Q] How does it work?
See file adblock.conf
[Q] Problems?
The only problem to solve is to set the net.dns1 for mobile data. For wifi it can be done with a script /system/etc/dhcpcd/dhcpcd-hooks/21-dns.conf
[Q] What version of Android?
It was on Android 4.2.2 with dnsmasq version 2.51 (dnsmasq -v)
Happy holidays
/data/local/tmp/adblock.conf:
### AdBlock for Android
### Original by Malakai1911, changed by Tweakradje (2016)
### 1) place this file is /data/local/tmp/adblock.conf
### 2) Start dnsmasq: dnsmasq --conf-file=/data/local/tmp/adblock.conf <&-
### why <&- ? dnsmasq just keeps reading stdin for commands. <&- closes stdin
### check for high cpu (should be 0%): top -n 1|grep dns
### 1843 0% S 1 2992K 2456K fg root
### 3) you need to set DNS manually: setprop net.dns1 127.0.0.1 (use for test)
### BUT dhcpd will change net.dns1 again (net.dnschange goes +1)
### Override DNS on WLAN0 and RMNET0:
### 4) echo setprop dhcp.wlan0.dns1 127.0.0.1 >/system/etc/dhcpcd/dhcpcd-hooks/99-dnsmasq
### 5) chmod 644 /system/etc/dhcpcd/dhcpcd-hooks/99-dnsmasq
### *) Nothing found yet for mobile data dns on RMNET0 (netd does that?)
### echo setprop net.rmnet0.dns1 127.0.0.1>>/system/etc/dhcpcd/dhcpcd-hooks/99-dnsmasq
### ps: if your tether mobile data Android uses the netd and start:
### dnsmasq --no-daemon --no-resolv --no-poll --dhcp-option-force=43,ANDROID_METERED --dhcp-range=%s,%s,1h
### ps: killall -HUP dnsmasq does not reread this config file!
### stop dnsmasq: killall dnsmasq
### if you trust the workings you can copy adblock.conf to /etc/dnsmasq.conf
### add to your install-recovery.sh the line: dnsmasq <&-
### <&- is needed to close stdin and avoid high cpu usage from dnsmasq !!!!
# Configuration dnsmasq
no-resolv # don't read /etc/resolv.conf
no-poll # don't look for changes in other files
no-hosts # do not read /etc/hosts
# forwarding dns servers
server=208.67.222.222
server=208.67.220.220
no-dhcp-interface=lo # tftp and dhcp disabled by default?
interface=lo # only listen on this NIC, lo is default
listen-address=127.0.0.1 # setprop net.dns1 127.0.0.1
no-negcache #remember "no such domain" queries
stop-dns-rebind #reject upstream dns servers in private IP's
domain-needed #only upstream if FQDN is asked
bogus-priv #reverse lookup private IP's not upstream
#max-ttl=86400 # one day in cache (max-ttl bad option on android dnsmasq)
cache-size=500 #entries in cache (def 150)
pid-file=/data/local/tmp/dnsmasq.pid # store process id if running as daemon (some android only?)
### if no-daemon then uncomment next 2 lines, nice to monitor dns domains queried
#no-daemon # -d if no daemon then no pid needed, no-daemon good for testing logs
log-queries # -q this will log into logcat, use logcat|grep dnsmasq (exit with CTRL+\ ENTER)
### Ad Domain Filter, return 0.0.0.0 if met, add your own ###
address=/2mdn.net/0.0.0.0
address=/2o7.net/0.0.0.0
address=/ad-inside.com/0.0.0.0
address=/adbrite.com/0.0.0.0
address=/adinfuse.com/0.0.0.0
address=/admob.com/0.0.0.0
address=/admob.mobi/0.0.0.0
....
Click to expand...
Click to collapse
I have tested it on various versions of Android 2.x to 5 but only from Android 4.2 it looks like dnsmasq is working properly in daemon mode.
On lower versions dnsmasq seems to run fine but after a few hours its cpu usage goes up (from 0%) and it logs these messages:
E/dnsmasq ( 6293): Unknown cmd ''
Click to expand...
Click to collapse
Looks like a loop or bug. Why should it get any commands (even empty ones) from stdin?
You can try to run it with the no-daemon and log-queries option and let it run for a day, checking its log output and cpu usage.
Cheers
Solution: close stdin after the dnsmasq command like: dnsmasq <&-
Now it also works from adb shell.

SSHD problem (cm13)

Hi,
sshd won't work on my Moto G (Falcon) with CM13
Can anyone help me?
Logcat:
Code:
07-17 00:42:25.618 24464 24464 I /system/bin/sshd: Server listening on :: port 22.
07-17 00:42:25.618 24464 24464 I /system/bin/sshd: Server listening on 0.0.0.0 port 22.
07-17 00:42:28.787 24492 24492 E /system/bin/sshd: error: Could not load host key: /data/ssh/ssh_host_dsa_key
07-17 00:42:28.792 24492 24492 I /system/bin/sshd: WARNING: /data/ssh/moduli does not exist, using fixed modulus
07-17 00:42:28.901 218 218 F DEBUG : pid: 24493, tid: 24493, name: sshd >>> /system/bin/sshd: [net] <<<
07-17 00:42:28.938 218 218 F DEBUG : #10 pc 0000cdc9 /system/bin/sshd
07-17 00:42:28.938 218 218 F DEBUG : #13 pc 00020d6f /system/bin/sshd
07-17 00:42:28.938 218 218 F DEBUG : #15 pc 000073e4 /system/bin/sshd
07-17 00:42:28.989 24492 24492 E /system/bin/sshd: error: mm_request_receive: socket closed
/data/ssh:
Code:
drw------- 2 root shell 4096 1970-01-01 05:49 empty
-rw------- 1 root root 672 2016-07-17 01:01 ssh_host_dsa_key
-rw-r--r-- 1 root root 604 2016-07-17 01:01 ssh_host_dsa_key.pub
-rw------- 1 root root 1675 2016-07-17 01:01 ssh_host_rsa_key
-rw-r--r-- 1 root root 396 2016-07-17 01:01 ssh_host_rsa_key.pub
-rw------- 1 root root 5 2016-07-17 01:11 sshd.pid
-rw------- 1 root root 3330 2016-07-17 00:00 sshd_config
sshd_config:
Code:
# $OpenBSD: sshd_config,v 1.84 2011/05/23 03:30:07 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# The default requires explicit activation of protocol 1
Protocol 2
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
HostKey /data/ssh/ssh_host_rsa_key
HostKey /data/ssh/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024
# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#RSAAuthentication yes
PubkeyAuthentication yes
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile /data/ssh/authorized_keys
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
PermitEmptyPasswords no
# Change to no to disable s/key passwords
ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM no
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
PidFile /data/ssh/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none
# no default banner path
Banner /data/ssh/banner
# override default of no subsystems
Subsystem sftp internal-sftp
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server
/data/local/userinit.d/99sshd:
Code:
#!/system/bin/sh
umask 077
# DEBUG=1
DSA_KEY=/data/ssh/ssh_host_dsa_key
DSA_PUB_KEY=/data/ssh/ssh_host_dsa_key.pub
RSA_KEY=/data/ssh/ssh_host_rsa_key
RSA_PUB_KEY=/data/ssh/ssh_host_rsa_key.pub
AUTHORIZED_KEYS=/data/ssh/authorized_keys
DEFAULT_AUTHORIZED_KEYS=/system/etc/security/authorized_keys.default
if [ ! -f $DSA_KEY ]; then
/system/bin/ssh-keygen -t dsa -f $DSA_KEY -N ""
chmod 600 /$DSA_KEY
chmod 644 $DSA_PUB_KEY
fi
if [ ! -f $RSA_KEY ]; then
/system/bin/ssh-keygen -t rsa -f $RSA_KEY -N ""
chmod 600 /$RSA_KEY
chmod 644 $RSA_PUB_KEY
fi
if [[ ! -f $AUTHORIZED_KEYS && -f $DEFAULT_AUTHORIZED_KEYS ]]; then
cat $DEFAULT_AUTHORIZED_KEYS > $AUTHORIZED_KEYS
fi
if [ "1" == "$DEBUG" ] ; then
# run sshd in debug mode and capture output to logcat
/system/bin/logwrapper /system/bin/sshd -f /data/ssh/sshd_config -D -d
else
# don't daemonize - otherwise we can't stop the sshd service
/system/bin/sshd -f /data/ssh/sshd_config -D
fi
Thanks in advance
Post on cyanogenmod forum:
https://forum.cyanogenmod.org/topic/127039-sshd-problem-cm13/#comment-603490

Categories

Resources