当前位置:   article > 正文

树莓派操作系统及装机_树莓派系统

树莓派系统

Raspberry Pi is the most attractive SBC among the developers, programmers, and students. It helps to build any prototypes and develop applications or software. Nowadays, Raspberry Pi can generate output like a desktop computer and has the ability to serve individuals and small businesses. Low power draw, small form factor, no noise, and solid-state storage are the main reasons behind the widespread use of Raspberry Pi.

1. 引脚介绍

image-20200508152243708

Raspberry Pi 4 采用了博通 BCM2711 SoC,包含四个 1.5GHz Cortex A72 CPU 核心,与 Raspberry Pi 3 的四核 Cortex A53 CPU 相比,Raspberry Pi 4 的内存可选 1GB、2GB 和 4GB DDR4,比 Pi 3 的 1GB RAM 不知高到哪里去了。Raspberry Pi 4 包含两个 USB 2 端口、两个 USB 3 端口,通过一个 USB-C 端口供电,此外还有千兆以太网接口和耳机接口,两个 micro HDMI 端口,支持两台 4K 显示器。

2. 操作系统

2.1. Raspbian

the official OS, and it can be used on all models of Raspberry. This free operating system is known as the modified version of the popular OS Debian. It can serve all the general purposes for the Raspberry users

2.2. LIBREELEC

LIBREELC is a really small and open-source JEOS. It is often compared with OpenELEC, although the boot time is much faster in LIBREELEC. Just like other Linux distros, it offers backbones for backdated hardware. It was launched on 4 April 2016 and intended to bring major creative improvements to generate better multimedia output than OpenELEC.

2.3. Windows IoT Core

This is a powerful Raspberry Pi OS. Specially designed for writing sophisticated programs and making prototypes. It was intended to serve the developers and programmers. It has enabled the coders to make IoT projects using Raspberry Pi and Windows 10. You can check a lot of Microsoft projects listed on their site.

2.4. Ubuntu Core

Ubuntu is one of the widely used operating systems all over the world. This version of Ubuntu is designed for building and managing Internet of Things applications. This project is open source and backed by so many developers that you can not even imagine.

  • Ubuntu has 20+ other derivatives. So that if you decide to use Core, you will be a member of an active and welcoming forum.

  • Covers the basic sets of the platform, services, and technologies to work more efficiently with IoT projects.

  • This OS is lightweight and highly secure. Besides, you can restrict each application and its data from other applications.

  • Focuses on meeting the requirement of IoT devices and their distributors.

  • Public and Private key is generated while two steps validation and authentication at every step makes it more secure.

  • Several snaps like a core snap, a kernel snap, a gadget snap are used to build the Ubuntu Core system.

  • You can distribute the application using Snaps that makes it easy to distribute through Linux distribution from a play store.

2.5. Kali Linux

Kali is one of the best Linux distributions available to run in Raspberry Pi. You will not get too many changes than any other ARM. You can use this image in the desktop computers also by upgrading to the full package known as kali-Linux-full. You can use additional tools that are available on the website to extend the capabilities of certain features.

  • You will need a Class 10 SD card with at least 8GB data storage for installing a prebuilt Kali Linux image on your Raspberry.

  • This Debian based distribution offers a lot of security and forensics tools to ensure the security of your project or applications.

  • You can ensure security through research, testing, forensic reports, or even reverse engineering to accomplish your goal.

  • If you are a developer and have the desire to accomplish high computing projects, then Kali is the best choice for you.

  • Besides, If you want to indulge in Ethical Hacking, Kali can help in Cracking Wi-Fi password, spoofing, and testing networks all can be done.

2.6. Kano

It can be referred to as an educational project entirely planned and designed for the children. Kano manufactures computer kits to inspire children to learn how a computer works, how to write code, or how to work with basic projects. Not only children but also the individuals who have an interest in developing art, music, apps, games software can start by the starting kit distributed by Kano.

  • Kano offers an open-source OS to use in Raspberry Pi, and you will be guided through a setup wizard after completing the installation.

  • You will need to create an account and set a username to start the adventure. The OS comes with several story modes and a fresh set of features.

  • Other applications like Minecraft, Youtube, web browsers are also available. These most used applications are usually located on the menu.

  • You can start building small projects right after installing the OS with the dedicated apps.

  • This is a new kind of distribution. But to help you, they have provided a lot of books, resources, and instruction videos on their website.

2.7. Chromium Os

This open-source version of the Chromium OS offered by Google. That was intended to use on Chromebook computers, but it is also available for Raspberry Pi. It can single-handedly convert your Raspberry Pi into a desktop PC as it allows users to run powerful applications using cloud computing rather than depending on the hardware resources.

  • If you do not need anything else rather than web browsing, then a Raspberry Pi and Chromium OS are what you need.

  • It comes with all the applications offered by Google like Gmail, drive, access, docs, keeps, and so on.

  • Chromium can be used on Raspberry Pi 3 or 3B+ devices as there are no images available for Pi Zero or Raspberry 4.

  • After downloading the image, compress it into XZ format, which can be expanded in the Linux distribution system.

  • You will need a Gmail account to get booting for the first time. The environment of the OS is pretty much different than what you have seen in Chromebook.

2.8. OpenWrt

OpenWrt provides a fully writable filesystem with package management. This frees you from the application selection and configuration provided by the vendor and allows you to customize the device through the use of packages to suit any application. For developers, OpenWrt is the framework to build an application without having to build a complete firmware around it; for users this means the ability for full customization, to use the device in ways never envisioned.

3. Raspbian Installation

3.1. Device Lists

  • 树莓派4b 单板2G 335元

  • 电源,外壳,HDMI线,散热片,16GTF卡,读卡器,小风扇,网线,引脚尺,扩展板+铜柱,按键,点阵,LED,排线,点阵转接板 60元

3.2. 连接

注意: Raspbian 系统默认用户名:Pi 密码: raspberry

3.2.1. 无屏幕有线

  1. 在SD卡根目录(boot中)新建 ”ssh“ 文件,无后缀

  2. 硬件连接开机( 按电源开关,红灯亮,然后绿灯闪烁,加载成功)

  3. 找到树莓派ip地址, 路由器查看,手机电脑共享, IP scanner 查看

  4. 远程连接

3.2.2. 无线Wifi设置

#在根目录下新建文件  wpa_supplicant.conf 
country=CN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="liudongdong"
    psk="12345678"
    key_mgmt=WPA-PSK
    priority=1
}

3.2.3. 设置静态ip

#查看网络配置文件
sudo cat /etc/network/interfaces
# 根据注释信息进行修改
sudo nano /etc/dhcpcd.conf

3.2.4. VNC 远程登录

VNC是什么?远程登录树莓派,一般是两种方法,一种是使用SSH协议的PUTTY,一种是VNC的VNC Viewer。VNC具有图形界面,更受大家喜欢,你不需要给树莓派外置任何设备,就能在电脑上像运行一个普通程序一样,操作树莓派。

  1. sudo raspi-config

  2. 进入 Interfacing Options

  3. 选择VNC, Enable

  4. 输入vncserver ,会在最后一行显示端口号

  5. 使用VNC Viewer软件或其他登录

image-20200508151641901

错误: VNC View 连接 Cannot currently show the desktop

方案: changing the resolution to the highest(更改更高的分辨率即可),sudo raspi-config ->advanced

3.3. 软件源更换

sudo nano /etc/apt/sources.list
# 添加源
#deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
#deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

中山大学: Raspbian http://mirror.sysu.edu.cn/raspbian/raspbian/

中国科学技术大学 Raspbian http://mirrors.ustc.edu.cn/raspbian/raspbian/

清华大学 Raspbian http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/

大连东软信息学院源(北方用户) Raspbian http://mirrors.neusoft.edu.cn/raspbian/raspbian/

重庆大学源(中西部用户) Raspbian http://mirrors.cqu.edu.cn/Raspbian/raspbian/

#deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi #deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

第一个单词代表包的类型,deb表示二进制包,deb-src表示源码包。

第二个网址表示源的地址。

第三个单词表示系统的版本,既可以是[ wheezy | jessie | stretch | sid ]中的一种,也可以是[ oldstable | stable | testing | unstable ]中的一种。前一个系列表示系统的release code name,后一个系列表示系统的release class,前者按阶段发布,后者持续演进。

第四部分表示接受哪种开源类型的软件,可以包含[ main | contrib | non-free ]中的一个或多个。main表示纯正的遵循Debian开源规范的软件,contrib表示遵循Debian开源规范但依赖于其它不遵循Debian开源规范的软件的软件,non-free表示不遵循Debian开源规范的软件。Debian开源规范指DFSG(Debian 自由软件指导方针)。

4. Module

4.1. Camera

ls /dev    #查看是否有video0 设备
#使能摄像头
sudo raspi-config
# 进入camere  enable
sudo reboot
# 安装 MJPG-Streamer
sudo apt update
sudo apt install subversion
sudo apt install libjpeg8-dev
sudo apt install imagemagick
sudo apt install libv4l-dev
sudo apt install cmake
sudo apt install git
sudo git clone https:

4.2. Samba

sudo apt install samba samba-common-bin
sudo nano /etc/samba/smb.conf
​
sudo /etc/init.d/smbd restart
#添加用户和密码
sudo smbpasswd -a pi
​

5. Develop Language

WiringPi is a PIN based GPIO access library written in C for the BCM2835, BCM2836 and BCM2837 SoC devices used in all Raspberry Pi. versions. It’s released under the GNU LGPLv3 license and is usable from C, C++ and RTB (BASIC) as well as many other languages with suitable wrappers (See below) It’s designed to be familiar to people who have used the Arduino “wiring” system1 and is intended for use by experienced C/C++ programmers. It is not a newbie learning tool.

#  安装
pip install wiringpi
​
#General IO
import wiringpi
​
# One of the following MUST be called before using IO functions:
wiringpi.wiringPiSetup()      # For sequential pin numbering
# OR
wiringpi.wiringPiSetupSys()   # For /sys/class/gpio with GPIO pin numbering
# OR
wiringpi.wiringPiSetupGpio()  # For GPIO pin numbering
​
#G  IO operation
wiringpi.pinMode(6, 1)       # Set pin 6 to 1 ( OUTPUT )
wiringpi.digitalWrite(6, 1)  # Write 1 ( HIGH ) to pin 6
wiringpi.digitalRead(6)      # Read pin 6
#Hook a speaker up to your Pi and generate music with softTone. Also useful for generating frequencies for other uses such as modulating A/C.
wiringpi.softToneCreate(PIN)
wiringpi.softToneWrite(PIN, FREQUENCY)

链接http://liudongdong1.github.io/

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/681062
推荐阅读
相关标签
  

闽ICP备14008679号