2016-05-17

Copy IR signal through Audio Editor.

Audio wave editor: Audacity (freeware)

A. Record IR
Config: 選擇正確麥克風輸入 --> (Mono) Record --> 麥克風聲音調至最大 --> 採樣率拉高一點 (預設 384000 is OK).

B. 複製一段 IR signal 做為待會新的正弦波參考用.
Operation 1: 軌道 ==> 新增 ==> Mono track
Operation 2: 開啟新軌道後, 下拉左邊音訊軌道 ==> Format 32bits ==> Rate 76,000Hz

D. 新增軌道3, 複製軌道2過來, 選擇 "效果" ==> "倒轉" 產生一個波形與軌道2相反的正弦波.

 E. 合併兩個軌道 (2&3)
Operation: 於軌道2, 選擇 "音訊軌道" ==> "製作立體聲軌道"



2016-04-21

Andriod one two three

1. Capture screenshot through shell command.
    # screencap -p /sdcard/screen.png

2. am [Activity Manager]
    ==> Active default browser and go to "google" directly.
    # am start -a android.intent.action.VIEW -d http://www.google.com

    ==> Active Gallery3d to play movie file.
    # am start -n com.android.gallery3d/.app.MovieActivity -d file:////sdcard/Movies//movie.ts

    ==> Open a JPEG file.
    # am start -a android.intent.action.VIEW -d file:////data/worktmp//taiwan.jpg -t image/jpeg

    ==> Play a MP3 file.
    # am start -a android.intent.action.VIEW -d file:///data/worktmp/1kTone.mp3 -t audio/mp3

3. Shutdown
    # reboot -p
                  -p: power off
    # busybox poweroff
    # am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN --ez KEY_CONFIRM true --activity-clear-task

4. Reset to factory default.
    # am broadcast -a android.intent.action.MASTER_CLEAR

2016-03-17

LIRC, IR Transmitter [ irsend ]

Schematic (with Raspberry Pi)

(yellow, 3.5mm middle) PIN 17 [3.3V] ==> + IR LED - ==> [GND] PIN 06 (black, 3.5mm peak)

# irsend SEND_ONCE SHM38K KEY_OK

IRSEND OPTION
-- Help
-h --help display usage summary
-v --version display version
-d --device use given lircd socket [/var/run/lirc/lircd]
-a --address host[:port] connect to lircd at this address
-# --count n send command n times

-- DIRECTIVE can be:
SEND_ONCE - send CODE [CODE...] once
SEND_START - start repeating [CODE]
SEND_STOP - stop repeating [CODE]
LIST - list configured remote items
SET_TRANSMITTERS - set transmitters NUM [NUM...]
SIMULATE - simulate IR event

2016-03-16

LIRC, IR key mapping & Learning

# irrecord –d /dev/lirc0 lircd.conf

Pi, IR Receiver


VCC3.3V (Pin-01) ------------- IR receiver ( from left Pin-03)
GROUND ----------------------- IR receiver ( from left Pin-02)
GPIO-18 (Pin-12) -------------- IR receiver ( from left Pin-01)

2016-03-15

Linux, oneTwoThree

001- tar.bz2
tar jxvf filename.tar.bz2

002- USB-to-Serial ==> CentOS-5.5 not support HL-340 driver by default. Suggest to used PL2303.
# lsusb
# dmesg




003- Find the path.
# whereis wish
wish: /usr/bin/wish8.5


004- dmesg
# dmesg | more ==> Show event by pages.
# dmesg -c ==> clear previous event.

005- kill (find out process id and then kill)
# kill -9 $( ps -ef | grep wdt | awk '{ print $2 }')

006- pgrep & pkill (list process name & kill)
# pgrep -l  [process name]
# pkill [process name]



2016-03-11

Pi, NFS server

NFS server (ip 10.1.1.16)
# apt-get install nfs-kernel-server nfs-common
# vim /etc/exports
     /var/tmp *(ro,sync)
# /etc/init.d/nfs-kernel-server stop
# rpcbind
# /etc/init.d/nfs-kernel-server start