Changes

Jump to: navigation, search

Orange Pi Zero 3

142 bytes removed, 16:26, 11 July 2023
no edit summary
== Top view and bottom view of Orange Pi Zero 3 ==
<big>'''Top view:view:'''</big>
[[File:media/image3.png|390x329px]]
<big>'''Bottom view:view:'''</big>
[[File:media/image4.png|494x292px]]
<li><p>The information mainly includes</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Android''' '''source code''': Save on Google Drive</p></li><li><p>'''Linux''' '''source code''':Save :Save on Github</p></li><li><p>'''Android''' '''source code''':Save :Save on Google Drive</p></li><li><p>'''Ubuntu''' '''source code''':Save :Save on Google Drive</p></li><li><p>'''Debian''' '''source code''':Save :Save on Google Drive</p></li><li><p>'''User Manual and Schematic:Schematic:'''Chip-related data sheets will also be placed here</p></li><li><p>'''Official tool:tool:'''It mainly includes the software that needs to be used during the use of the development board</p></li></ol>
</li></ol>
<ol style="list-style-type: lower-alpha;">
<li><p>'''The model of the development board''':Both :Both are '''orangepizero3'''. The model names of different development boards are generally different. Before burning the image, please make sure that the model name of the selected image matches the development board.</p></li><li><p>'''Version number''':For :For example, '''1.x.x''', this version number will increase with the update of the image function, and the last number of the version number of the Linux image on the development board is an even number.</p></li><li><p>'''Types of Linux distributions''': '''Ubuntu''' and '''Debian''' are currently supported. Since Ubuntu is derived from Debian, there is not much difference between the two systems in terms of usage. However, there are still some differences in the default configuration of some software and the use of commands. In addition, both Ubuntu and Debian have their own software warehouses supported by maintenance, and there are also some differences in the supported and installable software packages. These need to be experienced in person to have a deeper understanding. For more details, you can refer to the official documentation provided by Ubuntu and Debian.</p></li><li><p>'''Release code name''': Used to distinguish between different versions of a specific Linux distribution such as Ubuntu or Debian. Among them, both '''focal''' and '''jammy''' are Ubuntu distributions, focal means Ubuntu20.04, and jammy means Ubuntu22.04. The biggest difference between different versions is that the software in the software warehouse maintained by the new version of Ubuntu system is much better than that of the old version of Ubuntu system. The ones in it should be new, such as Python and GCC compilation tool chains. '''bullseye''' is the specific version code of Debian, bullseye means Debian11, and bookworm means Debian12.</p></li><li><p>'''Server or Desktop''':It :It is used to indicate whether the system has a desktop environment. If it is server, it means that the system does not have a desktop environment. The storage space and resources occupied by the image are relatively small, and the command line is mainly used to operate and control the system. If it is '''desktop_xfce''', it means that the system is installed with the XFCE desktop environment by default. The storage space and resources occupied by the image are relatively large. You can connect the monitor, mouse and keyboard to operate the system through the interface. Of course, the desktop version of the system can also be operated through the command line like the server version of the system.</p></li><li><p>'''Kernel version''':Used :Used to indicate the version number of the linux kernel, currently supports '''linux5.4''' and '''linux6.1.'''</p></li></ol>
<span id="linux-kernel-driver-adaptation"></span>
test@test:~$ '''sudo -i'''
[sudo] test 的密码:的密码:
root@test:~'''<span style="color:#FF0000">#</span>'''
test@test:~$ '''sudo -i'''
[sudo] test 的密码:的密码:
root@test:~'''<span style="color:#FF0000">#</span>'''
'''* options:options:''' '''You can use this parameter to specify the encryption method, the frequency band of the WIFI hotspot, the bandwidth mode, the network sharing method, etc. You can get the options through create_ap -h'''
'''* wifi-interface:The interface:The name of the wireless network card'''
'''* interface-with-internet:internet:''' '''The name of the network card that can be connected to the Internet, generally eth0'''
'''* access-point-name: name: hotspot name'''
'''* passphrase:hotspot passphrase:hotspot password'''</big>
|}
|}
The IP of the device connected to the WIFI hotspot is also assigned by the main router, so the mobile phone connected to the WIFI hotspot and the development board are in the same network segment. At this time, click on the connected WIFI hotspot orangepi, and then you can see the IP address of the mobile phone Also '''192.168.1.X'''.
[[File:media/image120.png|284x136px]]
The watchdog_test program is pre-installed in the linux system released by Orange PI, which can be tested directly.
The method of running the watchdog_test program is shown below:below:
<ol style="list-style-type: lower-alpha;">
|}
You can use the following command to test the docker,If you can run '''hello-world''' to indicate that docker can be used normally..
{| class="wikitable" style="width:800px;"
|}
When using the docker command, if it prompts '''permission denied''', please add the current user to the docker user group, so that the docker command can be run without sudo。sudo.
{| class="wikitable" style="width:800px;"
|-
|
<big><p>'''If it is debian12, please use the following command:command:'''</p></big>
|-
|
<big><p>'''Debian Bookworm is python3.11, please remember to replace the corresponding command。command.'''</p></big>
|}
{| class="wikitable" style="width:800px;"
|-
|
<big><p>'''When running the hass command for the first time, you will download and install and cache some necessary libraries and dependencies to run. This process may take a few minutes. Note that at this time, the interface of Home Assistant cannot be seen in the browser. Please wait for a while before refreshing。refreshing.'''</p></big>
|}
<p>[[File:media/image194.png|576x203px]]</p></li></ol>
<li><p>Then use the following command to print the output of the version number of OpenCV, indicating that the installation of OpenCV is successful</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The version of OpenCV in ubuntu22.04 is shown below:below:</p>
<p>orangepi@orangepi:~$ '''python3 -c &quot;import cv2; print(cv2.__version__)&quot;'''</p>
<p>'''4.5.4'''</p></li>
<li><p>The version of OpenCV in Ubuntu 20.04 is shown below:below:</p>
<p>orangepi@orangepi:~$ '''python3 -c &quot;import cv2; print(cv2.__version__)&quot;'''</p>
<p>'''4.2.0'''</p></li>
<li><p>The version of OpenCV in Debian11 is shown below:below:</p>
<p>orangepi@orangepi:~$ '''python3 -c &quot;import cv2; print(cv2.__version__)&quot;'''</p>
<p>'''4.5.1'''</p></li>
<li><p>The version of OpenCV in Debian12 is shown below:below:</p>
<p>orangepi@orangepi:~$ '''python3 -c &quot;import cv2; print(cv2.__version__)&quot;'''</p>
<p>'''4.6.0'''</p></li></ol>
<ol style="list-style-type: decimal;">
<li><p>First of all, you need to expand the'''/tmp''' memory. After setting, you need to <span class="mark">'''restart the linux system of the development board,'''and the command is shown below</span>:</p>
<p>orangepi@orangepi:~$ '''sudo sed -i 's/nosuid/&amp;,size=2G/' /etc/fstab'''</p>
<p>orangepi@orangepi:~$ '''sudo reboot'''</p></li>
<p>[[File:media/image199.png|575x306px]]</p></li>
<li><p>For more functions of the aapanel, please refer to the following information to explore by yourself</p>
<p>Use manual:manual:[http://docs.bt.cn '''http://docs.bt.cn''']</p><p>Forum website:website:[https://www.bt.cn/bbs '''https://www.bt.cn/bbs''']</p><p>GitHub Link:Link:'''https://github.com/aaPanel/BaoTa'''</p></li></ol>
<span id="face_recognition-the-installation-and-testing-method-of-the-face-recognition-library"></span>
== face_recognition The installation and testing method of the face recognition library ==
'''Note that the contents of this section are tested in the Linux system of the desktop version, so please make sure that the system used by the development board is a desktop version system。system.'''
'''In addition, the installation test below is performed under OrangePi users. Please keep the environment consistent.'''
'''Debian12 is currently not adapted.'''
'''The address of the source code warehouse of Face_recognition is:is:'''
[https://github.com/ageitgey/face_recognition '''https://github.com/ageitgey/face_recognition''']
'''Face_recognition Chinese version of the explanation document is:is:'''
'''https://github.com/ageitgey/face_recognition/blob/master/README_Simplified_Chinese.md'''
<ol style="list-style-type: decimal;">
<li><p>First create a new '''~/.pip''' directory, then add the '''pip.conf''' configuration file, and set the mirror source of pip to Tsinghua source in it, the commands to be executed are as follows:follows:</p>
<p>orangepi@orangepi:~$ '''mkdir -p ~/.pip'''</p>
<p>orangepi@orangepi:~$ '''cat &lt;&lt;EOF &gt; ~/.pip/pip.conf'''</p>
<li><p>Then update pip3</p>
<p>orangepi@orangepi:~$ '''python3 -m pip install -U pip setuptools wheel'''</p></li>
<li><p>Before installing '''face_recognition''', you first need to install the '''dlib''' library. Since the compilation and installation of the dlib library on the development board is relatively slow, I saved a compiled dlib whl file on '''gitee''', and you can install it directly after downloading. The download address of the dlib whl file is as follows:follows:</p>
<p>'''https://gitee.com/leeboby/python_whl'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First download the python_whl warehouse to the Linux system of &gt; the development board</p>
<p>orangepi@orangepi:~$ '''git clone --depth=1 https://gitee.com/leeboby/python_whl'''</p></li>
<li><p>In the python_whl folder, you can see that there are multiple &gt; versions of dlib installation packages. The Linux systems &gt; corresponding to different versions of dlib are as follows:follows:</p></li></ol>
</li></ol>
=== The test method of face_recognition ===
'''Note that the following operations are demonstrated on the desktop, so please connect the HDMI monitor first, or use NoMachine/VNC to remotely log in to the Linux desktop to test。test.'''
<ol style="list-style-type: decimal;">
<li><p>There are some sample codes in the source code of '''face_recognition''', which we can use directly for testing. The download address of the source code of face_recognition is as follows:follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>GitHub official download address</p>
<p>'''Is the unknown face a picture of Obama? True'''</p>
<p>'''Is the unknown face a new person that we've never seen before? False'''</p></li>
<li><p>'''facerec_from_webcam_faster.py''' is used to recognize the face in the USB camera, the test steps are as follows:follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, please insert the USB camera into the USB interface of &gt; the development board, and then use the '''v4l2-ctl''' ('''note &gt; that l in v4l2 is a lowercase letter l, not the number 1''') &gt; command to check the serial number of the device node of the &gt; USB camera</p>
<p>[[File:media/image205.png|358x284px]]</p></li></ol>
</li>
<li><p>'''web_service_example.py''' is a very simple case of using a web service to upload a picture to run face recognition. The backend server will identify whether the picture is Obama, and output the recognition result as a json key-value pair. The test steps are as follows:follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Open a terminal on the desktop, then enter the &gt; '''face_recognition/examples''' directory, and then execute the &gt; following command ('''if face_recognition is automatically &gt; installed using a script, then there is no need to install &gt; flask''')</p>
<p>'''&quot;is_picture_of_obama&quot;: true'''</p>
<p>'''}'''</p></li>
<li><p>The method to test using the browser is as follows:follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First open the browser, then enter the '''<span class="mark">IP address of the &gt; development board: 5001</span>''' in the address bar of &gt; the browser, and then you can see the following page</p>
<p>&quot;cnn&quot;.</p>
<p>--help Show this message and exit.</p></li>
<li><p>An example of detecting a single image is shown below:below:</p>
<p>orangepi@orangepi:~$ '''cd face_recognition/examples'''</p>
<p>orangepi@orangepi:~/face_recognition/examples$ '''face_detection obama2.jpg'''</p>
<p>obama2.jpg,302,474,611,164</p></li>
<li><p>An example of using multiple cores to detect multiple images in &gt; parallel is shown below:below:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First enter the '''face_recognition/examples''' folder</p></li>
== Setting Chinese environment and installing Chinese input method ==
'''Note, please make sure that the Linux system used by the development board is a desktop system before installing the Chinese input method。method.'''
<span id="how-to-install-debian-system"></span>
<li><p>Then find the <span class="mark">'''Chinese (China''')</span> option</p>
<p>[[File:media/image226.png|318x311px]]</p></li>
<li><p>Then please use the left mouse button to select '''<span class="mark">Chinese (China)</span>''' and hold it down, then drag it up to the initial position, the display after dragging is as shown in the figure below:below:</p>
<p>[[File:media/image227.png|324x320px]]</p></li></ol>
<li><p>Then find the '''<span class="mark">Chinese (China)</span>''' option</p>
<p>[[File:media/image234.png|249x242px]]</p></li>
<li><p>Then please use the left mouse button to select '''<span class="mark">Chinese (China)</span>''' and hold it down, then drag it up to the initial position, the display after dragging is as shown in the figure below:below:</p>
<p>[[File:media/image235.png|267x262px]]</p></li></ol>
'''Note that this step is not easy to drag, please be patient and try a few more times。times.'''
<ol start="4" style="list-style-type: decimal;">
=== Remote login using NoMachine ===
'''Make sure the Ubuntu or Debian system installed on the development board is a desktop system version. In addition, NoMachine also provides detailed documents. It is strongly recommended to read this document to be familiar with the use of NoMachine. The document link is shown below:below:'''
'''https://knowledgebase.nomachine.com/DT10R00166'''
<li><p>First download the installation package of the NoMachine software Linux '''arm64''' deb version, and then install it into the Linux system of the development board</p>
<ol style="list-style-type: lower-alpha;">
<li>Since H618 is a SOC of the ARMV8 architecture, the system we use &gt; is Ubuntu or Debian, so you need to download the '''NoMachine &gt; for ARM ARMv8 DEB''' installation package. The download link is &gt; shown below:below:</li></ol>
</li></ol>
'''Note that this download link may change, please look for the deb package of the Armv8/Arm64 version。version.'''
[https://www.nomachine.com/download/download&id=112&s=ARM '''https://downloads.nomachine.com/download/?id=118&amp;distro=ARM''']
<li>Then download the installation package of the Windows version of the NoMachine software, the download address is as follows</li></ol>
'''Note that this download link may change。change.'''
'''https://downloads.nomachine.com/download/?id=9'''
<p>Starting applications specified in /root/.vnc/xstartup</p>
<p>Log file is /root/.vnc/orangepi:1.log</p></li>
<li><p>The steps to use the MobaXterm software to connect to the desktop of the Linux system of the development board are as follows:follows:</p>
<ol style="list-style-type: lower-alpha;">
<li>First click on Session, then select VNC, then fill in the IP &gt; address and port of the development board, and finally click &gt; OK to confirm</li></ol>
<ol start="2" style="list-style-type: decimal;">
<li><p>ROS 1 '''Noetic Ninjemys''' official installation documentation link is as follows:follows:</p>
<p>[http://wiki.ros.org/noetic/Installation/Ubuntu '''http://wiki.ros.org/noetic/Installation/Ubuntu''']</p></li>
<li><p>In the ROS '''Noetic Ninjemys''' official installation document, Ubuntu recommends using Ubuntu20.04, so please make sure that the system used by the development board is the '''Ubuntu20.04 desktop system'''</p>
'''Note that running the following command needs to ensure that the development board can access github normally, otherwise an error will be reported due to network problems'''
'''The install_ros.sh script will try to modify /etc/hosts and run the following commands automatically. However, this method cannot guarantee that github can be accessed normally every time. If install_ros.sh prompts the following error after installing ros1, please find other ways to allow the linux system of the development board to access github normally, and then manually run the following command。command.'''
'''https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml'''
<p>[http://docs.ros.org/ '''http://docs.ros.org''']</p>
<p>'''http://docs.ros.org/en/galactic/Releases.html'''</p></li>
<li><p>The link to the official ROS 2 '''Galactic Geochelone''' installation documentation is as follows:follows:</p>
<p>'''docs.ros.org/en/galactic/Installation.html'''</p>
<p>'''http://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html'''</p></li>
<p>orangepi@orangepi:~$ '''ls /usr/src'''</p>
<p>linux-headers-x.x.x</p></li>
<li><p>Then you can compile the source code of the hello kernel module that comes with the Linux image. The source code of the hello module is in '''/usr/src/hello'''. After entering this directory, use the make command to compile。compile.</p>
<p>orangepi@orangepi:~$ '''cd /usr/src/hello/'''</p>
<p>orangepi@orangepi:/usr/src/hello$ '''sudo make'''</p>
<p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p>
<p>&gt;&gt;&gt;</p>
<p>'''Use the Ctrl+D shortcut to exit python's interactive mode。mode.'''</p></li>
<li><p>Write '''hello_world.py''' program in Python language</p>
<p>orangepi@orangepi:~$ '''vim hello_world.py'''</p>
<p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p>
<p>&gt;&gt;&gt;</p>
<p>'''Use the Ctrl+D shortcut to exit python's interactive mode。mode.'''</p></li>
<li><p>Write '''hello_world.py''' program in Python language</p>
<p>orangepi@orangepi:~$ '''vim hello_world.py'''</p>
<li><p>Use the scp command to upload files from the Ubuntu PC to the Linux system of the development board. The specific commands are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''file_path:file_path:'''Need to be replaced with the path of the file to &gt; be uploaded</p></li><li><p>'''orangepi:orangepi:''' It is the user name of the Linux system of the &gt; development board, and it can also be replaced with other &gt; ones, such as root</p></li>
<li><p>'''192.168.xx.xx:''' It is the IP address of the development &gt; board, please modify it according to the actual situation</p></li>
<li><p>'''/home/orangepi:''' The path in the Linux system of the &gt; development board can also be modified to other paths</p>
<!-- -->
<ol start="7" style="list-style-type: decimal;">
<li><p>Part of the information prompted when compiling the next branch kernel source code is as follows:follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The version of the linux kernel source code</p>
<p>output/debs/linux-image-next-sun50iw9_x.x.x_arm64.deb</p></li></ol>
</li>
<li><p>When the orangepi-bulid compilation system compiles the linux kernel source code, it first synchronizes the linux kernel source code with the linux kernel source code of the github server, so if you want to modify the linux kernel source code, you first need to turn off the update function of the source code '''(the linux kernel needs to be fully compiled once This function can only be turned off after the source code, otherwise it will prompt that the source code of the linux kernel cannot be found)''', otherwise the changes made will be restored, the method is as follows:follows:</p>
<p>Set the IGNORE_UPDATES variable in '''userpatches/config-default.conf''' to &quot;yes&quot;</p>
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<li><p>The GPIO test interface is shown in the figure below. There is a one-to-one correspondence between the two rows of '''CheckBox''' buttons on the left and the 26pin pins '''(PC1/PI16/PI6/PH10 in the lower left corner are GPIO ports in the 13pin pins)'''. When the '''CheckBox''' button is checked, the corresponding GPIO pin will be set to '''OUT''' mode, and the pin level will be set to high level; when the checkbox is unchecked, the GPIO pin level will be set to low level; When the '''GPIO READALL''' button is pressed, information such as the wPi number, GPIO mode, and pin level can be obtained.</p>
<p>[[File:media/image362.png|425x236px]]</p></li>
<li><p>Then click the '''GPIO READALL''' button, the output information is as shown in the figure below:below:</p>
<div class="figure">
<li><p>Then set the address of i2c to 0x68 in wiringOP, and then click the '''OPEN''' button to open i2c3</p>
<p>[[File:media/image384.png|354x177px]]</p></li>
<li><p>The display after clicking the '''OPEN''' button to open i2c3 is as follows:follows:</p>
<p>[[File:media/image385.png|355x171px]]</p></li>
<li><p>Then we test to write a value into the register of the rtc module, for example, write 0x55 to the 0x1c address</p>

Navigation menu