2013년 12월 22일 일요일

USB vid/pid를 이용해서 장치 연결 상태 알아내기

USB 장치 중에 vid가 0bda이고 pid가 8176인 장치가 연결되어 있는지 알아 보는 방법입니다.

USB node는 /sys/bus/usb/devices/ 에 생성되고 idVendoridProuct를 읽어보면 됩니다.

{
    DIR *dir = opendir("/sys/bus/usb/devices/");
    struct dirent *dent;
    if (dir != NULL) {
        while ((dent = readdir(dir)) != NULL) {
            char node[50] = {'\0',};
            sprintf(node, "/sys/bus/usb/devices/%s/idVendor", dent->d_name);
            int vid_fd = open(node, O_RDONLY);
            char buf[5];
            if (vid_fd > 0) {
                read(vid_fd, buf, 4);
                ALOGE("node = %s, vid = %s", node, buf);
                if (strcmp(buf, "0bda") == 0) {
                    sprintf(node, "/sys/bus/usb/devices/%s/idProduct", dent->d_name);
                    int pid_fd = open(node, O_RDONLY);
                    read(pid_fd, buf, 4);
                    ALOGE("node = %s, pid = %s", node, buf);
                    if (pid_fd > 0) {
                        if (strcmp(buf, "8176") == 0) {
                            //pid가 8176인 장치가 연결되어 있음
                            break;
                        }
                        close(pid_fd);
                    }  
                }  
                close(vid_fd);
            }  
        }  
    }  
    close(dir);
}

2013년 12월 11일 수요일

AOSP build and run emulator(Android Virtual Device)

1. Download android source code.

http://source.android.com/source/downloading.html

$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.4_r1.2
$ repo sync

2. Build

$ source build/envsetup.sh
$ lunch
You're building on Linux

Lunch menu... pick a combo:
     1. aosp_arm-eng
     2. aosp_x86-eng
     3. aosp_mips-eng
     4. vbox_x86-eng
     5. mini_mips-userdebug
     6. mini_armv7a_neon-userdebug
     7. mini_x86-userdebug
     8. aosp_manta-userdebug
     9. aosp_grouper-userdebug
     10. aosp_flo-userdebug
     11. aosp_deb-userdebug
     12. aosp_tilapia-userdebug
     13. aosp_mako-userdebug
     14. aosp_hammerhead-userdebug

Which would you like? [aosp_arm-eng] 1

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4
TARGET_PRODUCT=aosp_arm
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.11.0-14-generic-x86_64-with-Ubuntu-13.10-saucy
HOST_BUILD_TYPE=release
BUILD_ID=KRT16S
OUT_DIR=out
============================================

[~/projects/android_kitkat]$ make -j8


....

k-r8e/:/opt/toolchains/arm-eabi-4.6/bin/:/opt/toolchains/arm-2010q1/bin:/usr/bin/:/usr/lib/ccache
+ ENABLE_SPARSE_IMAGE=
+ '[' out/target/product/generic/system = -s ']'
+ '[' 6 -ne 5 -a 6 -ne 6 ']'
+ SRC_DIR=out/target/product/generic/system
+ '[' '!' -d out/target/product/generic/system ']'
+ OUTPUT_FILE=out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img
+ EXT_VARIANT=ext4
+ MOUNT_POINT=system
+ SIZE=576716800
+ FC=out/target/product/generic/root/file_contexts
+ case $EXT_VARIANT in
+ '[' -z system ']'
+ '[' -z 576716800 ']'
+ '[' -n out/target/product/generic/root/file_contexts ']'
+ FCOPT='-S out/target/product/generic/root/file_contexts'
+ MAKE_EXT4FS_CMD='make_ext4fs  -S out/target/product/generic/root/file_contexts -l 576716800 -a system out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic/system'
+ echo make_ext4fs -S out/target/product/generic/root/file_contexts -l 576716800 -a system out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic/system
make_ext4fs -S out/target/product/generic/root/file_contexts -l 576716800 -a system out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic/system
+ make_ext4fs -S out/target/product/generic/root/file_contexts -l 576716800 -a system out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic/system
Creating filesystem with parameters:
    Size: 576716800
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 7040
    Inode size: 256
    Journal blocks: 2200
    Label:
    Blocks: 140800
    Block groups: 5
    Reserved block group size: 39
Created filesystem with 1262/35200 inodes and 81852/140800 blocks
+ '[' 0 -ne 0 ']'
Install system fs image: out/target/product/generic/system.img
out/target/product/generic/system.img+ maxsize=588791808 blocksize=2112 total=576716800 reserve=5947392
[~/projects/android_kitkat]$

3. Install eclipse and adt
http://developer.android.com/sdk/installing/installing-adt.html

4. Install android sdk
https://developer.android.com/sdk/index.html

5. Android SDK Manager
update API 19

6. Change your output images.
$ [~/android-sdks/system-images/android-19]$ cd armeabi-v7a/
[~/android-sdks/system-images/android-19/armeabi-v7a]$ ls
build.prop   NOTICE.txt   source.properties  userdata.img
kernel-qemu  ramdisk.img  system.img

7. Make avd




8. Run AVD


2013년 12월 9일 월요일

Exynos4412 Android-4.1.2 (Beta 2.1.0) Release

29-Jun-2014
1. fix EDID
2. enable MTP
3. fix uboot to enable cm bootstrap.

Download for eMMC user.

https://www.dropbox.com/sh/vjplveim5ieq91e/jUSKWcmjw4

How to connect ODROID to Ubuntu using MTP
http://codewalkerster.blogspot.kr/2014/01/how-to-connect-odroid-to-ubuntu-using.html

19-Dec-2013
1. enable /dev/CEC node.
2. enable HDMI-EDID/CEC

https://www.dropbox.com/s/7nhmnnssuekk50n/odroidu-1.9.0.zip


http://dn.odroid.com/Android_Beta_1.9.0/

수정사항
1. Q/Q2 부팅 시 죽는 문제 수정
2. SD/eMMC 를 하나의 커널로 통합.
3. ODROID-U2를 ODROID-U로 변경

업그레이드 방법
1. X/X2/Q/Q2는 기존 방법처럼 아래와 같이 진행
http://codewalkerster.blogspot.kr/2013/05/odroid-update-and-install-gms.html

2. U2는 microSD일 경우 아래 이미지를 write하고 부팅
http://dn.odroid.com/Android_Beta_1.9.0/U/SD/
eMMC일 경우 아래 이미지를 write 하고 부팅 하면 자동 복구 후 부팅
http://dn.odroid.com/Android_Beta_1.9.0/U/eMMC_installer/

Google Mobile Service(GMS) 설치는 아래와 같이 One Click gapps installer에서 4.1.2를 선택.
http://codewalkerster.blogspot.kr/2013/11/universal-1-click-gapps-installer-for.html

2013년 11월 24일 일요일

ODROID adb/fastboot driver 설치 하기(Windows 7 64bit)

드라이버를 다운 받습니다.


'장치 관리자'를 실행합니다.


'Full Android on SMDK4412'를 선택합니다.
'드라이버 업데이트'를 클릭합니다.



'컴퓨터에서 드라이버 소프트웨어 찾아보기'를 선택합니다.


'컴퓨터의 장치 드라이버 목록에서 직접 선택'을 선택합니다.


'ADB Interface'를 선택합니다.


'ADB Testing Interface'를 선택합니다.


'디스크 있음' 선택합니다.


다운 받은 파일을 압축 풀고 그 폴더를 선택합니다.


windows 7 64bit의 경우 amd64 폴더의 android_usb.inf 선택하고 windows xp(32bit)인 경우 x86의 android_usb.inf를 선택합니다.








fastboot로 연결 시 드라이버(Android 1.0)를 다시 설치 하셔야 합니다.
아래 링크에서 fastboot와 driver를 받으실 수 있습니다.





2013년 11월 18일 월요일

Universal 1-Click GApps Installer for ODROID

If you are using ODROID-C1/C2, try this method. Does not need gapps installer app anymore.
















for ODROID-C2
http://codewalkerster.blogspot.kr/2013/11/universal-1-click-gapps-installer-for.html

for Lollipop Android-5.x (CM-12.1 Unofficial Version)
http://dn.odroid.com/GAPPS/GAppsInstaller_lollipop.apk
http://codewalkerster.blogspot.kr/2015/06/how-to-install-gappsinstallerlollipop.html

for KitKat Android 4.4.x
http://dn.odroid.com/GAPPS/GAppsInstaller_kitkat.apk

for JellyBean Android 4.2.x or Android 4.1.x
http://dn.odroid.com/GAPPS/GAppsInstaller_jellybean.apk







----------------------------------------------------------------------------------------------------
Updated GAppsInstaller app.(Apr/23/2015)

http://forum.odroid.com/viewtopic.php?f=113&t=11854&start=50
----------------------------------------------------------------------------------------------------


http://forum.odroid.com/viewtopic.php?f=60&t=2769

Universal 1-Click GApps Installer

install last official android firmware

Run web browser.



Visit web site.
http://forum.odroid.com/viewtopic.php?f=60&t=2769&sid=ebf9b5b027ba544d5a5b262bdeef04db


 Down load Universal 1-Click GApps Installer.

for JellyBean(android-4.1.2 and 4.2.2)

http://dn.odroid.com/GAPPS/GAppsInstaller_jellybean.apk




Run Ultra explorer.
Go to Downloads folder.


Click app long and "Open As"



Select File.


Select Package Installer.





Run GApps Installer.


Get su permission.


Select Gapps for Android version.


App is finished to install,  automatically restarted system.

2013년 10월 25일 금요일

android init에서 service를 trigger 시키기

service insmod_ax88179 /system/bin/insmod /system/lib/modules/ax88179_178a.ko
    class core
    user root
    group root
    oneshot
                 
service insmod_smsc95xx /system/bin/insmod /system/lib/modules/smsc95xx.ko  
    class core
    user root
    group root
    oneshot


위와 같이 smsc95xx, ax88179_178a driver를 올리는 서버스를 만들어 먼저 ax88179_178a를 먼저 insmod하여 eth0를 ax88179_178a에 할당하고 싶었다.

하지만 라인 순서와 상관없이 서비스가 실행 된다.

그래서 하나의 service가 끝나고 다른 service를 trigger 시킬 방법을 찾아 보았다.

조건에 의해 실행된 서버스를 oneshot에서 disabled로 자동 실행이 되지 않도록 수정한다.
service insmod_smsc95xx /system/bin/insmod /system/lib/modules/smsc95xx.ko  
    class core
    user root
    group root
    disabled
    oneshot

그리고 첫번째 service가 실행되었는지 확인 할 수 있는 변수와 두번째 service를 실행 시킬 방법은 아래와 같다.

on property:init.svc.insmod_ax88179=stopped
    start insmod_smsc95xx

이렇게 고치면 ax88179_178a.ko가 먼저 insmod가 되고 eth0로 할당 받을 수 있다.

2013년 9월 23일 월요일

set static IP for ODROID-XU by terminal.

shell@android:/ # su
shell@android:/ # ifconfig eth0 xxx.xxx.xxx.xxx up
shell@android:/ # route add default gw xxx.xxx.xxx.xxx dev eth0
shell@android:/ # setprop net.dns1 xxx.xxx.xxx.xxx

shell@android:/ # netcfg                                                      
sit0     DOWN                                   0.0.0.0/0   0x00000080 00:00:000
eth0     UP                              xxx.xxx.xxx.xxx/24  0x00001043 86:ae:218
lo       UP                                   127.0.0.1/8   0x00000049 00:00:000
wlan0    UP                                192.168.0.88/24  0x00001043 00:08:2bf
ip6tnl0  DOWN                                   0.0.0.0/0   0x00000080 00:00:000

2013년 9월 15일 일요일

Portrait screen for ODROID-XU

edit /system/build.pro
add this line.

persist.demo.hdmirotation=portrait



edit /sdcard/boot.ini

ODROIDXU-UBOOT-CONFIG

setenv fb_x_res     "1080"
setenv fb_y_res     "1920"

setenv vout         "hdmi"

setenv left     "56"
setenv right    "24"
setenv upper    "3"
setenv lower    "3"
setenv hsync    "14"
setenv vsync    "3"

setenv hdmi_phy_res "1080"

setenv led_blink    "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...