레이블이 ethernet인 게시물을 표시합니다. 모든 게시물 표시
레이블이 ethernet인 게시물을 표시합니다. 모든 게시물 표시

2022년 5월 31일 화요일

How to make WiFi higher priority than Ethernet on android?

 1. Android 9


frameworks/opt/net/ethernet/java/com/android/server/ethernet/EthernetNetworkFactory.java



/**

 * {@link NetworkFactory} that represents Ethernet networks.

 *

 * This class reports a static network score of 70 when it is tracking an interface and that

 * interface's link is up, and a score of 0 otherwise.

 */

public class EthernetNetworkFactory extends NetworkFactory {

    private final static String TAG = EthernetNetworkFactory.class.getSimpleName();

    final static boolean DBG = true;


    private static final int NETWORK_SCORE = 59;// fix to lower score than 60.


2. Android 11

frameworks/opt/net/ethernet/java/com/android/server/ethernet/EthernetNetworkFactory.java

        private static final SparseArray<TransportInfo> sTransports = new SparseArray();

        static {

            // LowpanInterfaceTracker.NETWORK_SCORE

            sTransports.put(NetworkCapabilities.TRANSPORT_LOWPAN,

                    new TransportInfo(ConnectivityManager.TYPE_NONE, 30));

            // WifiAwareDataPathStateManager.NETWORK_FACTORY_SCORE_AVAIL

            sTransports.put(NetworkCapabilities.TRANSPORT_WIFI_AWARE,

                    new TransportInfo(ConnectivityManager.TYPE_NONE, 1));

            // EthernetNetworkFactory.NETWORK_SCORE

            sTransports.put(NetworkCapabilities.TRANSPORT_ETHERNET,

                    new TransportInfo(ConnectivityManager.TYPE_ETHERNET, /*70*/55));


2015년 7월 24일 금요일

adb connect over TCPIP when Multiple Devices

Get all device's IP.

shell@odroidxu3:/ $ su                                                          
root@odroidxu3:/ # netcfg                                                       
lo       UP                                   127.0.0.1/8   0x00000049 00:00:000
eth0     UP                               192.168.0.1/24  0x00001043 fa:e2:864
sit0     DOWN                                   0.0.0.0/0   0x00000080 00:00:000
ip6tnl0  DOWN                                   0.0.0.0/0   0x00000080 00:00:000
root@odroidxu3:/ # 

eth0 -> adb over Ethernet.
wlan0 -> adb over Wi-Fi.

device1 ip 192.168.0.1
device2 ip 192.168.0.2
device3 ip 192.168.0.3
......
deviceN ip 192.168.0.N

Restart adbd service at all devices.

root@odroidxu3:/ # setprop service.adb.tcp.port 5555     
root@odroidxu3:/ # stop adbd && start adbd                                      
[  286.223070] [c4] adb_release                                                 
[  286.224485] [c4] dwc3 12400000.dwc3: request de1f4f80 was not queued to ep0ot
root@odroidxu3:/ [  286.239830] [c1] adb_open                                   
[  286.242450] [c6] adb_bind_config                                             

Or Edit /system/build.prop. No more stop and start adbd.

add this line.
$ su
# mount -o rw,remount /system
# vi /system/build.prop

service.adb.tcp.port=5555

Connect device on 192.168.0.1

[~]$ adb connect 192.168.0.1
connected to 192.168.0.1:5555


[~]$ adb logcat

--------- beginning of /dev/log/main
I/installd( 2785): installd firing up
I/DEBUG   ( 2780): debuggerd: Jul  2 2015 14:27:22
I/Netd    ( 2779): Netd 1.0 starting
W/InterfaceController( 2779): Warning (dlopen failed: library "/system/lib/libnetcmdiface.so" not found) while opening the net interface command library
--------- beginning of /dev/log/system
I/Vold    ( 2774): Vold 2.1 (the revenge) firing up
E/Vold    ( 2774): boot_mode = 0
E/Vold    ( 2774): eMMC boot_mode
D/Vold    ( 2774): Volume sdcard0 state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume sdcard1 state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume usb2host state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume usb3host state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume usb3device state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume sdcard0 state changing 0 (No-Media) -> 1 (Idle-Unmounted)
W/Vold    ( 2774): Duplicate state (1)
W/Vold    ( 2774): Duplicate state (1)

On other terminal

[~]$ adb devices
List of devices attached 
192.168.0.1:5555 device

Connect deivce on 192.168.0.2

[~]$ adb connect 192.168.0.2
connected to 192.168.0.2:5555

There are multiple devices.

[~]$ adb devices
List of devices attached 
192.168.0.1:5555 device
192.168.0.2:5555 device

If you connect other device, It is impossible.

[~]$ adb logcat
- waiting for device -
error: more than one device and emulator

You can solve by option '-s'

[~]$ adb -s 192.168.0.2:5555 logcat
--------- beginning of /dev/log/main
I/installd( 2785): installd firing up
I/DEBUG   ( 2780): debuggerd: Jul  2 2015 14:27:22
I/Netd    ( 2779): Netd 1.0 starting
W/InterfaceController( 2779): Warning (dlopen failed: library "/system/lib/libnetcmdiface.so" not found) while opening the net interface command library
--------- beginning of /dev/log/system
I/Vold    ( 2774): Vold 2.1 (the revenge) firing up
E/Vold    ( 2774): boot_mode = 0
E/Vold    ( 2774): eMMC boot_mode
D/Vold    ( 2774): Volume sdcard0 state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume sdcard1 state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume usb2host state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume usb3host state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume usb3device state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume sdcard0 state changing 0 (No-Media) -> 1 (Idle-Unmounted)
W/Vold    ( 2774): Duplicate state (1)
W/Vold    ( 2774): Duplicate state (1)

2013년 9월 3일 화요일

ODROID-XU Update.zip included GMS(Gapps)01-Dec-2013

Last recovery firmware
http://dn.odroid.com/ODROID-XU/Firmware/01-10-2014/

last update firmware
http://dn.odroid.com/ODROID-XU/Firmware/02-13-2014/

and GApps Installer
http://codewalkerster.blogspot.kr/2013/11/universal-1-click-gapps-installer-for.html


https://drive.google.com/folderview?id=0B5aZmgmqP9rORjhTbVhqYVgySlE&usp=sharing

https://www.dropbox.com/s/amgthsz8tjfsd8b/update.zip

https://www.dropbox.com/s/amgthsz8tjfsd8b/update.zip

https://www.dropbox.com/s/szu2yax7ew08p6q/update.zip.md5sum

https://www.dropbox.com/s/szu2yax7ew08p6q/update.zip.md5sum

01 Dec 2013
support USB Gps attached by serial modem(like ttyACM or ttyUSB)

26 Nov 2013
fix 720P usb camera problem(UVC).

13 Nov 2013
support HSDPA USB dongle Modem(huawei e173)
test version.



http://www.alibaba.com/product-gs/1009044157/TJ_W803_Similar_specs_Same_Quality.html?s=p

07 Nov 2013

Asix Ethernet Adapter bug Fix.
The lock that would cause the usb3 to gigabit lan adapter is now fixed and merged.
http://git.odroid.in/odroid/linux/commit/85f0fa36e8117bd831ee9737d899f3fe5890eaac
reverse portrait screen.
ODROID-XU issue where 48kHz audio couldn't be played via alsa is now fixed.


02 Nov 2013
support UHS class for microSD.

25 Oct 2013
fix this issue.
http://forum.odroid.com/viewtopic.php?f=63&t=2111

19 Oct 2013
Update for Expansion board.
Exansion board example app.
https://www.dropbox.com/s/tbffdto7nulafuk/ExpansionBoardExample.apk



10 Oct 2013
for Kinect.
add feature CONFIG_USB_DEVICEFS.
add node for Kinect in uevnet.odroidxu.rc
add feature CONFIG_HID_APPLE.

04 Oct 2013
fix screen color problem.
http://forum.odroid.com/viewtopic.php?f=73&t=2363#p18874

01 Oct 2013
Enable ethernet on automatically.

25 Sep 2013
If ax88179(gigabit) Ethernet via USB 3.0 and smsc95xx(10/100) Ethernet via USB 2.0 is connected at the same time, then control ax88179 modules first.
It is enabled to set static IP setting for gigabit Ethernet.

23 Sep 2013
add ethernet setting for static IP


16 Sep 2013
1. fix OdroidUpdate app.
After validate update.zip, Extract update.zip automatically.
2. remove EDID function, just set HDMI phy from boot.ini.
Must update boot.ini
Example, here
http://dn.odroid.com/ODROID-XU/boot.ini/09-16-2013/




9 Sep 2013
Download update.zip and update.zip.md5sum





Move update.zip and update.zip.md5sum file from Download folder to root.




Unzip update.zip


There is update folder.


Run ODROID-XU updater app.


Click "Validate file" button.


Checking option.



and start update.

booting...


2013년 5월 21일 화요일

ethernet으로 Wi-Fi 연결 fake


ODROID에 Ethernet port가 있고 기본적으로 dhcp가 가능한 회선에 연결하면 Wi-Fi  연결되어 있지 않아도 인터넷이 가능합니다.

하지면 몇몇 app들은 Mobile Network 또는 Wi-Fi  연결만을 체크하도록 되어 있어서 실행이 안되는 경우가 있습니다.

Ethernet 연결을 Wi-Fi 연결로 사용하여 android에서 Wi-Fi  연결된것 처럼 만들고 싶은데 관련 자료를 못찾겠네요.

아래의 그림과 같이 android는 wlan0가 wpa_supplicant와 연결되어 있습니다. 여기서  wlan0에 eth0를 어떻게 연결할지 생각되는 시나리오 들입니다.

wlan0 -> wpa_supplicant->android

 ^                       ^
  | ?(route)        | ( wpa_supplicant -ieth0 -Dwired)?
eth0    --------->           

1. wpa_supplicant -ieth0 -Dwired 옵션으로 ethernet을 연결
- 단 wpa_supplicant가 두개가 존재해야 하고 서비스 역시 두개가 되어야 한네요.
(wpa_supplicnat -iwlan -Dwext)
- "-Dwired"가 동작하기 위해 wpa_supplicant가 BOARD_WPA_SUPPLICANT_DRIVER := WIRED로 동작 확인이 먼저 일 듯 합니다.


2. eth0을 route하여 wlan0에 연결 
- 하지만 wpa_supplicant 때문에 SSID등 연결된 상태로 만들기가 가능 할지 모르겠네요.

3. reverse tethering
- 이건 pc의 인터넷 연결을 USB(adb)로 스마트폰으로 연결해주는 기술인데 자세한 자료는 없고 howto만 보이네요. usb tethering apk 소스가 필요할 듯 합니다.
- 이건 기본적으로 eth0로 네트워크가 연결되어 있고 Wi-Fi 연결로 속일 수 없어서 안 될것 같은데 몇몇 동영상을 찾아 보면 3G Network 연결로 만드는 듯 하여 Wi-Fi가 아니라 Mobile Network로 연결된다면 가능할 것 같습니다.

MK802 란 모델이 위에 설명한 방법으로 Network이 구성이 된다고 합니다.


아래 주소에서 reverse tethering 소스를 구할 수 있습니다.
https://code.google.com/p/android-reverse-tethering/source/checkout




2013년 4월 2일 화요일

CM-10.1-M2 for ODROID-U2

1. Support Ethernet. (static IP not yet)
2. Mouse right button click act like back Button.
3. add PowerOff widget.



working to enable Volume Up/Down, Screenshot, Power Button.


https://www.dropbox.com/s/sy3lkbo8fr48xla/cm-10.1-20130404-UNOFFICIAL-odroidu2.zip