美文网首页
Mac + Raspberry Pi + ADXL355Z +

Mac + Raspberry Pi + ADXL355Z +

作者: 马山牧 | 来源:发表于2019-08-18 10:16 被阅读0次

    Raspberry Pi 系统

    下载 Raspberry Pi 系统镜像: https://www.raspberrypi.org/downloads/raspbian/

    使用 balenaEtcher 烧录 SD 卡,导入无后缀 ssh 文件;

    Mac 连接树莓派

    Mac 第一次连接树莓派有两种方式,有路由器 和 无路由器;
    无路由器 网线连 Mac:

    Open Mac Network Preferences...
    
    $ arp -a
    
    bridge100
    
    $ ssh pi@192.168.x.x
    
    sudo passwd pi
    sudo passwd root
    

    安装 Tightvncserver 连接树莓派

    sudo apt-get update
    sudo apt-get install tightvncserver
    
    tightvncserver
    
    vncpasswd
    

    安装 vim

    sudo apt-get install vim
    

    配置 Wi-Fi

    sudo vim /etc/wpa_supplicant/wpa_supplicant.conf
    
    network={
            ssid="ssid_name"
            key_mgmt=WPA-PSK
            psk="password"
    }
    

    自动上报公网 ip

    挂载 u 盘,拷入程序

    mkdir usbdisk
    sudo mount -o rw /dev/sda1 /home/pi/usbdisk
    

    安装 i2c-tools、python-smbus

    sudo nano /etc/modprobe.d/raspi-blacklist.conf
    
    blacklist spi-bcm2708
    blacklist i2c-bcm2708
    
    sudo nano /etc/modules
    
    snd-bcm2835
    i2c-bcm2708
    i2c-dev
    
    sudo apt-get update
    sudo apt-get install i2c-tools python-smbus
    
    sudo i2cdetect -y 1
    
    sudo raspi-config
    

    更换镜像

    sudo nano /etc/apt/sources.list
    
    deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main contrib non-free rpi
    deb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main contrib non-free rpi
    
    sudo nano /etc/apt/sources.list.d/raspi.list
    
    deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main
    deb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main
    
    sudo apt-get update
    sudo apt-get upgrade
    

    安装 LeanCloud SDK

    pip3 install leancloud -i http://pypi.douban.com/simple
    sudo apt-get install python3-gevent
    

    Linux ssh:

    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY
    rm -rf ~/.ssh/known_hosts
    

    自动运行

    sudo nano /etc/rc.local
    
    su pi -c "python3 /home/pi/Desktop/ADXL355/mainAll.py &"
    exit 0
    

    安装 scipy

    sudo apt-get install python3-scipy
    

    安装 matplotlib

    sudo apt-get install python3-matplotlib
    

    相关文章

      网友评论

          本文标题:Mac + Raspberry Pi + ADXL355Z +

          本文链接:https://www.haomeiwen.com/subject/rrqrsctx.html