树莓派使用小记

来源:互联网 发布:中文数据库有哪些 编辑:程序博客网 时间:2024/05/20 00:53

安装系统

烧录镜像,略

设置静态IP

 $ sudo nano /etc/dhcpcd.conf

增加:

interface eth0
static ip_address=192.168.0.33/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

interface wlan0
static ip_address=192.168.0.3/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

 $ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

增加:

network={
ssid=”BZZWAN”
psk=”bigzhizhixxoo”
key_mgmt=WPA-PSK
}

安装中文支持

安装中文字体

$ sudo apt-get install ttf-wqy-zenhei

安装拼音输入法

$ sudo apt-get install scim-pinyin

进入菜单配置

$ sudo raspi-config

选择change_locale,在Default locale for the system environment:中选择zh_CN.UTF-8

命令行修改别名

$ vi ~/.bashrc

增加:

alias ll=’ls -l’

修改软件源

  1. 查找找到最新的软件源镜像:
    http://www.raspbian.org/RaspbianMirrors,
  2. 修改/etc/apt/sources.list

    $ cd /etc/apt
    # 备份
    $ cp sources.list sources.list_back
    # 修改
    $ sudo nano sources.list
  3. 更新软件源和软件

    # 更新软件源
    $ sudo apt-get update
    # 更新软件
    $ sudo apt-get upgrade

内核模块编译环境

$ uname -a

Linux raspberrypi 4.4.21-v7+ #911 SMP Thu Sep 15 14:22:38 BST 2016 armv7l GNU/Linux

$ sudo apt-cache search kernel-headers

kernel-package - utility for building Linux kernel related Debian packages
linux-libc-dev - Linux support headers for userspace development
raspberrypi-kernel-headers - Header files for the Raspberry Pi Linux kernel

$ sudo apt-get install raspberrypi-kernel-headers

将在/usr/src目录下生成两个文件夹linux-headers-4.4.21+ 和 linux-headers-4.4.21-v7+

BCM2835 C Library 安装

$ wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.52.tar.gz  
$ tar xvzf bcm2835-1.52.tar.gz   
$ cd bcm2835-1.52  $ ./configure  $ make  $ sudo make check   $ sudo make install  

wiringPi安装

git clone源码,进入目录后编译并安装

$ git clone git://git.drogon.net/wiringPi$ cd wiringPi$ ./build

读取所有引脚定义

$ gpio readall

WiringPi中的函数类似于Arduino的wiring系统:
https://github.com/WiringProject

重启

$ sudo reboot
原创粉丝点击