2013年3月31日星期日

[RPi] 在Raspberry Pi上使用HDMI轉VGA接頭

話說家中總是有老舊螢幕還是使用VGA介面(D-Sub),那就需要買一個HDMI轉VGA的接頭,再修改Raspberry Pi的/boot/config就可以使用了

簡單說明一定要改的地方有hdmi_drive=2表示強制從HDMI輸出,hdmi_group=2和hdmi_mode=16這兩個參數就視螢幕的解析度調整了

詳細參數可參考官網
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1024
#framebuffer_height=768

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=16

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
arm_freq=1000

# for more options see http://elinux.org/RPi_config.txt
gpu_mem=64
core_freq=500
sdram_freq=600
over_voltage=6

2013年2月25日星期一

[RPi] Disable Screen Blanking in X Window

如果想要把Raspberry Pi當作展示機, 那Raspbian預設10分鐘沒動作畫面就會暗掉就蠻令人困擾的, 通常修改xinitrc就會有作用
$ sudo vi -p ~/.xinitrc /etc/X11/xinit/xinitrc
xset s off         # don't activate screensaver
xset -dpms         # disable DPMS (Energy Star) features.
xset s noblank     # don't blank the video device
exec /etc/alternatives/x-session-manager      # start lxde
如果再不行的話就要再lightdm.conf新增一個屬性了
$ sudo vi /etc/lightdm/lightdm.conf
[SeatDefaults]
xserver-command=X -s 0 -dpms

reference:
* Disable screen blanking in X-Windows on Raspbian
* How do I prevent the screen from going blank?

2013年1月6日星期日

[Embedded] 最近很夯的開發板

最近跟一個朋友聊天, 他推薦了幾個最近很夯的開發板
1.Cubieboard, 由cubieTech所製作
2.UNO.Net, 國人自製

目前我的結論是, 好玩的東西太多了, 可是不同的東西的SDK常常都不相同, 每一種都買來玩玩看當然可以, 可是這就會花很多的時間在重複性的事情(比如說建立環境或是軟硬體整合), 但是產品最重要的價值是在解決問題, 而不是只是玩玩看而已, 希望大家不要陷入這種迷失, 共勉之

2012年12月9日星期日

[RPi] Setting up Wifi with Raspberry Pi

要購買Raspberry Pi的週邊最好是參考這裡,才不會踩到地雷,買到不支援的東西,話說我是買ASUS USB-N10當作無線網路卡,畢竟總是要支持一下國貨

在Raspbian的環境設定無線網路的方法一個是透過GUI,也就是桌面上的WiFi Config,啟動後選擇Adapter為wlan0,然後點選下面的scan,搜尋完畢後點選適合的WiFi,選擇適合的加密方式與輸入正確的金鑰,最後connect就可以快樂的連上網路了

不然就是要透過command,流程大概是這樣
1.更新套件
$ sudo apt-get update && sudo apt-get upgrade

2.檢查USB是否有偵測到新的裝置(用的是RTK RTL8188SU的晶片)
$ lsusb
...
Bus 001 Device 004: ID 0b05:1786 ASUSTek Computer, Inc. USB-N10 802.11n Network Adapter [Realtek RTL8188SU]
...

3.檢查是否有載入無線網路模組
$ lsmod
Module                  Size  Used by
...
r8712u                165407  0 
...

4.安裝wireless工具
$ sudo apt-get install wireless-tools

5.根據加密方式做適合的設定 如果是WEP加密
$ sudo vi /etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
wireless-essid <ssid>
wireless-key s:<password>

#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
wireless-power off
iface default inet dhcp

如果是WPA加密
$ sudo vi /etc/network/interfaces
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid <ssid>
wpa-psk s:<password>

另外一種方法是安裝WPA的設定工具(在有線網路的情況下)
$ sudo apt-get install wpasupplicant

然後就可以透過不同的設定檔管理不同的加密WiFi(要加雙引號)
$ sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="YOUR SSID"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="YOUR PASSWORD"
}

指定無線網卡讀取適當的設定檔
$ sudo vi /etc/network/interfaces
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

最後,有幾個指令常常用到:
看無線網卡讀到的無線網路資訊,可以確認無線網卡是否有作用
$ iwlist wlan0 scan
重新向DHCP Server要IP
$ dhclient wlan0

 reference:
* WiFi on Rasspberry Pi with ASUS USB N10
* Setting up Wifi under Debian on Raspberry Pi

2012年11月30日星期五

[RPi] 在e絡盟購買Raspberry Pi

e絡盟的Raspberry Pi購買網頁今天做了些更動,以後個人用戶將只能透過代理商購買,企業用戶將不在此限制範圍,看來未來台灣地區的個人買家將被一統江湖了

2012年10月22日星期一

[RPi] Firmware of Raspberry Pi 512MB

最近拿到Rev2的板子,是512MB的,可是讀出來的資訊不太正確,而且還是只能用256MB的RAM
但根據文件的說明,Revision應該要顯示13/14/15,可是現在讀出的是0005

板子上原來裝的是2012-09-18-wheezy-raspbian版本的image,在討論串說更新到最新版本的firmware就能讀到正確的硬體資訊,更新firmware的步驟如下:
0.安裝git-core
$ sudo apt-get install git-core

1.更新套件
$ sudo apt-get update; sudo apt-get upgrade

2.下載rpi-update的script並複製到/usr/bin
$ sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update

3.更改權限為可執行
$ sudo chmod +x /usr/bin/rpi-update

4.執行rpi-update
$ sudo rpi-update

5.執行完畢後將在root底下產生一堆檔案
$ sudo ls -la /root/.rpi-firmware

以下步驟要用root權限執行
6.切到boot目錄
$ cd /boot

7.刪除一堆檔案(最新版本的firmware已經不需要這步驟)
$ sudo rm arm*.elf $ sudo rm loader.bin

8.將更新完的binary和data複製到/boot
$ sudo cp /root/.rpi-firmware/start.elf . $ sudo cp /root/.rpi-firmware/fixup*.dat .

9.新增一行gpu使用的memory,例如64
$ sudo vim config.txt
gpu_mem=64

10.重新開機就可以了
$ sudo reboot

可以看到Revision變成000f(16進位的15),而記憶體也變成438MB了,因為有部份拿去給GPU使用了


reference:
* Raspberry Pi Model B Revision 2.0 (512MB) Changes
* Test Whether Raspberry Pi Has 512MB RAM

2012年10月14日星期日

[阿宅專區] SanDisk SDHC SD記憶卡

最近在玩Raspberry Pi所以需要購買SD卡測試不同的image,因為平常在光華商場買習慣了,也沒有特別上網比價,今天一比才發現我的頭真是太大了!!! 以下都是SanDisk的:

* 16GB Ultra 30MB/s Class 10: 我買360元, 網路價279元
* 16GB Extreme 45MB/s Class 10: 我買580元, 網路價465元
* 16GB Extreme Pro 95MB/s Class 10: 問到16xx元, 網路價1183元