樹莓派用於裁線

出自TSK WIKI
於 2020年6月3日 (三) 15:08 由 Unknown user​(留言) 所做的修訂 (→安裝樹派)
跳至導覽 跳至搜尋

安裝樹派

  1. 下載Raspbian Buster Lite
  2. 下載克隆軟體balenaEtcher
  3. Raspberry Pi設定
    1. 預設帳密 帳號: pi 密碼: raspberry
    2. 設定指令sudo raspi-config
    3. 變更密碼->1 Change User PW->
      1. 設定時區I2->Change Timezone->Asia->Taipei
      2. 設定WIFI國別->I4 Change Wi-fi Country->TW Taiwan
      3. 設定WIFI帳密->2 Network Options->N2 Wi-fi->輸入WIFI的SSID->輸入WIFI密碼
      4. 設定鍵盤 Layout->4 Localisation Options->I3 Change Keyboard Layout->Generic 104-Key PC->US->English (US)->No AltGr Key->Left Logo Key
      5. 啟動SSH->5 Interfacing Options->P2 SSH->YES
      6. 設定auto login->Boot options
    4. 查詢ip->ip a
    5. 切換python 2.7->3.7
      1. sudo ln -f -s /usr/bin/python3.7 /usr/bin/python
    6. 安裝pip
      1. sudo apt-get install python3-pip
    7. 安裝distutils
      1. sudo apt-get install python3-distutils
      2. sudo apt-get install python3-dev
    8. 安裝pyserial
      1. sudo pip3 install pyserial
    9. 修改/boot/cmdline.txt
      1. dwc_otg.lpm_enable=0 console=ttyAMA0,9600 kgdboc=ttyAMA0,9600 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
    10. 樹莓派串口通信開發環境
      1. pip3 install RPi.GPIO
    11. 安裝git
      1. sudo apt-get update
      2. sudo apt-get install git
    12. nRF24L01模組
      1. Wireless Pi to Pi Python Communication with NRF24L01+
      2. sudo raspi-config
      3. 5.Interfacing options->P4 SPI Enable->restart
      4. On my Pi in python I use that : pipes = [0xF0F0F0F0E1, 0xF0F0F0F0D2] && And On my Arduino Nano : const uint64_t addresses[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
    13. nRF24L01模組2 py-nrf24
      1. pip3 install nrf24
      2. https://github.com/bjarne-hansen/py-nrf24
    14. nRF24L01模組3 Syrex-o/lib_nrf24
      1. enable SPI in raspi-config
      2. wget https://github.com/Gadgetoid/py-spidev/archive/master.zip
      3. unzip master.zip
      4. rm master.zip
      5. cd ./py-spidev-master
      6. sudo python3 setup.py install
      7. mkdir /home/pi/NRF24L01
      8. cd /home/pi/NRF24L01
      9. git clone https://github.com/Syrex-o/lib_nrf24
      10. cd ./lib_nrf24/
      11. cp lib_nrf24.py /home/pi/NRF24L01/
      12. sudo apt-get install python3-rpi.gpio -y

Pi4

  1. hdmi無法顯示時
    1. hdmi_drive=2
    2. hdmi_group=2
    3. hdimi_mode=42