【Qt】Embedded Linux


Qt Embedded 分成 Linux/Windows CE/Symbian 三種,此處指 Linux 平台。

【目的】

  • 基本 Qt Embedded 環境設置。

【基本環境】

  1. Qt Creator。
  2. Ubuntu 套件(libxrender-dev不一定需要)。
    $apt-get install libxtst-dev libxrender-dev libdirectfb-dev

【步驟】

  1. 下載 Qt ,目前使用 4.6.3 ( Qte 和 Qt 的 tarball 都是同一個,可以透過 configure 來選擇)
    $ wget http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.3.tar.gz 
  2. 編譯 Qte 
    $ tar zxvf qt-everywhere-opensource-src-4.6.3.tar.gz
    $ cd qt-everywhere-opensource-src-4.6.3
    $ ./configure -embedded x86 -qvfb
    $ make
    $ sudo make install
  3. 設定給 Qte 的環境變數
    $ vi ~/.bashrc
    加入下面的設定,主要是 QTEDIR/PATH/LD_LIBRARY_PATH 
    export QTEDIR=/usr/local/Trolltech/QtEmbedded-4.6.3
    export PATH=/usr/local/Trolltech/QtEmbedded-4.6.3/bin:$PATH
    export LD_LIBRARY_PATH=/usr/local/Trolltech/QtEmbedded-4.6.3/lib:$LD_LIBRARY_PATH
    之後記得使用 ldconfig 讓設定生效
    $ source ~/.bashrc
    $ ldconfig
  4. 編譯 Qt (因為不確定 make clean 能否清乾淨,所以把之前的 Qte 先移掉,再把 tarball 再直接解 tar)
    $ tar -zxvf qt-x11-opensource-src-4.6.3.tar.gz
    $ cd qt-x11-opensource-src-4.6.3
    $ ./configure
    $ make
    $ sudo make install
  5. 總結上面,目前 Qte/Qt-x11 安裝在下面目錄
    $ cd /usr/local/Trolltech
    $ ls
    Qt-4.6.3  QtEmbedded-4.6.3
  6. 編譯 qvfb,這是一個在 Host 端驗證 Qt 程式的模擬器。
    $ cd qt-x11-opensource-src-4.6.3/tools/qvfb
    $ make
    $ sudo make install
    $ cp qvfb /usr/bin
  7. 在 4.6.2 可能會安裝在底下目錄,若有需要請自行丟入 /usr/bin
    $ cd ~/qt-everywhere-opensource-src-4.6.2/tools/qvfb
    $ sudo make install
    install -m 644 -p "../../bin//`basename ../../bin/qvfb`.debug" "/usr/local/Trolltech/Qt-4.6.2/bin/`basename ../../bin/qvfb`.debug"
    install -m 755 -p "../../bin/qvfb" "/usr/local/Trolltech/Qt-4.6.2/bin/qvfb"
    strip "/usr/local/Trolltech/Qt-4.6.2/bin/qvfb"
    $ cp /usr/local/Trolltech/Qt-4.6.2/bin/qvfb /usr/bin
  8. qvfb ((Qt Virtual FrameBuffer))就是 編出來 Qte 的程式,
    可在 Host 先用 qvfb 測試在 Target 跑起來的樣子。使用方式如下
    $ cd ${QTEDIR}/demos/chip
    $ qvfb &
    $ ./chip -qws
  9. Nokia/Trolltech 也提供一個稱為 QtCreator 的整合性編輯器。以 QtCreator v1.3.1 為例。安裝方式
    $ wget http://get.qt.nokia.com/qtcreator/qt-creator-linux-x86-opensource-1.3.1.bin
    $ chmod 777 qt-creator-linux-x86-opensource-1.3.1.bin
    $ ./qt-creator-linux-x86-opensource-1.3.1.bin
    這樣就會帶出下面視窗進行安裝,一直按著下一步下一步就可以安裝完成了。
    image
  10. 安裝完成之後就開始設定 Qt 的編譯環境讓 Qt/Qte 都可以在這個 IDE 編譯。
    1. 在 QtCreator 點選 Tools | Options… 就會出現下面視窗。
    2. 接著點選 Qt4 | Qt Versions 進入 Qt Version 設定頁面。
    3. 按下右邊的 加號圖示 就可以編輯編譯所需要的參數( Qt Version/QMake Location )。
    4. 新增完之後記得按一下 Rebuild 確認。OK的話就會打勾。
    5. 目前的新增的就是Manual 那邊(上面紅色框框部分)。
    6. 而最後就是選一個目前要用的(下面紅色框框部分,目前是用 4.6.2(Qte)
    7. 如果程式無法在 QtCreator 編譯成功,請留意是否為檔案/目錄 屬性/權限的問題。
      必要時請試試 chmod/chown/chgrp
      image
    8. 若有問題請確認 Projects 這邊,加入 Build Setting 之後記得 active 。
      image
  11. 編譯出來的 Qte 執行檔可以用 gvfb 在 Host 端先行除錯。
    $ /usr/local/Trolltech/Qt-4.6.2/bin/qvfb -depth 16 -width 1024 -height 768&
    $ qte-file -qws
      
  12. 編譯出來的 Qte 執行檔可以用 ldd 來看丟到實際機器所需要帶入的 Lib。
    $ ldd qte-file
    	linux-gate.so.1 =>  (0xb7f09000)
    	libQtGui.so.4 => /usr/local/Trolltech/QtEmbedded-4.6.2/lib/libQtGui.so.4 (0xb758e000)
    	libQtNetwork.so.4 => /usr/local/Trolltech/QtEmbedded-4.6.2/lib/libQtNetwork.so.4 (0xb74a3000)
    	libQtCore.so.4 => /usr/local/Trolltech/QtEmbedded-4.6.2/lib/libQtCore.so.4 (0xb7216000)
    	libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb71f0000)
    	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb70fd000)
    	libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb70d8000)
    	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb70cd000)
    	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb6f7e000)
    	libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb6f79000)
    	libz.so.1 => /usr/lib/libz.so.1 (0xb6f64000)
    	librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb6f5b000)
    	/lib/ld-linux.so.2 (0xb7f0a000)

【問題】

  • 如何編譯給 arm 用的 Qte。

【參考】

【PicPick】Screen Capturer


桌面抓圖軟體,Vista適用。
PicPick Tools - All-in-one Design Tools http://picpick.wiziple.net/features

【功能】
抓取整個視窗:Print Screen
抓取活動視窗:Screen Capture->Active Window; 或 Alt+Print Screen。

image 


類似軟體:MWSnap

【參考】

【InDesign】教學


先收集一些資料

【參考】

【JOCR 】文字辨識軟體


Jocr http://home.megapass.net/~woosjung/Index_Download.html

【安裝】

  1. 須先確定有安裝 MS Office,否則會出現下列訊息。
    image
  2. 記得安裝時要選 MS Office Document Imaging
    image
  3. 接著直接啟動 Jocr 即可。
  4. 以下省略。

【參考】

【Ubuntu】Hardware Summit(TBD)


Ubuntu Hardware Summit Agenda

因為我沒機會去參加,就看一下簡報,記一下筆記(目前還是已 2009 年文件為主)。

P.6 Keynote Ubuntu : Past, Present and Future

  • p.23 Cherrypicking Android, Moblin & Maemo
  • p.25 Interacting with The Community - How 告訴你如何融入社群
  • p.34 Project Structure
  • p.35 Communication

P.41 Networking Architecture

  • p.44 DBUS的角色? Asynchronous Event Signalling
  • p.54 dhclient. via session DBUS?
  • p.55 Modem Manager 如何架構
  • p.57 VPN/OpenVPN/VPNC 如何架構
  • p.60 Station PS support?
  • p.62 Rfkill support may be an issue?
  • p.63 Closed Source Drivers continued
  • p.65 BIOS? rfkill是關於硬體的嗎
  • p.67 New modem implementations ( Modem Manager plugin)

P.69 An Introduction to the ACPI Extra Driver

  • p.74 LEDs – Initialisation, 再研究, 這是比較正規的作法
  • p.80 Communication

P.93 Ubuntu Desktop Roadmap
P.106 QA Process Within OEM Services

  • p.109 Ubuntu QA Workflow
  • p.112OEM QA Workflow 可以給QA部門參考
  • 比較偏QA,沒細看

P.125 給Subversion使用者的Git指南

  • p.130 版本控制的架構, git 屬於distributed架構
  • p.133 Subversion簡介, 說明架構
  • p.136 git簡介-操作指令

(TBD, 先跳過)

P.245 Working with the Linux Kernel Community

  • p.251 How big is the Linux kernel? CodeSize/Porting的參考
  • (TBD)跳過

P.276 Linux Kernel Debugging

  • (TBD)

先停一下,事情好多。

【參考】

  1. Born to MISrepresent 第六集:訪問 Canonical Taiwan 的 Kevin Huang ,談 Ubuntu Taiwan
    http://blog.roodo.com/ystuan/archives/6030209.html

【Ubuntu】USB


【步驟】

  1. 先列出 USB 資料,
    1. 以前都是去 查詢 /proc/bus/usb/devices
      $ cat /proc/bus/usb/devices
    2. Ubuntu 9.10 以後請改用
      $ usb-devices
      $ lsusb (可以加上所需要的參數)
  2. 以 Touch Screen 為例,我們會得到下面資料。
    Manufacture/Product 可能和 lsusb 不同,因為 lsusb 是由 usb.ids 得到裝置名稱。
    1. 範例一(Cando)
      T:  Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
      D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=32 #Cfgs=  1
      P:  Vendor=2087 ProdID=0b03 Rev=02.02
      S:  Manufacturer=Cando     
      S:  Product=11.6 
      C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
      I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
    2. 範例二(eGalax)
      T:  Bus=01 Lev=02 Prnt=02 Port=05 Cnt=03 Dev#=  5 Spd=12  MxCh= 0
      D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
      P:  Vendor=0eef ProdID=72aa Rev=10.00
      S:  Manufacturer=eGalax Inc.
      S:  Product=USB TouchController
      C:  #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
      I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
  3. 裡面的意思 (截錄自網路文章) (tbd)
    1. T is the topology.
      1. Bus indicates which bus the device is on.
      2. Lev level of the device, starting at level 00 for the root hub, level 01 for any device attached to the root hub, level 02 for devices attached to hubs at level 01, and so on
      3. Prnt is the parent device for this device (always 00 for the root hub, and 01 for the devices attached to the root hub).
      4. Port is the port on the parent device, starting at 00 for the first port on each device.
      5. Cnt is indicates what number device this is, at this level, based on the enumeration order within that level of the topology, starting at 01 for the first device.
      6. Dev# indicates what number device this is, irrespective of level, based on the bus enumeration order. This is unique per bus.
      7. Spd indicates what speed this device is running at, in Mbps (either 1.5 or 12 with the current version of USB).
      8. MxCh indicates how many devices can be connected to this device, and is 00 for anything except a hub.
    2. D information from the device descriptor.
      1. Ver indicates which USB specification version the device claims to meet.
      2. Cls indicates which device class the device is claiming to meet, in both hexadecimal and as a string. A Cls entry of 00(>ifc) indicates that the device class specification compliance is interface dependent, and the interface descriptor should be read for device class information.
      3. Sub indicates which sub-class (within the Cls entry), the device meets.
      4. Prot indicates which protocol within a class or sub-class the device claims to meet.
      5. MxPS indicates how big the packets from Endpoint 0 are.
      6. Cfgs indicates how many configurations this device has.
    3. P is information from the device descriptor. 
      1. Vendor indicates the Vendor Identification code for the device.
      2. ProdID indicates the Product Identification code for the device.
      3. Rev indicates the product revision number.
    4. R (目前沒有,先跳過)
    5. S are the vendor and product strings that the device returned.
      1. Manufacturer
      2. Product
    6. C information from the configuration descriptor
      1. #Ifs indicates how many interfaces the device has.
      2. Cfg# indicates which configuration is being described.
      3. Atr is a hexadecimal indication of the device attributes (0x80 for bus-powered, 0x40 for self-powered, 0x20 for remote wake-up capable).
      4. MxPwr is the maximum power draw for this device configuration, in milliamps.
    7. I is information from the interface descriptor.
      1. If #indicates which interface is being described within a given device configuration.
      2. Alt indicates which alternate setting of this interface is being described.
      3. #EPs indicates how many endpoints there are within the alternate setting for this endpoint.
      4. Cls indicates which class the alternate setting of the interface corresponds to, in both hexadecimal and as a character string.
      5. Sub indicates which sub-class the alternate setting of the interface belongs to.
      6. Prot indicates which interface protocol (within a class and sub-class tuple) the alternate setting of the interface conforms to.
      7. Driver indicates which of the various USB drivers has claimed this interface.

【其它】

  • 透過 usbview  顯示 eGalax TouchScreen的資料。 
    image
  • 上面兩個 TouchScreen的 protocol 是不一樣的(一個是02 ,一個是01)
    根據 Device Class Definition for HID 1.11/Device Class Definition for Human Interface Devices (HID)4.3 Protocols/Protocol Codes (http://www.usb.org/developers/devclass_docs/HID1_11.pdf)
    Protocol Code Description
    0 None
    1 Keyboard
    2 Mouse
    3-255 Reserved

【參考】

【Mac】手寫輸入


 

  1. Enable 手寫輸入
  2. Ctrl-Shift-Space

【Ubuntu】桌面管理


awn https://launchpad.net/awn

類似 mac 的 lunchbar,改天來試看看。

【Google】OpenID


在自己網站先弄個 endpoint。

【參考】

【Blog】版面修改(官方方式)


【目的】

  • 修改 blogspot 版面(template)。

【方法】

  • 早期 blogspot 並無提供太多的細部修改方式,所以必須
    1. 去網路上找一些3rd party 的樣板。
    2. 或細部了解 blogspot 模板的語法,調整出自己所需要的樣子。
      [如] Blogger template模板教學課程---CSS外觀解說
      http://01mistery.blogspot.com/2008/08/blogger-template-css.html
  • 目前 blogspot 本身已提供了方便的細部修改方式。

【步驟】

以下以官方所提供方式為例。

  • 範本調整
    • 進入 範本設計工具
      image
    • 範本 頁面會出現許多範本提供挑選
      image
    • 版面配置可提供版面配置方式。裡面的 調整寬度 可以調整版面配置寬度。
      image
    • 進階 頁面提供字型與顏色的調整。
      image
  • 設計調整
    • 若要調整 網誌內容,要從 設計 頁面調整。
      image
    • 進入就能選擇 張貼選項
      image
    • 如果需要移除不需要的小工具,先選擇 編輯符號(紅色框框)
      image
      進入編輯頁面後再點選 移除 按鈕即可移除不需要的小工具。
      image
    • 其它不再贅述。

【一些小工具】

  • 訪客觀察與流量分析
    • Google Page Rank
    • Flag Counter
    • Clustmap
    • IPutilities
    • Google Analytics (官方目前已提供 統計資料 這功能,還蠻詳細的)
      image
  • 其他
  • Link
【參考】
 

Ed32. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com