星期一, 一月 02, 2012

testing UART ports

In one shell:

cat > /dev/ttyS0 
type some characters here. Newlines may be required to flush buffers. Ctrl-D to close.

In another shell:
cat /dev/ttyS1

You may want to configure the ports using setserial if it is available.

星期四, 十一月 24, 2011

compile lirc-modules on squeeze failed

scripts/Makefile.build:44: /usr/src/linux-headers-2.6.32-5-common/scripts/basic/Makefile: No such file or directory

解決方法
sudo apt-get source linux-kbuild-2.6

/usr/src/modules/lirc-modules/lirc_i2c.c:399: error: unknown field ‘id’ specified in initializer

解決方法
sudo dpkg-reconfigure lirc-modules-source
將 i2c 拿掉
或是修改 lirc_i2c.c
a/drivers/lirc_i2c/lirc_i2c.c
+++ b/drivers/lirc_i2c/lirc_i2c.c
@@ -399,8 +399,8 @@ static struct i2c_driver driver = {
.name = "i2c ir driver",
},
#endif
- .id = I2C_DRIVERID_EXP3, /* FIXME */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
+ .id = I2C_DRIVERID_EXP3, /* FIXME */
.attach_adapter = ir_probe,
.detach_client = ir_remove,
#else

最後
sudo m-a -t build lirc-modules

星期日, 十月 30, 2011

find the icon of google chrome in Debian

After install google chrome from google dl.

I can't find the icon of google chrome.

Then I found this
http://forums.debian.net/viewtopic.php?f=6&t=53346#p386886

Just copy a file.
$ sudo cp /opt/google/chrome/google-chrome.desktop /usr/share/applications/

Then the icon appear.

星期二, 十月 25, 2011

New mini-ITX PC

終於將老婆新電腦的零件都買齊了。 CPU : INTEL i3-2125 MB : GA-H61N-USB3 RAM : A-DATA 4GB DDR3-1333 HDD : Hitachi 2.5 SATA2 500GB 16M 7200RPM HTS727550A9E364 CASE : SEED TWINSYS Main Module + 薄型 DVD 燒錄器 SATA KB : Microsft Comfort Curve Keyboard 2000 小小機殼整線真是累人,弄了一個半小時才裝好。 快樂地把 XP 光碟放進去安裝,沒想到居然跳藍白畫面,代碼是 0x0000007b 。 查到這個廢物,(微軟果然還是只有鍵盤能讓我滿意啊...) http://support.microsoft.com/kb/324103/zh-tw 反覆試了幾個小時,這期間讓我了解到,原來不是每個 USB 孔都可以用來開機啊... 最後在重燒了一片 XP 光碟、換了一台 USB 外接光碟機,終於進到磁碟分割畫面... 但找不到磁碟機...才知道原來是 XP 光碟裡沒有 INTEL 的 SATA driver... 只好進 BIOS 先把 AHCI disable,重開機後就找到磁碟機了。 在等待安裝的過程,找到下面這一篇教學,說明如何將 INTEL 的 SATA driver 整合進 XP 光碟裡。 http://aps2.toshiba-tro.de/kb0/TSB85017Z0000R01.htm 夜已深,明日再戰...

星期三, 十月 19, 2011

ttyUSB0 removed by brltty


I have an usb-to-uart device with FTDI chip.  After plug in, the dmesg show below message:
[ 5564.288020] usb 3-2: new full speed USB device using uhci_hcd and address 4
[ 5564.484151] usb 3-2: New USB device found, idVendor=0403, idProduct=6001
[ 5564.484155] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5564.484159] usb 3-2: Product: FT232R USB UART
[ 5564.484161] usb 3-2: Manufacturer: FTDI
[ 5564.484164] usb 3-2: SerialNumber: A4008X3f
[ 5564.484282] usb 3-2: configuration #1 chosen from 1 choice
[ 5564.492214] ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
[ 5564.492247] usb 3-2: Detected FT232RL
[ 5564.492249] usb 3-2: Number of endpoints 2
[ 5564.492252] usb 3-2: Endpoint 1 MaxPacketSize 64
[ 5564.492254] usb 3-2: Endpoint 2 MaxPacketSize 64
[ 5564.492257] usb 3-2: Setting MaxPacketSize 64
[ 5564.493216] usb 3-2: FTDI USB Serial Device converter now attached to ttyUSB0
[ 5569.353619] usb 3-2: usbfs: interface 0 claimed by ftdi_sio while 'brltty' sets config #1
[ 5569.356384] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[ 5569.356471] ftdi_sio 3-2:1.0: device disconnected
It was attached to ttyUSB0, but been removed after 5 seconds. seems like removed by brltty.
Here
http://www.plugcomputer.org/plugwiki/index.php/Serial_terminal_program
notes , in this case, remov the brltty.
So,
$ sudo aptitude purge brltty

The issue was gone! :)


星期日, 九月 11, 2011

不同波長紅外線 LED 的應用

摘自:LEDinside
http://www.ledinside.com.tw/ir_led_200807

根據紅外LED晶片的特性,依據不同波長可以得到更廣泛的應用,例如:

1.波長:940nm,適用於遙控器,例如家用電器的遙控器;
2.波長:808nm,適用於醫療器具,空間光通信,紅外照明,固體雷射器的泵浦源
3.波長:830nm,適用於高速路的自動刷卡系統(夜視系統最好,可以看到管芯上有一點紅光,效果比850nm要好)
4.波長:840nm,適用於攝像機 彩色變倍紅外防水
5.波長:850nm,適用於攝像頭(視頻拍攝) 數位攝影,監控,樓寓對講,防盜報警,紅外防水
6.波長:870nm,適用於商場,十字路口的攝像頭