跳到主要内容

树莓派

记事

买了以下,共计240,树莓派本身180多

  • Raspberry Pi 2 Modle B
  • 通用简装型透明外壳带静音风扇
  • 面包板配套
    • 40P排线
    • T字型扩展板
  • 40P彩色杜邦线 母对母
  • 5MM LED 发光二极管 白发红
  • 模块
    • DHT11 温湿度传感器,via Python使用正常
    • HC-SR04 超声波传感器
    • USB转TTL PL2303HX模块 串口 STC单片机下载线

软件

  • Fritzing
  • GPIO
  1. Broadcom
  2. WiringPi

特殊说明

  • 没插SD卡是,显示器是没有反应的
  • 电源 5V 2A
  • 默认的用户名是pi,密码是raspberry

配置

Mac写入镜像

  1. df --h
  2. sudo diskutil unmount /dev/disk1s1
  3. sudo dd bs=1m if=2012-06-15-wheezy-raspbian.img of=/dev/YOURDISKNAME

Windows写入镜像

  1. Win32 Disk Imager

开启root​

// 设置 root 账号的密码,会让你输入两次新密码 sudo passwd root

// 启用 root 账号登录 sudo passwd --unlock root

换源

设置静态 IP 地址

  1. vi /etc/network/interfaces
  2. 如果你要设置的是有线网卡的 IP 地址,那么把 eth0 的 dhcp 改成 static 然后在下一行追加 IP 信息,结果大概如下:
iface eth0 inet static
address 192.168.1.200 # 设定的静态IP地址
netmask 255.255.255.0 # 网络掩码
gateway 192.168.1.1 # 网关

如果你要设置的是无线网卡的,那么除了把 wlan0 的 dhcp 改成 static 之外,还需要填写无线网的名称和密码,编辑后的结果大概如下:

iface wlan0 inet static wpa-ssid Your_Wifi_SSID wpa-psk Your_Wifi_Password address 192.168.1.200 # 设定的静态IP地址 netmask 255.255.255.0 # 网络掩码 gateway 192.168.1.1 # 网关 network 192.168.1.1 # 网络地址 #wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

中文化

change_locale -- 更改语言设置。在Locales to be generated: 中,选择en_US.UTF-8和zh_CN.UTF-8。在Default locale for the system environment:中,选择en_US.UTF-8(等启动完机器,装完中文字体,再改回zh_CN.UTF-8,否则第一次启动会出现方块)。

文泉驿的开源中文字体sudo apt-get install ttf-wqy-zenhei

SCIM(Smart Common Input Method )sudo apt-get install scim-pinyin

就会安装拼音输入法,安装完成后,可以直接打入scim激活,下次启动是会自动启动的。快捷键也是Ctrl+空格。或者直接点击右下角图标选择。

树莓派配置

  1. sudo raspi-config
  2. 然后选择change_locale,在Default locale for the system environment:中选择zh_CN.UTF-8。
  3. 然后重启机器,就发现整个环境变成中文的了。

安装谷歌浏览器

#!/bin/bash sudo apt-get install -y --force-yes libnss3 libxrender1 libxss1 libgtk2.0-0 libgconf2-4 sudo mkdir -p /opt/google/ cd /opt/google sudo wget http://distribution-us.hexxeh.net/chromium-rpi/chromium-rpi-r22.tar.gz -O chromium-rpi.tar.gz sudo tar xvf chromium-rpi.tar.gz sudo chown root:root chrome/chrome-sandbox sudo chmod 4755 chrome/chrome-sandbox sudo rm -rf /usr/bin/chrome sudo ln -s /opt/google/chrome/chrome /usr/bin/chrome

  1. chmod a+x install.sh
  2. ./install.sh
  3. chrome -disable-ipv6 &

方法2:sudo apt-get install chromium-browser chromium-l10n

蓝牙

  1. sudo apt-get update # 更新源列表
  2. sudo apt-get upgrade # 升级系统软件
  3. sudo apt-get install bluez pulseaudio-module-bluetooth python-gobject python-gobject-2 bluez-tools
  4. sudo usermod -a -G lp pi
  5. sudo nano **/etc/bluetooth/**audio.conf

排错

Read-only file system

http://askubuntu.com/questions/197459/how-to-fix-sudo-unable-to-open-read-only-file-system

workspace

  1. http://shumeipai.nxez.com/2014/05/18/raspberry-pi-under-mac-osx-to-install-raspbian-system.html 安装
  2. http://shumeipai.nxez.com/2013/10/03/raspberry-pi-temperature-sensor-monitors.html 温度
  3. http://www.codelast.com/?p=4945
  4. 发光二极管
    1. http://www.codelast.com/?p=5155
    2. http://www.wutianqi.com/?p=3629
  5. 服务
    1. Samba服务 http://www.raspicn.com/thread-41-1-1.html
    2. DNS http://wangye.org/blog/archives/858/
  6. 硬件
    1. 蓝牙 http://wangye.org/blog/archives/921/
  7. 显示器
    1. http://wangye.org/blog/archives/762/
  8. 效率
  9. http://www.codelast.com/?p=7858 上报IP地址

Kali

  1. Read-only file system
    1. mount -o remount rw /
    2. df -hT查看类型
  2. shedpkg-reconfigure locales
  3. 任务栏出不来
    1. ctrl+atl+f2,然后登录root用户,然后startx