2017년 1월 4일 수요일

How to use GPIO key in ODROID-C2(android).

How to use GPIO key in ODROID-C2(android).



Builtin GPIO polled driver.

CONFIG_KEYBOARD_GPIO_POLLED

linux keycode table

http://www.comptechdoc.org/os/linux/howlinuxworks/linux_hlkeycodes.html

F76541 c165[18~ 1b 5b 31 38 7e[31~ 1b 5b 33 31 7e[18~ 1b 5b 31 38 7e
F86642 c266[19~ 1b 5b 31 39 7e[32~ 1b 5b 33 32 7e[19~ 1b 5b 31 39 7e
F96743 c367[20~ 1b 5b 32 30 7e[33~ 1b 5b 33 33 7e[20~ 1b 5b 32 30 7e
F106844 c468[21~ 1b 5b 32 31 7e[34~ 1b 5b 33 34 7e[21~ 1b 5b 32 32 7e

Expansion Connectors

http://odroid.com/dokuwiki/doku.php?id=en:c2_hardware#expansion_connectors


https://github.com/hardkernel/linux/commit/6c5f6929b5f351d54929b6ba3921db7d48115a4f

edit arch/arm64/boot/dts/meson64_odroidc2.dts

gpio_keys_polled {
compatible =
"gpio-keys-polled";
#address-cells = <1>;
#size-cells = <0>;
poll-interval = <100>;
autorepeat;
button@1 {
label = "GPIO Key F7";
linux,code = <65>;
gpios = <&gpio GPIOX_19 1>;
};
button@2 {
label = "GPIO Key F8";
linux,code = <66>;
gpios = <&gpio GPIOX_11 1>;
};
button@3 {
label = "GPIO Key F9";
linux,code = <67>;
gpios = <&gpio GPIOX_9 1>;
};
button@4 {
label = "GPIO Key F10";
linux,code = <68>;
gpios = <&gpio GPIOX_7 1>;
};
};

$ cd kernel
$ make odroidc2_defconfig
$ make -j8
$ adb reboot fastboot
$ fastboot flash dtb arch/arm64/boot/dts/meson64_odroidc2.dtb




You can receive key event(scancode) without keycode.

https://github.com/codewalkerster/android_device_hardkernel_odroidc2/commit/7b49c29162c884491df262a3ec3d96f08942e231

Add keycode in system/usr/keylayout/Vendor_0001_Product_0001.kl.

key 75 F3
key 76 F4
key 77 F5
key 64 F6
key 65 F7
key 66 F8
key 67 F9
key 68 F10
key 69 F11


Android will fill keycode matched scancode in key event.

2016년 12월 28일 수요일

How to switch front/back camera on ODROID


ODROID-C2 lollipop support USB Webcam like front camera.

The camera preview is mirrored.




You can switch it back camera.

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

add this
rw.camera.usb.faceback=true

save and reboot system.
The camera preview is not mirrored.

2016년 12월 16일 금요일

How to install apps into SD card on ODROID-C2 marshmallow.

Install android 6.0.1 into 8GByte eMMC.
5GByte userdata.


Install many apps.


storage space running out.


Insert SD Card.


Use as internal storage.





Enable sdcard like internal storage.


Settings -> Apps -> Storage


Move "Angry Birds" to "SanDisk SD card".


2016년 11월 25일 금요일

overclock CPU and DDR clock for ODROID-C2

1. CPU 1.5GHz, DDR Clock 912MHz


2. CPU 1.7GHz, DDR Clock 912MHz

http://odroid.com/dokuwiki/doku.php?id=en:c2_set_cpu_freq

open boot.ini.


# setenv max_freq "2016"  # 2.016GHz
# setenv max_freq "1944"  # 1.944GHz
# setenv max_freq "1944"  # 1.944GHz
# setenv max_freq "1920"  # 1.920GHz
# setenv max_freq "1896"  # 1.896GHz
setenv max_freq "1752"  # 1.752GHz
# setenv max_freq "1680"  # 1.680GHz
# setenv max_freq "1656"  # 1.656GHz
#setenv max_freq "1536"  # 1.536GHz





3. CPU 1.7GHz, DDR Clock 1104MHz

http://odroid.com/dokuwiki/doku.php?id=en:c2_adjust_ddrclk

# su
# mount -o rw,remount /
# wget http://dn.odroid.com/S905/BootLoader/ODROID-C2/c2_update_ddrclk_android.sh
# chmod 755 ./c2_update_ddrclk_android.sh
# ./c2_update_ddrclk_android.sh 1104
# reboot


2016년 10월 25일 화요일

How to enable YouTube quality 720P on ODROID.

If you use ODROID-C1+ version 4.4.x, You can't watch higher than 360P quality in YouTube.


Open Terminal app and edit build.prop


$ su
# mount -o rw,remount /
# vi /build.prop

ro.build.version.release=4.4.2 -> ro.build.version.release=5



Save and reboot.

Now enable 720p quality.


2016년 10월 19일 수요일

How to access internet by Bluetooth tethering on ODROID without Wi-Fi network.

1. Turn on Bluetooth tethering on Your smartphone

2. edit /init.odroid2.rc
$ su
# mount -o rw,remount /
# vi /init.odroid2.rc

Add service dhcpcd_bt-pan

diff --git a/init.odroidc2.rc b/init.odroidc2.rc
index 92362aa..5adf868 100644
--- a/init.odroidc2.rc
+++ b/init.odroidc2.rc
@@ -417,6 +417,11 @@ service dhcpcd_p2p /system/bin/dhcpcd -aABKL
     disabled
     oneshot

+service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL
+    class main
+    disabled
+    oneshot
+
 service iprenew_wlan0 /system/bin/dhcpcd -n
     class main
     disabled

#reboot

3. Turn on Bluetooth on ODROID-C2.


4. Check 'Internet access'


5. Now enable to access internet without Wi-Fi network.




2016년 9월 30일 금요일

How to use ODROID like B/T speaker.

ODROID + HDMI monitor <-- B/T --> Smartphone
ODROID(car PC) <-- B/T --> Smartphone


Open Terminal Emulator.


$ su


# mount -o rw,remount /


# vi /build.prop


Add and save.
#Bluetooth Audio A2dp Sink    
persist.service.bt.a2dp.sink=true

Reboot system.

Now enable 'Media audio' item.


Connect your smartphone to ODROID via B/T and play music.