天天看點

玩樹莓派(raspberry pi) 2/3 raspbian的遇到的一些問題 首先是燒寫鏡像,和安裝電腦系統是一樣的道理。設定鍵盤系統設定禁止休眠鏡像源不可用或逾時

raspberry pi買回來玩了一段時間,現在就記錄一下入門遇到的一些問題吧。

首先是燒寫鏡像,和安裝電腦系統是一樣的道理。

先要有一個制作一個U啟動盤。先将SD卡格式化,再用Win32DiskImager或dd指令将raspberry官方下載下傳的鏡像燒寫進去(這種文檔很多的,随便找一個都可以完成操作)。

使用dd時可能很慢,那麼請用:

sudo dd if=/location/of/raspbian.img of=/dev/rdisk1 bs=1m
      
/dev/rdisk1表示是U盤裝置,最好不用         /dev/disk1,因為後者慢。詳細參見:http://serenity.ee/post/82120938429/mac-os-dd-with-devdisk-vs-devrdisk           

将SD卡插到闆子上就會自動加載鏡像了,最後出來界面如下:

玩樹莓派(raspberry pi) 2/3 raspbian的遇到的一些問題 首先是燒寫鏡像,和安裝電腦系統是一樣的道理。設定鍵盤系統設定禁止休眠鏡像源不可用或逾時

  如果完成上面這些步驟,就可以将鍵盤滑鼠插入闆子上。将無線滑鼠插上去反應很慢,很卡的我換了有線滑鼠就沒事了,網上說可以改變滑鼠的反應時間,後來插入另一個無線滑鼠正常也就沒有管它了。

設定鍵盤

  後面想試下列印一個hello world!發現#include的#号打不出來,出來£,并且輸入@出來了"。我也是一臉懵。後來去群裡面問人才知道更改輸入法,因為UK和US使用的習慣不同。具體操作:

玩樹莓派(raspberry pi) 2/3 raspbian的遇到的一些問題 首先是燒寫鏡像,和安裝電腦系統是一樣的道理。設定鍵盤系統設定禁止休眠鏡像源不可用或逾時
玩樹莓派(raspberry pi) 2/3 raspbian的遇到的一些問題 首先是燒寫鏡像,和安裝電腦系統是一樣的道理。設定鍵盤系統設定禁止休眠鏡像源不可用或逾時

系統設定

  之後想試試自己的闆子的音頻輸出是否正常,接上耳機除了有點雜音意外功能還是正常的,試試藍牙音響,用藍牙配對上了藍牙音響就是沒有聲音,後面也是在網上找到方法可以選擇音頻輸出的選項,找到右上角那個下喇叭右鍵就會出現選項就可以了。也試過通過sudo raspi-config來更改,但是就是找不到藍牙的選項,是以還是通過圖像界面這種方法更改。(吐槽下raspberry的音頻真的不咋地)

玩樹莓派(raspberry pi) 2/3 raspbian的遇到的一些問題 首先是燒寫鏡像,和安裝電腦系統是一樣的道理。設定鍵盤系統設定禁止休眠鏡像源不可用或逾時

  基本外設都可以,看群裡面的人都在研究遠端登入界面,之前學校教育訓練過一些LINUX的皮毛,知道遠端登入挺友善的,可以不用再開一個顯示器給樹莓派用。先試了一個簡單的SSH連接配接,這個是連接配接terminal指令視窗的,如果說想學linux的話這個就足夠了。具體教程網上也是有很多的,記得一點是raspberry預設SSH是DISABLE的,需要通過sudo raspi-config來開啟,不然是連接配接不上的。

  之後我就想用下真正的遠端桌面了,網上也是有很多的教程,特别的簡單,但是我在安裝xrdp的時候一直提示連接配接不上,不能成功安裝。

pi@raspberrypi:/ $ sudo apt-get install xrdp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ssl-cert x11-apps x11-session-utils xbitmaps xfonts-75dpi xfonts-scalable xorg xorg-docs-core xorgxrdp
Suggested packages:
  openssl-blacklist xorg-docs x11-xfs-utils guacamole
The following NEW packages will be installed:
  ssl-cert x11-apps x11-session-utils xbitmaps xfonts-75dpi xfonts-scalable xorg xorg-docs-core xorgxrdp xrdp
0 upgraded, 10 newly installed, 0 to remove and 1 not upgraded.
Need to get 4 75 kB/49 26 kB of archives.
After this operation, 97 62 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:2 http://mirrordirector.raspbian.org/raspbian stretch/main armhf xrdp armhf 0.9.1-9
  404  Not Found [IP: 93.93.128.193 80]
Err:1 http://101.110.118.74/mirrordirector.raspbian.org/raspbian stretch/main armhf xorgxrdp armhf 0.9.1-9                                                   
  Could not connect to 101.110.118.74:80 (101.110.118.74), connection timed out
E: Failed to fetch http://101.110.118.74/mirrordirector.raspbian.org/raspbian/pool/main/x/xrdp/xorgxrdp_0.9.1-9_armhf.deb  Could not connect to 101.110.118.74:80 (101.110.118.74), connection timed out
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/x/xrdp/xrdp_0.9.1-9_armhf.deb  404  Not Found [IP: 93.93.128.193 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
      

  

  我一直以為是自己家裡網絡限制不能連接配接上,讓後網上找了很多資料都不行,最後看見提示後面的E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?,我才想起來我系統裝完一直沒有updata過,是以趕緊apt-get update,等一會更新完了,在運作sudo apt-get install xrdp,就欻欻的往下跑了,在輸入sudo -apt-get install tightvncserver一切都搞定!

禁止休眠

步驟

1.打開lightdm.conf

sudo vi /etc/lightdm/lightdm.conf           

2.修改lightdm.conf

找到[SeatDefaults]段下的’xserver-command’,取消注釋,修改為如下:

#xserver-command=X
           

修改為

xserver-command=X -s 0 -dpms           
  • -s # –設定螢幕保護不啟用
  • dpms 關閉電源節能管理

3.重新開機

reboot


           

鏡像源不可用或逾時

國内連接配接 opencas.cn and update sources.list. 逾時

#1) edit the sources.list by typing
sudo vi /etc/apt/sources.list

#2) Change
#deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
#to 
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi

#3) add the line
deb http://mirrors.shu.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

#4) Run the following
sudo apt-get update && sudo apt-get -y dist-upgrade && sudo apt-get update
      

 

總結:

  更新固件、系統,千萬不要用Ubuntu mate什麼的,最好用官方推薦的raspbian,穩定、高效。 

  上個圖吧(ELK dashboard):

玩樹莓派(raspberry pi) 2/3 raspbian的遇到的一些問題 首先是燒寫鏡像,和安裝電腦系統是一樣的道理。設定鍵盤系統設定禁止休眠鏡像源不可用或逾時

謀膽并重

繼續閱讀