A new comer playing with Raspberry Pi 3B

时间:2021-12-06 07:43:29

there are some things to do for raspberry pi 3b for the first time:

1, connect pi with monitor/KB/mouse, then power on it and go into its desktop(by default):
expand system up to the whole storage of SD card(it seems to be maximum of 64G by official exclaim);
set up the locale as US/US, from desktop to CLI when login, the timezone as Asia/Chongqing
alternatively, we could config these parameters by command: raspi-config(need root authentication), before that, you should use a tool such as Putty to connect with SSH.

2, update system by:
sudo apt-get update

3, setup vim
install new vim(I suspect it's fake itself, many feature aren't available in its VIM!) by: sudo apt-get install vim
add a .vimrc under your home folder and insert the following configuration:
set nu
syntax on
set hlsearch
set tabstop=4
"set softtabstop=4
"set shiftwidth=4
"set cindent
"set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s

4, config static ip address (for wifi at least) by altering file /etc/network/interfaces:
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.1.60
    netmask 255.255.255.0
    gateway 192.168.1.1
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

note: more details for its configuration information, refer to its manual by typing - man interfaces, other configuration files or head files such as <stdio.h>, you can do the same.

5, install remote desktop for raspberry pi by:
sudo apt-get install xrdp
then you can use the default remote connecting tool of microsoft windows self to login pi

6, how to share with pi's home folder?
by SAMBA service:
a, sudo apt-get install samba samba-common-bin
b, sudo smbpasswd -a pi
c, make changes to 'read only' as no and 'browseable' as yes in section [homes] in file /etc/samba/smb.conf
d, sudo /etc/init.d/samba restart
e, then windows has access to the shared home folder like \\192.168.1.60\pi

7, how to use USB mass storage devices under it?
you could use 'lsusb' to find out which usb devices are connected.
a, mount usb disk manually
    make sure folder /mnt/udisk exists;
    mount: sudo mount -o uid=pi,gid=pi /dev/sda? /mnt/udisk (note: sda? should be seeked out accordingly)
    unmount: sudo umount /mnt/udisk
b, mount usb disk automatically?

8, complete development environment update for c/c++

for gcc: sudo apt-get install gcc-4.9-doc    (first check your version of gcc, in this case, it is 4.9)

P.S. Win32DiskImager can backup and restore system on TF card among different cards.
halt完成后居然有2.4瓦特的功耗!而运行时轻载也就1.7瓦特左右,负载重时也就2-3瓦特!所以要彻底关电,必须使用poweroff或shutdown now --poweroff命令,关断后其显示红指示灯常亮,而halt后是灭灯的。