顯示具有 pi 標籤的文章。 顯示所有文章
顯示具有 pi 標籤的文章。 顯示所有文章

2013年12月19日 星期四

ubuntu networking interface 設定


使用情境:
  • eth0固定網卡 / wlan0無線網卡 各一
  • 配置固定IP (eth0: 192.168.1.XX / wlan0: 192.168.1.YY)
  • private network : 192.168.1.XXX
  • gateway : 192.168.1.1

/etc/network/interfaces 設定檔內容:

auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.1.XX
netmask 255.255.255.0
gateway 192.168.1.1

allow-hotplug wlan0
iface wlan0 inet static
wpa 2
wpa-ssid <YOUR_SSID>
wpa-psk <YOUR_PASSWORD>
address 192.168.1.YY
netmask 255.255.255.0
gateway 192.168.1.1


*以上也適用 Raspberry Pi / Wheezy 環境

#

2013年5月8日 星期三

Raspberry Pi 安裝 USB Bluetooth Dongle

1. 安裝藍芽相關程式

> sudo apt-get update
> sudo apt-get upgrade
> sudo apt-get autoremove
> sudo atp-get install bluetooth bluez-utils blueman


2. 確認藍芽是否正常運作

> lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0a5c:200a Broadcom Corp. BCM2035 Bluetooth dongle

> /etc/init.d/bluetooth status
[ ok ] bluetooth is running.


3. 掃描其他藍芽裝置

> hcitool scan

Scanning ...
        78:A3:*:*:*:22       iphone4  (找到開啟藍芽的iPhone4, 您掃描到的裝置MAC Address 78:A3:*:*:*:22應該不同)


4. Ping一下其他藍芽裝置 (本例為iPhone4)

> sudo l2ping -c 3  78:A3:*:*:*:22 
(輸入掃描到的裝置MAC Address 78:A3:*:*:*:22) 

Ping: 78:A3:B4:97:A0:22 from 00:02:*:*:*:D4 (data size 44) ...
44 bytes from 78:A3:*:*:*:22 id 0 time 204.29ms
44 bytes from 78:A3:*:*:*:22 id 1 time 89.52ms
44 bytes from 78:A3:*:*:*:22 id 2 time 80.71ms
3 sent, 3 received, 0% loss

#