8,367
edits
Changes
→Download orangepi-build from github
<div class="figure">
[[File:zero2w-img3.png|800px]]
</div>
<div class="figure">
[[File:zero2w-img4.png|800px]]
</div>
<div class="figure">
[[File:zero2w-img5.png|800px]]
</div>
<span id="orange-pi-zero-2w-24pin-expansion-board-interface-details"></span>
== Orange Pi Zero 2w 24pin expansion board interface details ==
<div class="figure">
[[File:zero2w-img6.png|800px]]
</div>
[[File:zero2w-img7.png|800px]]
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
# The '''currently tested''' and usable USB Ethernet cards are as follows. Among them, the RTL8153 USB Gigabit network card can be used normally when inserted into the USB 2.0 Host interface of the development board for testing, but the speed cannot reach Gigabit. Please note this.
::{| class="wikitable" style="width:800px;text-align: center;"
|-
| serial number
<ol start="2" style="list-style-type: decimal;">
<li><p>First insert the USB network card into the USB interface of the development board, and then insert the network cable into the USB network card to ensure that the network cable can access the Internet normally. If you can see the following log information through the '''dmesg''' command, it means that the USB network card is recognized normally.</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''dmesg | tail'''</p>
<p>[ 121.985016] usb 3-1: USB disconnect, device number 2</p>
<p>[ 127.763031] IPv6: ADDRCONF(NETDEV_UP): enx00e04c362017: link is not ready</p>
<p>[ 129.892465] r8152 3-1:1.0 enx00e04c362017: carrier on</p>
<p>[ 129.892583] IPv6: ADDRCONF(NETDEV_CHANGE): enx00e04c362017: link becomes ready</p>|}</li>
<li><p>Then you can see the device node of the USB network card and the automatically assigned IP address through the ifconfig command</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo ifconfig'''</p>
<p>'''enx00e04c362017''': flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500</p>
::<p>inet '''192.168.1.177''' netmask 255.255.255.0 broadcast 192.168.1.255</p>::<p>inet6 fe80::681f:d293:4bc5:e9fd prefixlen 64 scopeid 0x20<link></p>::<p>ether 00:e0:4c:36:20:17 txqueuelen 1000 (Ethernet)</p>::<p>RX packets 1849 bytes 134590 (134.5 KB)</p>::<p>RX errors 0 dropped 125 overruns 0 frame 0</p>::<p>TX packets 33 bytes 2834 (2.8 KB)</p>::<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>|}</li>
<li><p>The command to test network connectivity is as follows</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I enx00e04c362017'''</p>
<p>PING www.a.shifen.com (14.215.177.38) from 192.168.1.12 eth0: 56(84) bytes of data.</p>
<p>--- www.a.shifen.com ping statistics ---</p>
<p>4 packets transmitted, 4 received, 0% packet loss, time 3002ms</p>
<p>rtt min/avg/max/mdev = 6.260/6.770/7.275/0.373 ms</p>|}</li></ol>
<span id="usb-camera-test"></span>
=== USB camera test ===
<li><p>First insert the USB camera into the USB interface of the Orange Pi development board</p></li>
<li><p>Then you can see through the lsmod command that the kernel automatically loads the following modules</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''lsmod'''</p>
<pspan style="margin-right: 100px;">Module </span><span style="margin-right: 50px;">Size </span><span style="margin-right: 45px;">Used by</pspan><br><pspan style="margin-right: 100px;">'''uvcvideo </span><span style="margin-right: 50px;">106496 </span><span style="margin-right: 50px;">0'''</pspan><br>|}</li>
<li><p>Through the v4l2-ctl command, you can see that the device node information of the USB camera is/dev/video0</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo''' '''apt install -y v4l-utils'''</p>
<p>orangepi@orangepi:~$ '''v4l2-ctl --list-devices'''</p>
<p>USB 2.0 Camera (usb-sunxi-ehci-1):</p>
::<p>/dev/video0</p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that the l in v4l2 is the lowercase letter l, not the number 1.'''</p><p>'''In addition, the serial number of the video may not always be video0, please refer to what you actually see.'''</p></big>|}</li>
<li><p>Use fswebcam to test the USB camera</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Install fswebcam</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo''' '''apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y fswebcam'''</p>|}</li><li><p>After installing fswebcam, you can use the following command to > take pictures</p><ol style="list-style-type: lower-alphanone;"><li><p>a) -d Option to specify the device node of the USB camera</p></li><li><p>b) --no-banner Used to remove watermarks from photos</p></li><li><p>c) -r option is used to specify the resolution of the photo</p></li><li><p>d) -S Option to skip previous frames</p></li><li><p>e) ./image.jpg Used to set the name and path of the generated > photo</p>{| class="wikitable" style="width:800px;" |-|
<p>orangepi@orangepi:~$ '''sudo''' '''fswebcam -d /dev/video0 \'''</p>
<p>'''--no-banner -r 1280x720 -S 5 ./image.jpg'''</p>|}</li></ol>
</li>
<li><p>In the server version of Linux system, after taking the picture, > you can use the scp command to transfer the taken picture to > the Ubuntu PC for mirror viewing.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''scp image.jpg [mailto:test@192.168.1.55:/home/test test@192.168.1.55:/home/test] (Modify the IP address and path according to the actual situation)'''</p>|}</li><li><p>In the desktop version of Linux system, you can directly view > the captured pictures through the HDMI display</p></li></ol>
</li>
<li><p>Use mjpg-streamer to test the USB camera</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Download mjpg-streamer</p>
<ol style="list-style-type: lower-alphanone;"><li><p>a) Github download address:</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''git clone https://github.com/jacksonliam/mjpg-streamer'''</p>|}</li><li><p>b) The image download address of Gitee is:</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''git clone https://gitee.com/leeboby/mjpg-streamer'''</p>|}</li></ol>
</li>
<li><p>Install dependent software packages</p>
<ol style="list-style-type: lower-alphanone;"><li><p>a) Ubuntu system</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo apt-get install -y cmake libjpeg8-dev'''</p>|}</li><li><p>b) Debian system</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo apt-get install -y cmake libjpeg62-turbo-dev'''</p>|}</li></ol>
</li>
<li><p>Compile and install mjpg-streamer</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''cd mjpg-streamer/mjpg-streamer-experimental'''</p>
<p>orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ '''make -j4'''</p>
<p>orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ '''sudo make install'''</p>|}</li>
<li><p>Then enter the following command to start mjpg_streamer</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that the serial number of the video is not always video0, please refer to what you actually see.'''</p></big>|}{| class="wikitable" style="width:800px;" |-|
<p>orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ '''export LD_LIBRARY_PATH=.'''</p>
<p>orangepi@orangepi:~/mjpg-streamer/mjpg-streamer-experimental$ '''sudo ./mjpg_streamer -i "./input_uvc.so -d \'''</p>
<p>'''/dev/video0 -u -f 30" -o "./output_http.so -w ./www"'''</p>|}</li><li><p>Then enter ['''the IP address of the development board: 8080'''] > in the Ubuntu PC or Windows PC or mobile phone browser on the > same LAN as the development board to see the video output by > the camera.</p>
<div class="figure">
<li><p>Use the '''aplay -l''' command to view the sound card devices supported by the Linux system</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The output of the linux5.4 system is as follows, where '''card 0: > audiocodec''' is the sound card device required for headphone > playback</p>{| class="wikitable" style="width:800px;" |-|
<p>root@orangepi:~# '''aplay -l'''</p>
<p>**** List of PLAYBACK Hardware Devices ****</p>
<p>'''card 0: audiocodec [audiocodec], device 0: soc@3000000:codec_plat-5096000.codec 5096000.codec-0 []'''</p>
:<p>'''Subdevices: 1/1'''</p>:<p>'''Subdevice #0: subdevice #0'''</p>|}</li><li><p>The output of the b.linux6.1 system is as follows, where > '''audiocodec''' is the sound card device required for headphone > playback.</p>{| class="wikitable" style="width:800px;" |-|
<p>root@orangepi:~# '''aplay -l'''</p>
<p>**** List of PLAYBACK Hardware Devices ****</p>
<p>'''card 0: audiocodec [audiocodec], device 0: CDC PCM Codec-0 [CDC PCM Codec-0]'''</p>
:<p>'''Subdevices: 1/1'''</p>:<p>'''Subdevice #0: subdevice #0'''</p>|}</li></ol>
</li>
<li><p>Then use the '''aplay''' command to play the audio, and the sound can be heard through the headphones</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>root@orangepi:~# '''aplay -D hw:0,0 /usr/share/sounds/alsa/audio.wav'''</p>
<p>Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo</p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| </libig></ol> '''If there is noise during the headphone test, please pull out some of the headphones and do not plug them all the way in.'''</big>|}</li></ol><span id="hdmi-audio-playback-test"></span>
==== HDMI audio playback test ====
<li><p>First use the Mini HDMI to HDMI cable to connect the Orange Pi development board to the TV (other HDMI displays need to ensure that they can play audio)</p></li>
<li><p>HDMI audio playback does not require other settings, just use the '''aplay''' command to play directly</p>
{| class="wikitable" style="width:800px;" |-| <p>root@orangepi:~# '''aplay -D hw:2,0 /usr/share/sounds/alsa/audio.wav'''</p>|}</li></ol>
<span id="test-audio-methods-on-desktop-systems"></span>
=== Test audio methods on desktop systems ===
<li><p>First open the volume control interface</p>
<p>[[File:zero2w-img166.png]]</p></li>
<li><p>When playing audio, the audio device options that can be used by > the '''Playback''' software will be displayed in '''Playback''', > as shown in the figure below. Here you can set which audio > device needs to be played.</p>
<div class="figure">
<span id="infrared-reception-test"></span>
== Infrared reception test ==
<li><p>There is no infrared receiver on the main board of the development board. We can expand it through a 24pin expansion board.</p>
<p>[[File:zero2w-img107.png]]</p></li>
<li><p>Install ir-keytable infrared test software</p></li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo''' '''apt update'''
orangepi@orangepi:~$ '''sudo''' '''apt-get install -y ir-keytable'''
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li><p>Then execute ir-keytable to view the information of the infrared device</p>
<ol style="list-style-type: lower-alpha;">
<li>linux5.4 system output is as follows</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''ir-keytable'''
Found /sys/class/rc/rc0/ with:
::Name: sunxi-ir
::Driver: sunxi-rc-recv
::Default keymap: rc_map_sunxi
::Input device: /dev/input/event1
::LIRC device: /dev/lirc0
::Attached BPF protocols: Operation not permitted
::Supported kernel protocols: lirc nec
::Enabled kernel protocols: lirc nec
::bus: 25, vendor/product: 0001:0001, version: 0x0100 Repeat delay = 500 ms, repeat period = 125 ms
::Repeat delay = 500 ms, repeat period = 125 ms
|}
</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>The output of the linux6.1 system is as follows</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''ir-keytable'''</p>
<p>Found /sys/class/rc/rc0/ with:</p>
::<p>Name: sunxi-ir</p>::<p>Driver: sunxi-ir</p>::<p>Default keymap: rc-empty</p>::<p>Input device: /dev/input/event5</p>::<p>LIRC device: /dev/lirc0</p>::<p>Attached BPF protocols: Operation not permitted</p>::<p>Supported kernel protocols: lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp imon rc-mm</p>::<p>Enabled kernel protocols: lirc</p>::<p>bus: 25, vendor/product: 0001:0001, version: 0x0100</p>::<p>Repeat delay = 500 ms, repeat period = 125 ms</p>|}</li></ol> <!-- --/li></ol>
<ol start="4" style="list-style-type: decimal;">
<li><p>Before testing the infrared reception function, you need to prepare an Orange Pi-specific infrared remote control. '''<span classstyle="markcolor:#FF0000">Other remote controls do not support it</span>'''.</p>
<div class="figure">
<li><p>Then enter the '''ir-keytable -t''' command in the terminal, and then use the infrared remote control to press the button against the infrared receiver of the Orange Pi development board to see the received key code in the terminal.</p>
<ol style="list-style-type: lower-alpha;">
<li>linux5.4 system output is as follows</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo ir-keytable -t'''
1598339152.914715: event type EV_MSC(0x04): scancode = 0xfb0410
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>linux6.1 system output is as follows</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo ir-keytable -c -p NEC -t'''</p>
<p>Old keytable cleared</p>
<p>202.063219: lirc protocol(nec): scancode = 0x45c</p>
<p>202.063249: event type EV_MSC(0x04): scancode = 0x45c</p>
<p>202.063249: event type EV_SYN(0x00).</p>|}</li></ol></li></ol><span id="temperature-sensor"></span>
== Temperature sensor ==
H618 has a total of 4 temperature sensors. The command to view the temperature is as follows:
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''The displayed temperature value needs to be divided by 1000, and the unit is Celsius.'''</big>|}
<ol style="list-style-type: lower-alpha;">
<li>sensor0: CPU temperature sensor, the first command is used to view > the type of temperature sensor, the second command is used to view > the value of the temperature sensor</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone0/type'''
'''57734'''
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>sensor1: DDR temperature sensor, the first command is used to view > the type of temperature sensor, the second command is used to view > the value of the temperature sensor</p>{| class="wikitable" style="width:800px;" |-|
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone1/type'''</p>
<p>'''ddr'''_thermal_zone</p>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone1/temp'''</p>
<p>'''57410'''</p>|}</li><li><p>sensor2: GPU temperature sensor, the first command is used to view > the type of temperature sensor, the second command is used to view > the value of the temperature sensor</p>{| class="wikitable" style="width:800px;" |-|
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone2/type'''</p>
<p>'''gpu'''_thermal_zone</p>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone2/temp'''</p>
<p>'''59273'''</p>|}</li><li><p>sensor3: VE's temperature sensor. The first command is used to view > the type of temperature sensor, and the second command is used to > view the value of the temperature sensor.</p>{| class="wikitable" style="width:800px;" |-|
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone3/type'''</p>
<p>'''ve'''_thermal_zone</p>
<p>orangepi@orangepi:~$ '''cat /sys/class/thermal/thermal_zone3/temp'''</p>
<p>'''58949'''</p>|}</li></ol>
<span id="how-to-check-the-temperature-in-linux6.1-system"></span>
=== How to check the temperature in linux6.1 system ===
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sensors'''
Adapter: Virtual device
temp1: +'''<span style="color:#FF0000">47.4°C</span>''' (crit = +110.0°C)
gpu_thermal-virtual-0
Adapter: Virtual device
temp1: +'''<span style="color:#FF0000">48.7°C</span>''' (crit = +110.0°C)
ddr_thermal-virtual-0
Adapter: Virtual device
temp1: +'''<span style="color:#FF0000">47.8°C</span>''' (crit = +110.0°C)
ve_thermal-virtual-0
Adapter: Virtual device
temp1: +'''<span style="color:#FF0000">47.2°C</span>''' (crit = +110.0°C)|}
<span id="pin-interface-pin-description"></span>
== 40 Pin Interface pin description ==
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note: The pin header on the 40pin interface is not soldered by default, and you need to solder it yourself before it can be used.'''</big>|}
<ol style="list-style-type: decimal;">
</div></li>
<li><p>The functions of the 40 Pin interface pins on the development board are as shown in the table below</p></li></ol>
<div style="display: flex;">{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
|-
| '''GPIO序号GPIO NO.'''
| '''GPIO'''
| '''Function'''
| '''pin'''
|-
| style="text-align: left;"|
| '''3.3V'''
| '''1'''
|-
| '''264'''
| '''TWI1-SDA'''
| '''3'''
|-
| '''263'''
| '''TWI1-SCL'''
| '''5'''
|-
| '''269'''
| '''PWM3/UART4_TX'''
| '''7'''
|-
| style="text-align: left;"|
| '''GND'''
| '''9'''
|-
| '''226'''
| '''UART5_TX'''
| '''11'''
|-
| '''227'''
| '''UART5_RX'''
| '''13'''
|-
| '''261'''
| '''TWI0_SCL/UART2_TX'''
| '''15'''
|-
| style="text-align: left;"|
| '''3.3V'''
| '''17'''
|-
| '''231'''
| '''SPI1_MOSI'''
| '''19'''
|-
| '''232'''
| '''SPI1_MISO'''
| '''21'''
|-
| '''230'''
| '''SPI1_CLK'''
| '''23'''
|-
| style="text-align: left;"|
| '''GND'''
| '''25'''
|-
| '''266'''
| '''TWI2-SDA/UART3_RX'''
| '''27'''
|-
| '''256'''
| style="text-align: left;"|
| '''29'''
|-
| '''271'''
| style="text-align: left;"|
| '''31'''
|-
| '''268'''
| '''PWM2'''
| '''33'''
|-
| '''258'''
| style="text-align: left;"|
| '''35'''
|-
| '''272'''
| style="text-align: left;"|
| '''37'''
|-
| style="text-align: left;"|
| '''GND'''
| '''39'''
|}
|-
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''6'''
| '''GND'''
| style="text-align: left;"|
|-
| '''8'''
| '''UART0_TX'''
| '''224'''
|-
| '''10'''
| '''UART0_RX'''
| '''225'''
|-
| '''12'''
| style="text-align: left;"|
| '''257'''
|-
| '''14'''
| '''GND'''
| style="text-align: left;"|
|-
| '''16'''
| '''PWM4/UART4_RX'''
| '''270'''
|-
| '''18'''
| style="text-align: left;"|
| '''228'''
|-
| '''20'''
| '''GND'''
| style="text-align: left;"|
|-
| '''22'''
| '''TWI0_SDA/UART2_RX'''
| '''262'''
|-
| '''SPI1_CS0'''
| '''PH5'''
| '''229'''
|-
| '''26'''
| '''SPI1_CS1'''
| '''233'''
|-
| '''28'''
| '''TWI2-SCL/UART3_TX'''
| '''265'''
|-
| '''30'''
| '''GND'''
| style="text-align: left;"|
|-
| '''32'''
| '''PWM1'''
| '''267'''
|-
| '''34'''
| '''GND'''
| style="text-align: left;"|
|-
| '''36'''
| style="text-align: left;"|
| '''76'''
|-
| '''38'''
| style="text-align: left;"|
| '''260'''
|-
| '''40'''
| style="text-align: left;"|
| '''259'''
|}
</div>
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>There are a total of 28 GPIO ports in the 40pin interface. The high-level voltage of all GPIO ports is '''<span style="color:#FF0000">3.3v</span>'''</li></ol>
<span id="how-to-install-wiringop"></span>
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
| '''dtbo configuration'''| '''illustrate<big>'''|Note that wiringOP is already pre-| '''spi1-cs0installed in the linux image released by Orange Pi. Unless the wiringOP code is updated, there is no need to re-cs1-spidev'''| '''Open cs0 download, compile and cs1 of spi1 at the same timeinstall, you can just use it directly.'''|-| '''spi1-cs0-spidev'''| '''Only open cs0 The storage path of spi1'''|-| '''spi1the compiled wiringOP deb package in orangepi-cs1-spidev'''| 'build is: ''Only open cs1 of spi1'''|}
<ol style="list-style-type: decimal;"><li><p>Download the code of wiringOP</p>{| class="wikitable" style="width:800px;"
|-
| '''GPIO序号'''| <p>orangepi@orangepi:~$ '''GPIOsudo apt update'''</p>| <p>orangepi@orangepi:~$ '''Functionsudo apt install -y git'''</p>| <p>orangepi@orangepi:~$ '''pin'''|| '''pingit clone https://github.com/orangepi-xunlong/wiringOP.git -b next'''</p>| '''Function'''}{| '''GPIO'''| '''GPIO NO.'''class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
| style="text<big><p>'''Note that the source code needs to download the code of wiringOP next branch. Please don't miss the -alignb next parameter.'''</p><p>'''If there is a problem downloading the code from GitHub, you can directly use the wiringOP source code that comes with the Linux image. The storage location is: left;"/usr/src/wiringOP.'''</p></big>|}</li><li><p>Compile and install wiringOP</p>{| class="wikitable" style="text-alignwidth: left800px;"|-| <p>orangepi@orangepi:~$ '''3.3Vcd wiringOP'''</p>| <p>orangepi@orangepi:~/wiringOP$ '''1sudo ./build clean'''</p>|| <p>orangepi@orangepi:~/wiringOP$ '''2sudo ./build'''</p>| '''5V'''}</li><li><p>The output of the test gpio readall command is as follows</p><p>[[File:zero2w-img170.png]]</p></li></ol> | style<span id="textpin-align: left;interface-gpio-i2c-uart-spi-and-pwm-testing"|></span> == 40pin interface GPIO, I2C, UART, SPI and PWM testing == {| class="wikitable" style="textbackground-aligncolor: left#ffffdc;width:800px;"|
|-
| '''264'''| <big>'''PI8Note: The pin header on the 40pin interface is not soldered by default, and you need to solder it yourself before it can be used.'''</big>| '''TWI1-SDA'''}| '''3'''|<span id="pin-gpio-port-test"></span>| '''4'''=== 40pin GPIO port test ===| '''5V'''| <ol style="textlist-alignstyle-type: leftdecimal;"|><li><p>The following uses pin No. 7 - corresponding to GPIO PI13 - corresponding to wPi serial number 2 - as an example to demonstrate how to set the high and low levels of the GPIO port.</p><p>[[File:zero2w-img171.png]]</p></li><li><p>First set the GPIO port to output mode, and the third parameter needs to be the serial number of the wPi corresponding to the input pin.</p>{| class="wikitable" style="text-alignwidth: left800px;"|
|-
| '''263'''| <p>root@orangepi:~/wiringOP# '''PI7'''| '''TWI1-SCL'''| '''5gpio mode <span style="color:#FF0000">2</span> out'''</p>|}| '''6'''</li>| '''GND'''<li><p>Then set the GPIO port to output a low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 0v, it means the low level is set successfully.</p>{| styleclass="text-align: left;wikitable"|| style="text-alignwidth: left800px;"|
|-
| '''269'''| <p>root@orangepi:~/wiringOP# '''PI13'''| gpio write 2 <span style="color:#FF0000">0</span>'''PWM3</UART4_TX'''p>| '''7'''}|</li>| '''8'''| '''UART0_TX'''<li><p>Then set the GPIO port to output a high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 3.3v, it means the setting of the high level is successful.</p>{| '''PH0'''| '''224'''class="wikitable" style="width:800px;"
|-
| <p>root@orangepi:~/wiringOP# '''gpio write 2 <span style="text-aligncolor: left;#FF0000">1</span>'''</p>|}</li><li><p>The setting method for other pins is similar. You only need to modify the serial number of wPi to the serial number corresponding to the pin.</p></li></ol> | <span id="how-to-set-the-pull-down-resistor-of-40-pin-gpio-port"></span> === How to set the pull-down resistor of 40 Pin GPIO port === <ol style="textlist-style-aligntype: leftdecimal;"|>| '''GND'''<li><p>The following uses pin No. 7—corresponding to GPIO PI13—corresponding to wPi serial number 2—as an example to demonstrate how to set the pull-up and pull-down resistors of the GPIO port.</p>| '''9'''<p>[[File:zero2w-img171.png]]</p></li>|<li><p>First, you need to set the GPIO port to input mode, and the third parameter needs to be the serial number of the wPi corresponding to the input pin.</p>{| '''10'''| '''UART0_RX'''| '''PH1'''| '''225'''class="wikitable" style="width:800px;"
|-
| '''226'''| <p>root@orangepi:~/wiringOP# '''PH2gpio mode <span style="color:#FF0000">2</span> in'''</p>| '''UART5_TX'''}| '''11'''</li>|| '''12'''<li><p>After setting to input mode, execute the following command to set the GPIO port to pull-up mode.</p>{| class="wikitable" style="text-alignwidth: left800px;"|| '''PI1'''| '''257'''
|-
| '''227'''| <p>root@orangepi:~/wiringOP# '''PH3gpio mode <span style="color:#FF0000">2</span> up'''</p>| '''UART5_RX'''}| '''13'''</li>|| '''14'''| '''GND'''<li><p>Then enter the following command to read the level of the GPIO port. If the level is 1, it means that the pull-up mode is set successfully.</p>{| styleclass="text-align: left;wikitable"|| style="text-alignwidth: left800px;"|
|-
| <p>root@orangepi:~/wiringOP# '''gpio read <span style="color:#FF0000">2</span>'''261</p><p>'''<span style="color:#FF0000">1</span>'''</p>|}</li><li><p>Then execute the following command to set the GPIO port to pull-down mode</p>{| class="wikitable" style="width:800px;" |-| <p>root@orangepi:~/wiringOP# '''PI5gpio mode <span style="color:#FF0000">2</span> down'''</p>|}</li><li><p>Then enter the following command to read the level of the GPIO port. If the level is 0, it means that the pull-down mode is set successfully.</p>{| class="wikitable" style="width:800px;" |-| <p>root@orangepi:~/wiringOP# '''TWI0_SCLgpio read <span style="color:#FF0000">2</UART2_TXspan>'''</p>| <p>'''15<span style="color:#FF0000">0</span>'''</p>|}</li></ol> <span id="pin-spi-test"></span> === 40pin SPI test === # As can be seen from the table below, the spi available for the 40pin interface is spi1, and there are two chip select pins cs0 and cs1 <div style="display: flex;">::{|class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"|-| '''16GPIO NO.'''| '''PWM4/UART4_RXGPIO'''| '''PI14Function'''| '''270pin'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''3.3V'''
| '''171'''|-| '''264'''| '''18PI8'''| style="text'''TWI1-align: left;"SDA'''|'''3'''|-| '''263'''| '''PI7'''| '''TWI1-SCL'''| '''5'''|-| '''269'''| '''PI13'''| '''PH4PWM3/UART4_TX'''| '''2287'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''GND'''
| '''9'''
|-
| '''232226'''| '''PH2'''| '''UART5_TX'''| '''11'''|-| '''227'''| '''PH3'''| '''UART5_RX'''| '''13'''|-| '''261'''| '''PI5'''| '''TWI0_SCL/UART2_TX'''| '''15'''|-| style="text-align: left;"|| style="text-align: left;"|| '''3.3V'''| '''17'''|-| '''<span style="color:#FF0000">231</span>'''| '''PH8<span style="color:#FF0000">PH7</span>'''| '''SPI1_MISO<span style="color:#FF0000">SPI1_MOSI</span>'''| '''21<span style="color:#FF0000">19</span>'''|-| '''22<span style="color:#FF0000">232</span>'''| '''TWI0_SDA<span style="color:#FF0000">PH8</UART2_RXspan>'''| '''PI6<span style="color:#FF0000">SPI1_MISO</span>'''| '''262<span style="color:#FF0000">21</span>'''
|-
| '''<span style="color:#FF0000">230</span>'''| '''<span style="color:#FF0000">PH6</span>'''| '''<span style="color:#FF0000">SPI1_CLK</span>'''| '''<span style="color:#FF0000">23'''|| '''24'''| '''SPI1_CS0'''| '''PH5'''| '''229</span>'''
|-
| style="text-align: left;"|
| '''GND'''
| '''25'''
|-
| '''266'''
| '''TWI2-SDA/UART3_RX'''
| '''27'''
|-
| '''256'''
| style="text-align: left;"|
| '''29'''
|-
| '''271'''
| style="text-align: left;"|
| '''31'''
|-
| '''268'''
| '''PWM2'''
| '''33'''
| '''PI2'''
| style="text-align: left;"|
| '''35'''
|-
| '''272'''
| style="text-align: left;"|
| '''37'''
|-
| style="text-align: left;"|
| '''GND'''
| '''39'''
|}
|-
| '''Multiplexing function in 40pin2'''| '''Corresponding dtbo configuration5V'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''40pin - i2c04'''| '''pi-i2c05V'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''40pin - i2c16'''| '''pi-i2c1GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''40pin - i2c28'''| '''pi-i2c2UART0_TX'''|} [[File:zero2w-img173.png]] <ol start="5" style="list-style-type: lower-alpha;"><li><p>Then select <span class="mark"><Save></span> to save</p><p>[[File:zero2w-img83.png]]</p></li><li><p>Then select '''<Back>PH0'''</p><p>[[File:zero2w-img84.png]]</p></li><li><p>Then select '''<Reboot>''' to restart the system to make the > configuration take effect.</p><p>[[File:zero2w-img85.png]]</p></li></ol> <!-- --><ol start="3" style="list-style-type: decimal;"><li><p>After starting the Linux system, first confirm that there is an open i2c device node under /dev</p><p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p><p>'''/dev/i2c-*'''</p><p>'''Sometimes the i2c device node and the i2c bus serial number do not correspond one to one. For example, the i2c device node of the i2c1 bus may be /dev/i2c-3.'''</p><p>'''The method to accurately confirm the device node under /dev corresponding to the i2c bus is: '''</p></li></ol> <!-- --><ol style="list-style-type: lower-alpha;"><li><p>'''First run the following command to check the corresponding relationship of i2c'''</p><p>orangepi@orangepizero2w:~$ '''ls /sys/devices/platform/soc*/*/i2c-* | grep "i2c-[0-9]"'''</p><p>/sys/devices/platform/soc/5002000.i2c/i2c-0:</p><p>/sys/devices/platform/soc/5002400.i2c/i2c-3:</p><p>/sys/devices/platform/soc/5002800.i2c/i2c-4:</p><p>/sys/devices/platform/soc/5002c00.i2c/i2c-5:</p><p>/sys/devices/platform/soc/6000000.hdmi/i2c-2:</p><p>/sys/devices/platform/soc/7081400.i2c/i2c-1:</p></li><li><p>'''In the above output224'''</p></li></ol> <!-- --><ol style="list-style-type: lower-alpha;"><li><p>5002000 is the register base address of the i2c0 bus, and i2c-0 shown behind it is its corresponding i2c device node</p></li><li><p>5002400 is the register base address of the i2c1 bus, and i2c-3 shown behind it is its corresponding i2c device node</p></li><li><p>5002800 is the register base address of the i2c2 bus, and i2c-4 shown behind it is its corresponding i2c device node</p></li></ol> <!-- --><ol start="4" style="list-style-type: decimal;"><li><p>Then start testing i2c, first install i2c-tools</p><p>orangepi@orangepi:~$ '''sudo apt-get update'''</p><p>orangepi@orangepi:~$ '''sudo apt-get install -y i2c-tools'''</p></li><li><p>Then connect an i2c device to the i2c pin of the 40pin connector</p></li><li><p>Then use the '''i2cdetect -y x''' x command. If the address of the connected i2c device can be detected, it means that i2c can be used normally.</p><p>'''Note that x in the i2cdetect -y x command needs to be replaced with the serial number of the device node corresponding to the i2c bus.'''</p><p>'''Different i2c device addresses are different. The 0x50 address in the picture below is just an example. Please refer to what you actually see.'''</p><div class="figure"> [[File:zero2w-img174.png]] </div></li></ol> <span id="pin-uart-test"></span>=== 40pin UART test === # As can be seen from the table below, the available uarts are uart2, uart3, uart4 and uart5. Please note that uart0 is set as a debugging serial port by default. Please do not use uart0 as a normal serial port. {| class="wikitable"
|-
| '''GPIO NO.10'''| '''GPIOUART0_RX'''| '''FunctionPH1'''| '''pin'''|| '''pin'''| '''Function'''| '''GPIO'''| '''GPIO NO.225'''
|-
| '''12'''
| style="text-align: left;"|
| '''PI1'''
| '''257'''
|-
| '''14'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''16'''
| '''PWM4/UART4_RX'''
| '''PI14'''
| '''270'''
|-
| '''18'''
| style="text-align: left;"|
| '''PH4'''
| '''228'''
|-
| '''26420'''| '''PI8'''| '''TWI1-SDA'''| '''3'''|| '''4'''| '''5VGND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''26322'''| '''PI7TWI0_SDA/UART2_RX'''| '''TWI1PI6'''| '''262'''|-| '''<span style="color:#FF0000">24</span>'''| '''<span style="color:#FF0000">SPI1_CS0</span>'''| '''<span style="color:#FF0000">PH5</span>'''| '''<span style="color:#FF0000">229</span>'''|-| '''<span style="color:#FF0000">26</span>'''| '''<span style="color:#FF0000">SPI1_CS1</span>'''| '''<span style="color:#FF0000">PH9</span>'''| '''<span style="color:#FF0000">233</span>'''|-| '''28'''| '''TWI2-SCL/UART3_TX'''| '''5PI9'''|'''265'''|-| '''630'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''26932'''| '''PI13PWM1'''| '''PWM3/UART4_TXPI11'''| '''7'''|| '''8'''| '''UART0_TX'''| '''PH0'''| '''224267'''
|-
| '''34'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''36'''
| style="text-align: left;"|
| '''GNDPC12'''| '''9'''|| '''10'''| '''UART0_RX'''| '''PH1'''| '''22576'''
|-
| '''226'''| '''PH2'''| '''UART5_TX'''| '''11'''|| '''1238'''
| style="text-align: left;"|
| '''PI1PI4'''| '''257260'''
|-
| '''22740'''| '''PH3'''| '''UART5_RX'''| '''13'''|| '''14'''| '''GND'''| style="text-align: left;"|
| style="text-align: left;"|
| '''PI3'''
| '''259'''
|}
</div>
<ol style="list-style-type: decimal;">
<li><p>In Linux systems, spi1 is turned off by default and needs to be turned on manually before it can be used. The opening steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>
|}
</li>
<li><p>Then select '''System'''</p>
<p>[[File:zero2w-img80.png]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:zero2w-img81.png]]</p></li>
<li><p>Then use the keyboard's arrow keys to locate the position shown in the figure below, and then use the '''space''' to select the dtbo configuration of the SPI you want to open.</p></li>
{| class="wikitable" style="width:800px;text-align: center;"
|-
| '''261dtbo configuration'''| '''PI5'''| '''TWI0_SCL/UART2_TX'''| '''15'''|| '''16'''| '''PWM4/UART4_RX'''| '''PI14'''| '''270illustrate'''
|-
|-
| '''231'''| '''PH7'''| '''SPI1_MOSI'''| '''19'''|| '''20spi1-cs0-spidev'''| '''GNDOnly open cs0 of spi1'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''232spi1-cs1-spidev'''| '''PH8Only open cs1 of spi1'''| } [[File:zero2w-img172.png]]</ol><ol start="5" style="list-style-type: lower-alpha;"><li><p>Then select '''SPI1_MISO<Save>'''to save</p>| <p>[[File:zero2w-img83.png]]</p></li><li><p>Then select '''21<Back>'''</p>|<p>[[File:zero2w-img84.png]]</p></li>| <li><p>Then select '''22<Reboot>'''to restart the system to make the configuration take effect.</p><p>[[File:zero2w-img85.png]]</p></li></ol>| '''TWI0_SDA</li></UART2_RX'''ol><ol start="2" style="list-style-type: decimal;">| <li><p>Then check whether there is a '''PI6spidev1.x'''device node in the Linux system. If it exists, it means that the SPI1 configuration has taken effect.</p>{| '''262'''class="wikitable" style="width:800px;"
|-
| '''230'''| '''PH6'''| '''SPI1_CLK'''| '''23'''|| <p>orangepi@orangepi:~$ '''24ls /dev/spidev1*'''</p>| '''SPI1_CS0'''<p>/dev/spidev1.0 /dev/spidev1.1</p>| '''PH5'''}{| '''229'''class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
| style="text<big><p>'''Note that only when you open spi1-cs0-cs1-align: left;"spidev, you will see the device nodes of the two spi.'''</p></big>|}</li><li><p>Next, start the spi loopback test. Do not short-circuit the mosi and miso pins of SPI1 first. The output result of running spidev_test is as follows. You can see that the data of TX and RX are inconsistent.</p>{| class="wikitable" style="text-alignwidth: left800px;"|-| <p>orangepi@orangepi:~$ '''GNDsudo spidev_test -v -D /dev/spidev1.0'''</p><p>spi mode: 0x0</p><p>bits per word: 8</p><p>max speed: 500000 Hz (500 KHz)</p><p>TX | FF FF FF FF FF FF '''25<span style="color:#FF0000">40 00 00 00 00 95</span>'''FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.…▒..................▒.</p><p>RX | FF FF FF FF FF FF '''26<span style="color:#FF0000">FF FF FF FF FF FF</span>'''FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF | ............................….</p>| }</li><li><p>Then short-circuit the two pins of SPI1 mosi (pin 19 in the 40pin interface) and miso (pin 21 in the 40pin interface) and then run spidev_test. The output is as follows. You can see the sending and receiving The data is the same, indicating that the loopback test passed.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''SPI1_CS1sudo spidev_test -v -D /dev/spidev1.0'''</p><p>spi mode: 0x0</p><p>bits per word: 8</p><p>max speed: 500000 Hz (500 KHz)</p><p>TX | FF FF FF FF FF FF '''PH9<span style="color:#FF0000">40 00 00 00 00 95</span>'''FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p><p>RX | FF FF FF FF FF FF '''233<span style="color:#FF0000">40 00 00 00 00 95</span>'''FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p>|}</li></ol> <span id="pin-i2c-test"></span> === 40pin I2C test === # As can be seen from the table below, the i2c available for the 40pin interface are i2c0, i2c1 and i2c2 <div style="display: flex;">::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
|-
| '''266GPIO NO.'''| '''PI10GPIO'''| '''TWI2-SDA/UART3_RXFunction'''| '''27'''|| '''28'''| '''TWI2-SCL/UART3_TX'''| '''PI9'''| '''265pin'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''3.3V'''
| '''1'''
|-
| '''<span style="color:#FF0000">264</span>'''
| '''<span style="color:#FF0000">PI8</span>'''
| '''<span style="color:#FF0000">TWI1-SDA</span>'''
| '''<span style="color:#FF0000">3</span>'''
|-
| '''<span style="color:#FF0000">263</span>'''
| '''<span style="color:#FF0000">v</span>'''
| '''<span style="color:#FF0000">TWI1-SCL</span>'''
| '''<span style="color:#FF0000">5</span>'''
|-
| '''271269'''| '''PI15'''| style="text-align: left;"|| '''31'''|| '''32'''| '''PWM1PI13'''| '''PI11PWM3/UART4_TX'''| '''2677'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''GND'''
| '''9'''
|-
| '''226'''
| '''PH2'''
| '''UART5_TX'''
| '''11'''
|-
| '''227'''
| '''PH3'''
| '''UART5_RX'''
| '''13'''
|-
| '''<span style="color:#FF0000">261</span>'''
| '''<span style="color:#FF0000">PI5</span>'''
| '''<span style="color:#FF0000">TWI0_SCL</span>/UART2_TX'''
| '''<span style="color:#FF0000">15</span>'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''PC123.3V'''| '''7617'''|-| '''231'''| '''PH7'''| '''SPI1_MOSI'''| '''19'''|-| '''232'''| '''PH8'''| '''SPI1_MISO'''| '''21'''
|-
| '''272230'''| '''PI16PH6'''| style="text-align: left;"|| '''37'''|| '''38'''| style="text-align: left;"|| '''PI4SPI1_CLK'''| '''26023'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''GND'''
| '''3925'''|-| '''40<span style="color:#FF0000">266</span>'''| '''<span style="color:#FF0000">PI10</span>'''| '''<span style="color:#FF0000">TWI2-SDA</span>/UART3_RX'''| '''<span style="color:#FF0000">27</span>'''|-| '''256'''| '''PI0'''
| style="text-align: left;"|
| '''PI329'''| '''259'''|} <ol start="2" style="list-style-type: decimal;"><li><p>In Linux systems, uart is turned off by default and needs to be turned on manually before it can be used. The opening steps are as follows:</p><ol style="list-style-type: lower-alpha;"><li><p>First run '''orangepi-config'''. Ordinary users remember to add > '''sudo''' permissions.</p><p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li><li><p>Then select '''System'''</p><p>[[File:zero2w-img80.png]]</p></li><li><p>Then select '''Hardware'''</p><p>[[File:zero2w-img81.png]]</p></li><li><p>Then use the keyboard's arrow keys to locate the position shown > in the picture below, and then use the '''space''' to select the > serial port you want to open.</p></li></ol></li></ol> {| class="wikitable"
|-
| '''Multiplexing function in 40pin271'''| '''Corresponding dtbo configurationPI15'''| style="text-align: left;"|| '''31'''
|-
| '''40pin - uart2268'''| '''pi-uart2PI12'''| '''PWM2'''| '''33'''
|-
| '''40pin - uart3258'''| '''piPI2'''| style="text-uart3align: left;"|| '''35'''
|-
| '''40pin - uart4272'''| '''piPI16'''| style="text-uart4align: left;"|| '''37'''
|-
| style="text-align: left;"|| style="text-align: left;"|| '''40pin - uart5GND'''| '''ph-uart539'''
|}
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''4'''
| '''5V'''
| style="text-align: left;"|
|-
| '''6'''
| '''GND'''
| style="text-align: left;"|
|-
| '''8'''
| '''UART0_TX'''
| '''224'''
|-
| '''10'''
| '''UART0_RX'''
| '''225'''
|-
| '''12'''
| style="text-align: left;"|
| '''257'''
|-
| '''14'''
| '''GND'''
| style="text-align: left;"|
|-
| '''16'''
| '''PWM4/UART4_RX'''
| '''270'''
|-
| '''18'''
| style="text-align: left;"|
| '''228'''
|-
| '''20'''
| '''GND'''
| style="text-align: left;"|
|-
| '''232'''| '''PH8'''| '''SPI1_MISO'''| '''21'''|| '''<span style="color:#FF0000">22</span>'''| '''<span style="color:#FF0000">TWI0_SDA</span>/UART2_RX'''| '''<span style="color:#FF0000">PI6</span>'''| '''<span style="color:#FF0000">262</span>'''
|-
| '''24'''
| '''SPI1_CS0'''
| '''229'''
|-
| '''26'''
| '''SPI1_CS1'''
| '''233'''
|-
| '''266'''| '''PI10'''| '''TWI2-SDA<span style="color:#FF0000">28</UART3_RX'''| '''27'''|| '''28span>'''| '''<span style="color:#FF0000">TWI2-SCL</span>/UART3_TX'''| '''<span style="color:#FF0000">PI9</span>'''| '''<span style="color:#FF0000">265</span>'''
|-
| '''30'''
| '''GND'''
| style="text-align: left;"|
|-
| '''32'''
| '''PWM1'''
| '''267'''
|-
| '''34'''
| '''GND'''
| style="text-align: left;"|
|-
| '''36'''
| style="text-align: left;"|
| '''76'''
|-
| '''38'''
| style="text-align: left;"|
| '''260'''
|-
| '''40'''
| style="text-align: left;"|
| '''259'''
|}
</div>
<ol start="2" style="list-style-type: decimal;">
<li><p>pwm i2c is turned off by default in Linux systems and needs to be turned on manually to use it. The opening steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users remember to add > '''sudo''' permissions.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>|}</li>
<li><p>Then select '''System'''</p>
<p>[[File:zero2w-img80.png]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:zero2w-img81.png]]</p></li>
<li><p>Then use the keyboard's arrow keys to locate the position shown > in the figure picture below, and then use the '''space''' to select the > corresponding i2c configuration corresponding to in the pwm you want to openpicture below.</p><p/li> {| class="wikitable" style="width:800px;text-align: center;"|-| '''Multiplexing function in 40pin'''| '''Corresponding dtbo configuration'''|-| '''40pin - i2c0'''| '''pi-i2c0'''|-| '''40pin - i2c1'''| '''pi-i2c1'''|-| '''40pin - i2c2'''| '''pi-i2c2'''|} [[File:zero2w-img176img173.png]]</pol></liol start="5" style="list-style-type: lower-alpha;"><li><p>Then select '''<span class="mark"><Save>''' </span> to save</p>
<p>[[File:zero2w-img83.png]]</p></li>
<li><p>Then select '''<Back>'''</p>
<p>[[File:zero2w-img84.png]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system to make the > configuration take effect.</p>
<p>[[File:zero2w-img85.png]]</p></li></ol>
</li></ol>
<ol start="3" style="list-style-type: decimal;">
<li><p>After starting the Linux system, first confirm that there is an open i2c device node under /dev</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p>
<p>'''/dev/i2c-*'''</p>
|}
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
|
<big><p>'''Sometimes the i2c device node and the i2c bus serial number do not correspond one to one. For example, the i2c device node of the i2c1 bus may be /dev/i2c-3.'''</p>
<p>'''The method to accurately confirm the device node under /dev corresponding to the i2c bus is: '''</p></big>
<li><p>'''In the above output'''</p>
<ol style="list-style-type: none;">
<li><p>a) 5002000 is the register base address of the i2c0 bus, and i2c-0 shown behind it is its corresponding i2c device node</p></li>
<li><p>b) 5002400 is the register base address of the i2c1 bus, and i2c-3 shown behind it is its corresponding i2c device node</p></li>
<li><p>c) 5002800 is the register base address of the i2c2 bus, and i2c-4 shown behind it is its corresponding i2c device node</p></li></ol>
</li></ol>
|}
</li></ol>
<ol start="4" style="list-style-type: decimal;">
<li><p>Then start testing i2c, first install i2c-tools</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y i2c-tools'''</p>
|}
</li>
<li><p>Then connect an i2c device to the i2c pin of the 40pin connector</p></li>
<li><p>Then use the '''i2cdetect -y x''' x command. If the address of the connected i2c device can be detected, it means that i2c can be used normally.</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
|
<big><p>'''Note that x in the i2cdetect -y x command needs to be replaced with the serial number of the device node corresponding to the i2c bus.'''</p>
<p>'''Different i2c device addresses are different. The 0x50 address in the picture below is just an example. Please refer to what you actually see.'''</p></big>
|}
<div class="figure">
[[File:zero2w-img177img174.png]]
</div><span id="how-to-install-and-use-wiringop-python"/li></spanol>== How to install and use wiringOP-Python ==
<span iddiv style="how-to-install-wiringop-pythondisplay: flex;"></span>::{| class=== How to install wiringOP-Python === <ol "wikitable" style="listwidth:390px;margin-styleright: 20px;text-typealign: decimalcenter;"><li><p>First install dependency packages</p>|-<p>root@orangepi:~# | '''sudo apt-get updateGPIO NO.'''</p><p>root@orangepi:~# | '''sudo apt-get -y install git swig python3-dev python3-setuptoolsGPIO'''</p></li><li><p>Then use the following command to download the source code of wiringOP-Python</p></li></ol>| '''Function'''| '''Note that the following git clone--recursive command will automatically download the source code of wiringOP, because wiringOP-Python depends on wiringOP. Please make sure there are no errors during the download process due to network problems.pin'''|-| style="text-align: left;"|If there is a problem downloading the code from GitHub, you can directly use the wiringOP| style="text-Python source code that comes with the Linux image. The storage location isalign: left;"|| '''/usr/src/wiringOP-Python3.3V''' root@orangepi:~# | '''git clone --recursive https://github.com/orangepi-xunlong/wiringOP-Python -b next1'''|-root@orangepi:~# | '''cd wiringOP-Python264''' root@orangepi:~/wiringOP-Python# | '''git submodule update --init --remotePI8''' <ol start="3" style="list-style-type: decimal;"><li><p>Then use the following command to compile wiringOP-Python and install it into the Linux system of the development board</p><p>root@orangepi:~# | '''cd wiringOPTWI1-PythonSDA'''</p><p>root@orangepi:~/wiringOP-Python# | '''python3 generate-bindings.py > bindings.i3'''</p><p>root@orangepi:~/wiringOP|-Python# | '''sudo python3 setup.py install263'''</p></li><li><p>Then enter the following command. If helpful information is output, it means wiringOP-Python is successfully installed. Press the | '''qPI7''' key to exit the help information interface.</p></li></ol> root@orangepi:~/wiringOP-Python# | '''python3 TWI1-c "import wiringpi; help(wiringpi)"SCL''' Help on module wiringpi: NAME wiringpi DESCRIPTION # This file was automatically generated by SWIG (http://www.swig.org). # Version 4.0.2 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. <ol start="| '''5" style="list-style-type: decimal;">'''<li><p>The steps to test whether wiringOP|-Python is installed successfully under the python command line are as follows:</p><ol style="list-style-type: lower-alpha;"><li>First use the python3 command to enter the command line mode of > python3</li></ol></li></ol> root@orangepi:~# | '''python3269''' <ol start="2" style="list-style-type: lower-alpha;"><li>Then import the python module of wiringpi</li></ol> >>> | '''import wiringpi;PI13''' <ol start="3" style="list-style-type: lower-alpha;"><li>Finally, enter the following command to view the help information of > wiringOP-Python. Press the q key to exit the help information > interface.</li></ol> >>> | '''help(wiringpi)PWM3/UART4_TX''' Help on module wiringpi: NAME wiringpi DESCRIPTION # This file was automatically generated by SWIG (http://www.swig.org). # Version 4.0.2 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. CLASSES builtins.object GPIO I2C Serial nes class GPIO(builtins.object) | GPIO(pinmode=0) | >>> <span id="pin-gpio-port-test-1"></span>=== 40pin GPIO port test === '''Like wiringOP, wiringOP-Python can also determine which GPIO pin to operate by specifying the wPi number. Because there is no command to view the wPi number in wiringOP-Python, you can only view the board's wPi number and physics through the gpio command in wiringOP Correspondence of pins.7''' [[File:zero2w|-img170.png]] <ol | style="list-styletext-typealign: decimalleft;">|<li><p>The following uses pin No. 7 - corresponding to GPIO PI13 - corresponding to wPi serial number 2 - as an example to demonstrate how to set the high and low levels of the GPIO port.</p><p>[[File:zero2w-img171.png]]</p></li><li><p>The steps for testing directly with commands are as follows:</p><ol | style="list-styletext-typealign: lower-alphaleft;">|<li><p>First set the GPIO port to output mode, where the first > parameter of the | '''pinModeGND''' function is the serial number of > the wPi corresponding to the pin, and the second parameter is > the GPIO mode.</p><p>root@orangepi:~/wiringOP-Python# | '''python3 -c "import wiringpi; \9'''</p><p>|-| '''from wiringpi import GPIO; wiringpi.wiringPiSetup() ; \226'''</p><p>| '''wiringpi.pinMode(2, GPIO.OUTPUT) ; "PH2'''</p></li><li><p>Then set the GPIO port to output a low level. After setting, you > can use a multimeter to measure the voltage value of the pin. > If it is 0v, it means the low level is set successfully.</p><p>root@orangepi:~/wiringOP-Python# | '''python3 -c "import wiringpi; \UART5_TX'''</p><p>| '''from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\11'''</p><p>|-| '''wiringpi.digitalWrite(2, GPIO.LOW)"227'''</p></li><li><p>Then set the GPIO port to output a high level. After setting, > you can use a multimeter to measure the voltage value of the > pin. If it is 3.3v, it means the setting of the high level is > successful.</p><p>root@orangepi:~/wiringOP-Python# | '''python3 -c "import wiringpi; \PH3'''</p><p>| '''from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\UART5_RX'''</p><p>| '''wiringpi.digitalWrite(2, GPIO.HIGH)"13'''</p></li></ol></li><li><p>The steps for testing in the command line of python3 are as follows:</p><ol style="list-style|-type: lower-alpha;"><li><p>First use the python3 command to enter the command line mode of > python3</p><p>root@orangepi:~# | '''python3261'''</p></li><li><p>Then import the python module of wiringpi</p><p>>>> | '''import wiringpiPI5'''</p><p>>>> '''from wiringpi import GPIO| '''</p><TWI0_SCL/li><li><p>Then set the GPIO port to output mode, where the first parameter > of the 'UART2_TX''pinMode'''function is the serial number of the wPi > corresponding to the pin, and the second parameter is the GPIO > mode.</p><p>>>> | '''wiringpi.wiringPiSetup()15'''</p><p>0</p>|-<p>>| style="text-align: left;>> '''wiringpi.pinMode(2, GPIO.OUTPUT)'''</p></li>"|<li><p>Then set the GPIO port to output a low level. After setting, you >| style="text-align: left; can use a multimeter to measure the voltage value of the pin. > If it is 0v, it means the low level is set successfully.</p>"|<p>>>> | '''wiringpi3.digitalWrite(2, GPIO.LOW)3V'''</p></li><li><p>Then set the GPIO port to output a high level. After setting, > you can use a multimeter to measure the voltage value of the > pin. If it is 3.3v, it means the setting of the high level is > successful.</p><p>>>> | '''wiringpi.digitalWrite(2, GPIO.HIGH)17'''</p></li></ol></li><li><p>For wiringOP|-Python to set the GPIO high and low levels in the python code, you can refer to the '''blink.py''' test program in the examples. The '''blink.py''' test program will set the voltage of all GPIO ports in the 40 Pin of the development board to continuously change high and low.</p><p>root@orangepi:~/wiringOP-Python# | '''cd examples231'''</p><p>root@orangepi:~/wiringOP-Python/examples# | '''ls blink.pyPH7'''</p><p>| '''blink.pySPI1_MOSI'''</p><p>root@orangepi:~/wiringOP-Python/examples| '''# python3 blink.py19'''</p></li></ol> <span id="pin-spi-test-1"></span>=== 40pin SPI test === # As can be seen from the table below, the spi available for the 40pin interface is spi1, and there are two chip select pins cs0 and cs1 {| class="wikitable"|-| '''GPIO NO.232'''| '''GPIOPH8'''| '''FunctionSPI1_MISO'''| '''Pin21'''|-| '''Pin230'''| '''FunctionPH6'''| '''GPIOSPI1_CLK'''| '''GPIO NO.23'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''3.3VGND'''| '''25'''|-| '''266'''| '''PI10'''| '''TWI2-SDA/UART3_RX'''| '''27'''|-| '''256'''| '''PI0'''| style="text-align: left;"|| '''29'''|-| '''271'''| '''PI15'''| style="text-align: left;"|| '''31'''|-| '''268'''| '''PI12'''| '''PWM2'''| '''33'''|-| '''258'''| '''PI2'''| style="text-align: left;"|| '''35'''|-| '''272'''| '''PI16'''| style="text-align: left;"|| '''37'''|-| style="text-align: left;"|| style="text-align: left;"|| '''GND'''| '''39'''|}{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"|-| '''pin'''| '''Function'''| '''GPIO'''| '''1GPIO NO.'''|-
| '''2'''
| '''5V'''
| style="text-align: left;"|
|-
| '''4'''
| '''5V'''
| style="text-align: left;"|
|-
| '''6'''
| '''GND'''
| style="text-align: left;"|
|-
| '''8'''
| '''UART0_TX'''
| '''224'''
|-
| '''10'''
| '''UART0_RX'''
| '''225'''
|-
| style="text-align: left;"|
| '''PI1'''
| '''257'''
|-
| '''14'''
| '''GND'''
| style="text-align: left;"|
|-
| '''16'''
| '''PWM4/UART4_RX'''
| '''270'''
|-
| '''18'''
| style="text-align: left;"|
| '''228'''
|-
| '''20'''
| '''GND'''
| style="text-align: left;"|
|-
| '''22'''
| '''TWI0_SDA/UART2_RX'''
| '''262'''
|-
| '''24'''
| '''SPI1_CS0'''
| '''229'''
|-
| '''26'''
| '''SPI1_CS1'''
| '''233'''
|-
| '''28'''
| '''TWI2-SCL/UART3_TX'''
| '''265'''
|-
| '''30'''
| '''GND'''
| style="text-align: left;"|
|-
| '''32'''
| '''PWM1'''
| '''267'''
|-
| '''34'''
| '''GND'''
| style="text-align: left;"|
|-
| style="text-align: left;"|
| '''PC12'''
| '''76'''
|-
| '''38'''
| style="text-align: left;"|
| '''260'''
|-
| '''40'''
| style="text-align: left;"|
| '''259'''
|}
</div>
<ol start="2" style="list-style-type: decimal;">
<li><p>In Linux systems, spi1 uart is turned off by default and needs to be turned on manually before it can be used. The opening steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users remember to add > '''sudo''' permissions.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>|}</li>
<li><p>Then select '''System'''</p>
<p>[[File:zero2w-img80.png]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:zero2w-img81.png]]</p></li>
<li><p>Then use the keyboard's arrow keys to locate the position shown > in the figure picture below, and then use the '''space''' to select the > dtbo configuration of the SPI serial port you want to open.</p></li></ol></li></ol>
{| class="wikitable"style="width:800px;text-align: center;"|-| '''Multiplexing function in 40pin'''| '''Corresponding dtbo configuration'''
|-
| '''dtbo configuration40pin - uart2'''| '''illustratepi-uart2'''
|-
| '''spi140pin -cs0-cs1-spidevuart3'''| '''Open cs0 and cs1 of spi1 at the same timepi-uart3'''
|-
| '''spi140pin -cs0-spidevuart4'''| '''Only open cs0 of spi1pi-uart4'''
|-
| '''spi140pin -cs1-spidevuart5'''| '''Only open cs1 of spi1ph-uart5'''
|}
[[File:zero2w-img175.png]]
</ol>
<ol start="5" style="list-style-type: lower-alpha;">
<li><p>Then select '''<Save>''' to save</p>
<li><p>Then select '''<Back>'''</p>
<p>[[File:zero2w-img84.png]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system to make the > configuration take effect.</p>
<p>[[File:zero2w-img85.png]]</p></li></ol>
</li></ol>
<!-- -->
<ol start="3" style="list-style-type: decimal;">
<li><p>Then check After entering the Linux system, first confirm whether there is a '''spidev1.x''' uart5 device node in the Linux system. If it exists, it means that the SPI1 configuration has taken effect.</p><p>orangepi@orangepi:~$ under '''ls /dev/spidev1*'''</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <p>/dev/spidev1.0 /dev/spidev1.1</pbig><p>'''Note that only when you open spi1-cs0-cs1-spidev, you will see the device nodes of the two spilinux5.4 system is /dev/ttyASx.'''</p></libig><li><p>Then you can use the '''spidev_test.py''' program in examples to test the SPI loopback function. The '''spidev_test.py''' program needs to specify the following two parameters:</p>|}<ol {| class="wikitable" style="list-style-typewidth: lower-alpha800px;"><li>|-| <p>orangepi@orangepi:~$ '''--channells /dev/ttyS*''': Specify the channel number of SPI</p></li><li><p>'''--port''': Specify the port number of the SPI</p><dev/li>ttySx</olp>|}
</li>
<li><p>Without shorting Then start testing the mosi uart interface. First use Dupont wire to short-circuit the rx and miso tx pins of SPI1, the output result uart interface to be tested.</p></li><li><p>Use the '''gpio''' command in wiringOP to test the loopback function of running spidev_test.py is the serial port as followsshown below. You If you can see the following print, it means the serial port communication is normal.</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that the data last x in the gpio serial /dev/ttySx command needs to be replaced with the serial number of TX and RX are inconsistentthe corresponding uart device node.'''</p></big>|}{| class="wikitable" style="width:800px;" |-| <p>rootorangepi@orangepi:~/wiringOP-Python# $ '''cd examplesgpio serial /dev/ttySx # linux-6.1 test command'''</p><p>orangepi@orangepi:~$ '''gpio serial /li>dev/ttyASx # linux-5.4 test command'''</olp>
<ol start="6" div style="list-style-typedisplay: decimalflex;"><li><p>Then use Dupont wire to short-circuit the txd (pin 19 in the 40pin interface) and rxd (pin 21 in the 40pin interface) of SPI1 and then run spidev_test.py. The output is as follows, you can see If the data sent and received are the same, it means that the SPI1 loopback test is normal.</p><p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p></li></ol> root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py \''' '''--channel 1 --port 0''' spi mode: 0x0 max speed: 500000 Hz (500 KHz) Opening device /dev/spidev1.1 TX {| FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…| RX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…| <span idclass="pin-i2c-test-1wikitable"></span>=== 40pin I2C test === # As can be seen from the table below, the i2c available for the 40pin interface are i2c0, i2c1 and i2c2 {| classstyle="wikitablewidth:390px;margin-right: 20px;text-align: center;"
|-
| '''GPIO NO.'''
| '''Function'''
| '''Pin'''
|-
| style="text-align: left;"|
| '''3.3V'''
| '''1'''
|-
| '''264'''
| '''TWI1-SDA'''
| '''3'''
| '''263'''
| '''PI7'''
| '''TWI1-SCL'''
| '''5'''
|-
| '''<span style="color:#FF0000">269</span>'''| '''<span style="color:#FF0000">PI13</span>'''| '''<span style="color:#FF0000">PWM3</span>/UART4_TX'''| '''<span style="color:#FF0000">7'''|| '''8'''| '''UART0_TX'''| '''PH0'''| '''224</span>'''
|-
| style="text-align: left;"|
| '''GND'''
| '''9'''
|-
| '''226'''
| '''UART5_TX'''
| '''11'''
|-
| '''227'''
| '''UART5_RX'''
| '''13'''
|-
| '''261'''
| '''TWI0_SCL/UART2_TX'''
| '''15'''
|-
| style="text-align: left;"|
| '''3.3V'''
| '''17'''
|-
| '''231'''
| '''SPI1_MOSI'''
| '''19'''
|-
| '''232'''
| '''SPI1_MISO'''
| '''21'''
|-
| '''230'''
| '''SPI1_CLK'''
| '''23'''
|-
| style="text-align: left;"|
| '''GND'''
| '''25'''
| '''PI10'''
| '''TWI2-SDA/UART3_RX'''
| '''27'''
|-
| '''256'''
| style="text-align: left;"|
| '''29'''
|-
| '''271'''
| style="text-align: left;"|
| '''31'''
|-
| '''<span style="color:#FF0000">268</span>'''| '''<span style="color:#FF0000">PI12</span>'''| '''<span style="color:#FF0000">PWM2</span>'''| '''33'''|| '''34'''| '''GND'''| <span style="text-aligncolor: left;#FF0000"|| style="text-align: left;"|>33</span>'''
|-
| '''258'''
| style="text-align: left;"|
| '''35'''
|-
| '''272'''
| style="text-align: left;"|
| '''37'''
|-
| style="text-align: left;"|
| '''GND'''
| '''39'''
|}
|-
| '''Multiplexing function in 40pinPin'''| '''Corresponding dtbo configurationFunction'''| '''GPIO'''| '''GPIO NO.'''
|-
| '''40pin 2'''| '''5V'''| style="text-align: left;"|| style="text-align: left;"||-| '''4'''| '''5V'''| style="text-align: left;"|| style="text-align: left;"||-| '''6'''| '''GND'''| style="text-align: left;"|| style="text-align: left;"||-| '''8'''| '''UART0_TX'''| '''PH0'''| '''224'''|-| '''10'''| '''UART0_RX'''| '''PH1'''| '''225'''|-| '''12'''| style="text- i2c0align: left;"|| '''PI1'''| '''pi257'''|-i2c0| '''14'''| '''GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''40pin - i2c1'''| '''pi-i2c1'''|-| '''40pin - i2c2'''| '''pi-i2c2'''|} [[File:zero2w-img173.png]] <ol start="5" style="list-style-type: lower-alpha;"><li><p>Then select <span class="mark"><Save></span> to save</p><p>[[File:zero2w-img83.png]]</p></li><li><p>Then select <span class="mark"><Back></span></p><p>[[File:zero2w-img84.png]]</p></li><li><p>Then select <span class="mark"><Reboot></span> to restart the system to make the > configuration take effect.</p><p>[[File:zero2w-img85.png]]</p></li></ol> <!-- --><ol start="3" style="list-style-typecolor: decimal;#FF0000"><li><p>After starting the Linux system, first confirm that there is an open i2c device node under <span class="mark">/dev16</span></p><p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p><p>'''/dev/i2c-*| '''</p><p>'''Sometimes the i2c device node and the i2c bus serial number do not correspond one to one. For example, the i2c device node of the i2c1 bus may be /dev/i2c-3.'''</p><p>'''The method to accurately confirm the device node under /dev corresponding to the i2c bus is:'''</p></li></ol> <!-- --><ol start="3" span style="list-style-typecolor: lower-alpha;#FF0000"><li><p>'''First run the following command to check the corresponding relationship of i2c'''PWM4</p><pspan>orangepi@orangepizero2w:~$ '''ls /sys/devices/platform/soc*/*/i2c-* | grep "i2c-[0-9]"UART4_RX'''</p><p>/sys/devices/platform/soc/5002000.i2c/i2c-0:</p><p>/sys/devices/platform/soc/5002400.i2c/i2c-3:</p><p>/sys/devices/platform/soc/5002800.i2c/i2c-4:</p><p>/sys/devices/platform/soc/5002c00.i2c/i2c-5:</p><p>/sys/devices/platform/soc/6000000.hdmi/i2c-2:</p><p>/sys/devices/platform/soc/7081400.i2c/i2c-1:</p></li><li><p>'''In the above output| '''</p></li></ol> <!-- --><ol start="4" span style="list-style-typecolor: lower-alpha;#FF0000"><li><p>002000 is the register base address of the i2c0 bus, and i2c-0 shown behind it is its corresponding i2c device nodePI14</p></li><li><p>5002400 is the register base address of the i2c1 bus, and i2c-3 shown behind it is its corresponding i2c device node</p></li><li><p>5002800 is the register base address of the i2c2 bus, and i2c-4 shown behind it is its corresponding i2c device node</p></li></ol> <!-- --><ol start="4" style="list-style-type: decimal;"><lispan><p>Then start testing i2c, first install i2c-tools</p><p>orangepi@orangepi:~$ '''sudo apt-get update'''</p><p>orangepi@orangepi:~$ '''sudo''' '''apt-get install -y i2c-tools| '''</p></li><li><p>Then connect an i2c device to the i2c pin of the 40pin connector. Here we take the DS1307 RTC module as an example.</p><p>[[File:zero2w-img178.png]]</p></li><li><p>Then use the '''i2cdetect -y x'''command. If the address of the connected i2c device can be detected, it means that the i2c device is connected correctly.</p><p>'''Note that x in the i2cdetect -y x command needs to be replaced with the serial number of the device node corresponding to the i2c bus.'''</p></li></ol> [[File:zero2w-img179.png]] <ol start="7" span style="list-style-type: decimal;"><li><p>Then you can run the '''ds1307.py''' test program in '''examples''' to read the RTC time</p><p>'''Note that the x in i2c-x in the following command needs to be replaced with the serial number of the device node corresponding to the i2c bus.'''</p><p>root@orangepicolor:~/wiringOP-Python# '''cd examples'''</p><p>root@orangepi:~/wiringOP-Python/examples# '''python3 ds1307.py --device \'''</p><p>'''"/dev/i2c-x"'''</p><p>Thu 2022-06-16 04:35:46</p><p>Thu 2022-06-16 04:35:47</p><p>Thu 2022-06-16 04:35:48</p><p>^C</p><p>exit</p></li></ol> <span id="pin-uart-test-1FF0000">270</span>=== 40pin UART test === # As can be seen from the table below, the available uarts are uart2, uart3, uart4 and uart5. Please note that uart0 is set as a debugging serial port by default. Please do not use uart0 as a normal serial port. {| class="wikitable"|-| '''GPIO NO.'''| '''GPIO'''| '''Function'''| '''Pin'''|| '''Pin'''| '''Function'''| '''GPIO'''| '''GPIO NO.'''
|-
| '''18'''
| style="text-align: left;"|
|-
| '''26420'''| '''PI8'''| '''TWI1-SDA'''| '''3'''|| '''4'''| '''5VGND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''26322'''| '''PI7TWI0_SDA/UART2_RX'''| '''TWI1PI6'''| '''262'''|-| '''24'''| '''SPI1_CS0'''| '''PH5'''| '''229'''|-| '''26'''| '''SPI1_CS1'''| '''PH9'''| '''233'''|-| '''28'''| '''TWI2-SCL/UART3_TX'''| '''5PI9'''|'''265'''|-| '''630'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''269<span style="color:#FF0000">32</span>'''| '''PI13<span style="color:#FF0000">PWM1</span>'''| '''PWM3<span style="color:#FF0000">PI11</UART4_TXspan>'''| '''7'''|| '''8'''| '''UART0_TX'''| '''PH0'''| '''224<span style="color:#FF0000">267</span>'''
|-
| '''34'''
| '''GND'''
| style="text-align: left;"|
| style="text-align: left;"|
|-
| '''226'''| '''PH2'''| '''UART5_TX'''| '''11'''|| '''1236'''
| style="text-align: left;"|
| '''PI1PC12'''| '''25776'''
|-
| '''227'''| '''PH3'''| '''UART5_RX'''| '''13'''|| '''14'''| '''GND38'''
| style="text-align: left;"|
| '''PI4'''
| '''260'''
|-
| '''40'''
| style="text-align: left;"|
| '''PI3'''
| '''259'''
|}
</div>
<ol start="2" style="list-style-type: decimal;">
<li><p>pwm is turned off by default in Linux systems and needs to be turned on manually to use it. The opening steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>
{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''261sudo orangepi-config'''</p>| }</li><li><p>Then select '''PI5System'''</p><p>[[File:zero2w-img80.png]]</p></li>| <li><p>Then select '''TWI0_SCL/UART2_TXHardware'''</p><p>[[File:zero2w-img81.png]]</p></li>| <li><p>Then use the keyboard's arrow keys to locate the position shown in the figure below, and then use the '''15space'''to select the configuration corresponding to the pwm you want to open.</p>|<p>[[File:zero2w-img176.png]]</p></li>| <li><p>Then select '''16<Save>'''to save</p><p>[[File:zero2w-img83.png]]</p></li>| <li><p>Then select '''PWM4/UART4_RX<Back>'''</p><p>[[File:zero2w-img84.png]]</p></li>| <li><p>Then select '''PI14<Reboot>'''to restart the system to make the configuration take effect.</p><p>[[File:zero2w-img85.png]]</p></li></ol></li><li><p>After restarting, you can start the PWM test</p>{| '''270'''class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
|-
| <p>root@orangepi:~# '''231echo 1 > /sys/class/pwm/pwmchip0/export'''</p>| <p>root@orangepi:~# '''PH7echo 20000000 > /sys/class/pwm/pwmchip0/pwm1/period'''</p>| <p>root@orangepi:~# '''SPI1_MOSIecho 1000000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle'''</p>| <p>root@orangepi:~# '''19echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable'''</p>|}| '''20'''</li>| '''GND'''<li><p>Enter the following command on the command line to make pwm2 output a 50Hz square wave</p></li>{| styleclass="text-align: left;wikitable"|| style="text-alignwidth: left800px;"|
|-
| root@orangepi:~# '''232echo 2 > /sys/class/pwm/pwmchip0/export'''| root@orangepi:~# '''PH8echo 20000000 > /sys/class/pwm/pwmchip0/pwm2/period'''| '''SPI1_MISO'''| root@orangepi:~# '''21echo 1000000 > /sys/class/pwm/pwmchip0/pwm2/duty_cycle'''|| root@orangepi:~# '''22echo 1 > /sys/class/pwm/pwmchip0/pwm2/enable'''| '''TWI0_SDA}</UART2_RX'''ol><ol start="3" style="list-style-type: lower-alpha;">| '''PI6'''<li>Enter the following command on the command line to make pwm3 output a 50Hz square wave</li>{| '''262'''class="wikitable" style="width:800px;"
|-
| root@orangepi:~# '''230echo 3 > /sys/class/pwm/pwmchip0/export'''| root@orangepi:~# '''PH6echo 20000000 > /sys/class/pwm/pwmchip0/pwm3/period'''| root@orangepi:~# '''SPI1_CLKecho 1000000 > /sys/class/pwm/pwmchip0/pwm3/duty_cycle'''| root@orangepi:~# '''23echo 1 > /sys/class/pwm/pwmchip0/pwm3/enable'''|}| '''24'''</ol>| '''SPI1_CS0'''<ol start="4" style="list-style-type: lower-alpha;">| '''PH5'''<li>Enter the following command on the command line to make pwm4 output a 50Hz square wave</li>{| '''229'''class="wikitable" style="width:800px;"
|-
|-
| '''266'''| ''<big>'PI10''Note: The pin header on the 40pin interface is not soldered by default, and you need to solder it yourself before it can be used.'| '''TWI2-SDA</UART3_RX'''| '''27'''big>|}{| '''28'''| '''TWI2class="wikitable" style="background-SCL/UART3_TX'''| '''PI9'''| '''265'''color:#ffffdc;width:800px;"
|-
| <big>'''wiringOP-Python is the Python language version of wiringOP library, used to operate the development board'256s GPIO, I2C, SPI, UART and other hardware resources in the Python program'''| '''PI0Also please note that all the following commands are operated under the root user.'''</big>| style} <span id="texthow-to-install-align: left;wiringop-python"|></span>| '''29'''=== How to install wiringOP-Python ===|| '''30'''| '''GND'''| <ol style="textlist-alignstyle-type: leftdecimal;"|><li><p>First install dependency packages</p>{| class="wikitable" style="text-alignwidth: left800px;"|
|-
| <p>root@orangepi:~# '''271sudo apt-get update'''</p>| <p>root@orangepi:~# '''PI15sudo apt-get -y install git swig python3-dev python3-setuptools'''</p>|}</li><li><p>Then use the following command to download the source code of wiringOP-Python</p></li>{| class="wikitable" style="textbackground-aligncolor:#ffffdc;width: left800px;"|| '''31'''|| '''32'''| '''PWM1'''| '''PI11'''| '''267'''
|-
| '''268'''| <big>'''PI12Note that the following git clone--recursive command will automatically download the source code of wiringOP, because wiringOP-Python depends on wiringOP. Please make sure there are no errors during the download process due to network problems.'''| '''PWM2'''| '''33'''|| '''34If there is a problem downloading the code from GitHub, you can directly use the wiringOP-Python source code that comes with the Linux image. The storage location is: /usr/src/wiringOP-Python'''</big>| '''GND'''}{| styleclass="text-align: left;wikitable"|| style="text-alignwidth: left800px;"|
|-
| root@orangepi:~# '''258git clone --recursive https://github.com/orangepi-xunlong/wiringOP-Python -b next'''| root@orangepi:~# '''PI2cd wiringOP-Python'''| style="textroot@orangepi:~/wiringOP-align: left;"|| Python# '''35git submodule update --init --remote'''|}| '''36'''</ol>| <ol start="3" style="textlist-style-aligntype: leftdecimal;"|>| '''PC12'''<li><p>Then use the following command to compile wiringOP-Python and install it into the Linux system of the development board</p>{| '''76'''class="wikitable" style="width:800px;"
|-
| <p>root@orangepi:~# '''272cd wiringOP-Python'''</p>| <p>root@orangepi:~/wiringOP-Python# '''PI16python3 generate-bindings.py > bindings.i'''</p>| style="text<p>root@orangepi:~/wiringOP-align: left;"|| Python# '''37sudo python3 setup.py install'''</p>|}| </li><li><p>Then enter the following command. If helpful information is output, it means wiringOP-Python is successfully installed. Press the '''38q'''key to exit the help information interface.</p></li>{| class="wikitable" style="text-alignwidth: left800px;"|| '''PI4'''| '''260'''
|-
| style="text-alignroot@orangepi: left;"|| style="text~/wiringOP-align: left;"|| Python# '''GND'''| '''39'''|| '''40'''| style="textpython3 -align: leftc "import wiringpi; help(wiringpi)""|| '''PI3'''| '''259'''|}
: # the SWIG interface file instead.
|}
</ol>
<ol start="5" style="list-style-type: decimal;">
<li><p>The steps to test whether wiringOP-Python is installed successfully under the python command line are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The second parameter 10 represents First use the python3 command to enter the counting time command line mode of the watchdog. If the dog is not fed within this time, the system will restart.</p>> python3</li><li><p>We can feed the dog by pressing any key on the keyboard (except ESC). After feeding the dog, the program will print a line "{| class="wikitable" style="width:800px;keep alive" to indicate that the dog feeding is successful.</p>" |-| <p>orangepiroot@orangepi:~$ # '''sudo watchdog_test 10python3'''</p><p>open success|}</pol><p>options is 33152,identity is sunxiol start="2" style="list-style-type: lower-wdt</palpha;"><pli>put_usr return,if 0,success:0Then import the python module of wiringpi</pli><p>The old reset time is{| class="wikitable" style="width: 16800px;" |-| >>> '''import wiringpi;'''|}</pol><p>return ENOTTY,if ol start="3" style="list-style-1,successtype:0</plower-alpha;"><pli>return ENOTTYFinally,if enter the following command to view the help information of > wiringOP-1,success:0Python. Press the q key to exit the help information > interface.</pli><p>put_user return,if 0,success{| class="wikitable" style="width:0</p>800px;" |-| >>> '''help(wiringpi)''' <p>put_usr return,if 0,successHelp on module wiringpi:0</p><p>keep alive</p><p>keep alive</p><p>keep alive</p></li></ol>NAME
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Hello from Docker!Like wiringOP, wiringOP-Python can also determine which GPIO pin to operate by specifying the wPi number. Because there is no command to view the wPi number in wiringOP-Python, you can only view the board's wPi number and physics through the gpio command in wiringOP Correspondence of pins.'''</big>
<ol style="list-style-type: decimal;">
<li><p>First, please install docker and ensure that docker can run normallyThe following uses pin No. For 7 - corresponding to GPIO PI13 - corresponding to wPi serial number 2 - as an example to demonstrate how to set the installation steps high and low levels of docker, please refer to the instructions in the GPIO port.</p><p>[[\l|'''How to Install Docker'''File:zero2w-img171.png]] section.</p></li><li><p>Then you can search The steps for the docker image of Home Assistanttesting directly with commands are as follows:</p><p>orangepi@orangepiol style="list-style-type:~$ '''docker search homeassistant'''</p></lilower-alpha;"><li><p>Then use First set the following command GPIO port to download output mode, where the first parameter of the '''pinMode''' function is the Docker image serial number of Home Assistant the wPi corresponding to your local computer. The image size is about 1GBthe pin, and the download time will be relatively long. Please be patient and wait for second parameter is the download to completeGPIO mode.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepiroot@orangepi:~$ /wiringOP-Python# '''docker pull homeassistant/homepython3 -assistantc "import wiringpi; \'''</p><p>Using default tag: latest</p><p>latest: Pulling from homeassistant/home-assistant</p><p>be307f383ecc: Downloading</p><p>5fbc4c07ac88: Download complete</p><p>'''from wiringpi import GPIO; wiringpi...... wiringPiSetup(Omit some output); \'''</p><p>3cc6a1510c9f'''wiringpi.pinMode(<span style="color: Pull complete</p#FF0000"><p>7a4e4d5b979f: Pull complete2, GPIO.OUTPUT</pspan><p>Digest: sha256:81d381f5008c082a37da97d8b08dd8b358dae7ecf49e62ce3ef1eeaefc4381bb) ; "'''</p><p>Status: Downloaded newer image for homeassistant/home-assistant:latest</p>|}<p>docker.io/homeassistant/home-assistant:latest</p></li><li><p>Then set the GPIO port to output a low level. After setting, you can use the following command a multimeter to view measure the docker image voltage value of Home Assistant you just downloadedthe pin. If it is 0v, it means the low level is set successfully.</p><p>orangepi@orangepi{| class="wikitable" style="width:~$ '''docker images homeassistant/home-assistant'''</p>800px;" <p>REPOSITORY TAG IMAGE ID CREATED SIZE</p><p>homeassistant/home|-assistant latest bfa0ab9e1cf5 2 months ago '''1.17GB'''</p></li><li><p>At this point you can run the Home Assistant docker container</p>| <p>orangepiroot@orangepi:~$ /wiringOP-Python# '''docker run python3 -d c "import wiringpi; \'''</p><p>'''--name homeassistant from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\'''</p><p>'''--privileged \'''</p>wiringpi.digitalWrite(2, <p>'''--restartspan style=unless-stopped \'''</p"color:#FF0000">GPIO.LOW<p>'''-e TZ=Asia/Shanghai \'''</p><pspan>'''-v /home/orangepi/home-assistant:/config \)"'''</p><p>'''--network=host \'''</p>|}<p>'''homeassistant/home-assistant:latest'''</p></li><li><p>Then enter【the IP address of set the development board: 8123】in the browser GPIO port to see the Home Assistant interface</p><p>'''It takes output a while for the Home Assistant container to starthigh level. If the interface below does not display normallyAfter setting, please wait you can use a few seconds before refreshing itmultimeter to measure the voltage value of the pin. If the following interface it is not displayed normally after waiting for more than a minute3.3v, it means there is a problem with the Home Assistant installation. At this time, you need to check whether there setting of the high level is a problem with the previous installation and setting processsuccessful.'''</p><div {| class="figurewikitable" style="width:800px;"> [[File:zero2w|-img180.png]]| </divp><root@orangepi:~/li><li><p>Then enter your wiringOP-Python# '''name, username''' and '''password''' and click '''Create Accountpython3 -c "import wiringpi; \'''</p><div class="figure"p> [[File:zero2w-img181'''from wiringpi import GPIO; wiringpi.png]] wiringPiSetup() ;\'''</div></lip><li><p>Then follow the interface prompts to set according to your own preferences'''wiringpi.digitalWrite(2, and then click Next</p><div classspan style="figurecolor:#FF0000"> [[File:zero2w-img182GPIO.png]] HIGH</divspan></li><li><p>Then click Next)"'''</p><div class="figure"> [[File:zero2w-img183.png]]|}</div></li><li><p>Then click Finish</p><div class="figure"ol> [[File:zero2w-img184.png]] </div></li><li><p>The main interface finally displayed by Home Assistant is steps for testing in the command line of python3 are as shown below</p><p>[[Filefollows:zero2w-img185.png]]</p></li><li><p>Method to stop Home Assistant container</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The First use the python3 command to view enter the docker container is as followscommand line mode of python3</p>{| class="wikitable" style="width:800px;" |-| <p>orangepiroot@orangepi:~$ # '''python3'docker ps ''</p>|}</li><li><p>Then import the python module of wiringpi</p>{| class="wikitable" style="width:800px;" |-a| <p>>>> '''import wiringpi'''</p><p>>>> '''from wiringpi import GPIO'''</p>|}</li><li><p>The command Then set the GPIO port to output mode, where the first parameter of the '''pinMode'''function is the serial number of the wPi corresponding to stop the Home Assistant container pin, and the second parameter is as followsthe GPIO mode.</p>{| class="wikitable" style="width:800px;" |-| <p>>>> '''wiringpi.wiringPiSetup()'''</p><p>0</p><p>>>> '''wiringpi.pinMode(<span style="color:#FF0000">2, GPIO.OUTPUT</span>)'''</p>|}</li><li><p>orangepi@orangepiThen set the GPIO port to output a low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 0v, it means the low level is set successfully.</p>{| class="wikitable" style="width:~$ 800px;" |-| <p>>>> '''docker stop homeassistantwiringpi.digitalWrite(2, <span style="color:#FF0000">GPIO.LOW</span>)'''</p>|}</li><li><p>The command Then set the GPIO port to output a high level. After setting, you can use a multimeter to delete measure the voltage value of the Home Assistant container pin. If it is as follows3.3v, it means the setting of the high level is successful.</p>{| class="wikitable" style="width:800px;" |-| <p>>>> '''wiringpi.digitalWrite(2, <span style="color:#FF0000">GPIO.HIGH</span>)'''</p>|}</li></ol></li><li><p>For wiringOP-Python to set the GPIO high and low levels in the python code, you can refer to the '''blink.py''' test program in the examples. The '''blink.py''' test program will set the voltage of all GPIO ports in the 40 Pin of the development board to continuously change high and low.</p>{| class="wikitable" style="width:800px;" |-| <p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p><p>root@orangepi:~$ /wiringOP-Python/examples# '''docker rm homeassistantls blink.py'''</p><p>'''blink.py'''</lip><p>root@orangepi:~/wiringOP-Python/examples'''# python3 blink.py'''</olp>|}
</li></ol>
<span id="installationpin-viaspi-pythontest-1"></span> === Installation via python 40pin SPI test ===
<ol div style="list-style-typedisplay: decimalflex;"><li><p>First install dependency packages</p><p>orangepi@orangepi:~$ '''sudo apt-get update'''</p><p>orangepi@orangepi:~$ {| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"|-| '''sudo apt-get install -y python3 python3-dev python3-venv \GPIO NO.'''</p><p>| ''''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \GPIO'''</p><p>| '''libopenjp2-7 libtiff5 libturbojpeg0-dev tzdataFunction'''</p><p>| '''If it is debian12, please use the following command:Pin'''</p><p>orangepi@orangepi|-| style="text-align: left;"|| style="text-align:~$ left;"|| '''sudo apt-get update3.3V'''</p><p>orangepi@orangepi:~$ | '''sudo apt-get install -y python3 python3-dev python3-venv \1'''</p><p>|-| '''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \264'''</p><p>| '''libopenjp2-7 libturbojpeg0-dev tzdataPI8'''</p></li><li><p>Then you need to compile and install Python3.9. For the method, please refer to the [[\l|'''Python source code compilation and installation methodTWI1-SDA''']] section.</p><p>| '''The default Python version of Debian Bullseye is Python3.9, so there is no need to compile and install it.3'''</p><p>|-| '''The default Python version of Ubuntu Jammy is Python3.10, so there is no need to compile and install it.263'''</p><p>| '''The default Python version of Debian Bookworm is Python3.11, so there is no need to compile and install it.PI7'''</p></li><li><p>Then create a Python virtual environment</p><p>| '''Debian Bookworm is python3.11, please remember to replace the corresponding command.TWI1-SCL'''</p><p>orangepi@orangepi:~$ | '''sudo mkdir /srv/homeassistant5'''</p><p>orangepi@orangepi:~$ |-| '''sudo chown orangepi:orangepi /srv/homeassistant269'''</p><p>orangepi@orangepi:~$ | '''cd /srv/homeassistantPI13'''</p><p>orangepi@orangepi:~$ | '''python3.9 -m venv .PWM3/UART4_TX'''</p><p>orangepi@orangepi:~$ | '''source bin/activate7'''</p><p>(homeassistant) orangepi@orangepi|-| style="text-align:/srv/homeassistant$</p></li>left;"|<li><p>Then install the required Python packages</p><p>(homeassistant) orangepi@orangepi| style="text-align:/srv/homeassistant$ left;"|| '''python3 -m pip install wheelGND'''</p></li><li><p>Then you can install Home Assistant Core</p>| '''9'''|-<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ | '''pip3 install homeassistant226'''</p></li><li><p>Then enter the following command to run Home Assistant Core</p>| '''PH2'''<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ | '''hassUART5_TX'''</p></li><li><p>Then enter【| '''development board IP address: 812311'''】 in the browser to see the Home Assistant interface</p><p>|-| '''227'When you run the hass command for the first time, some libraries and dependency packages necessary for operation will be downloaded, installed and cached. This process may take several minutes. Note that you cannot see the Home Assistant interface in the browser at this time. Please wait for a while and then refresh it.''| '''PH3'''</p><div class="figure">| '''UART5_RX''' [[File:zero2w| '''13'''|-img180.png]]| '''261'''<| '''PI5'''| '''TWI0_SCL/div></li></ol>UART2_TX'''| '''15'''<span id|-| style="opencvtext-installation-methodalign: left;"></span>== OpenCV installation method == <span id|| style="usetext-apt-to-install-opencvalign: left;"></span>|=== Use apt to install OpenCV ===| '''3.3V'''| '''17'''|-| '''<ol span style="list-style-typecolor: decimal;#FF0000">231<li/span><p>The installation command is as follows</p><p>orangepi@orangepi:~$ '''sudo apt-get update| '''</pspan style="color:#FF0000">PH7<p/span>orangepi@orangepi:~$ '''sudo apt-get install -y libopencv-dev python3-opencv| '''</pspan style="color:#FF0000">SPI1_MOSI</lispan>'''| '''<lispan style="color:#FF0000"><p>Then use the following command to print the version number of OpenCV. The output is normal, indicating that the OpenCV installation is successful.19</pspan>'''|-| '''<ol span style="list-style-typecolor: lower-alpha;#FF0000"><li><p>The version of OpenCV in Ubuntu22.04 is as follows:232</pspan>'''<p>orangepi@orangepi:~$ '''python3 -c "import cv2; print(cv2.__version__)"| '''<span style="color:#FF0000">PH8</p><pspan>'''4.5.4| '''</p>span style="color:#FF0000">SPI1_MISO</lispan>'''| '''<li><pspan style="color:#FF0000">The version of OpenCV in Ubuntu20.04 is as follows:21</pspan><p>orangepi@orangepi:~$ '''python3 |-c "import cv2; print(cv2.__version__)"| '''</pspan style="color:#FF0000">230<p/span>'''4.2.0| '''</pspan style="color:#FF0000">PH6</lispan>'''| '''<lispan style="color:#FF0000"><p>The version of OpenCV in Debian11 is as follows:SPI1_CLK</p><pspan>orangepi@orangepi:~$ '''python3 -c "import cv2; print(cv2.__version__)"| '''</pspan style="color:#FF0000">23<p/span>'''4.5.1'''</p></li><li><p>The version of OpenCV in Debian12 is as follows|-| style="text-align:</p>left;"|<p>orangepi@orangepi| style="text-align:~$ left;"|| '''python3 -c "import cv2; print(cv2.__version__)"GND'''</p><p>| '''4.6.025'''</p></li></ol></li></ol> <span id="set-up-the-chinese-environment-and-install-the-chinese-input-method"></span>== Set up the Chinese environment and install the Chinese input method ==|-| '''266'''Note, before installing the Chinese input method, please make sure that the Linux system used by the development board is a desktop version.| '''PI10''' <span id="debian-system-installation| '''TWI2-method"><SDA/span>UART3_RX'''=== Debian system installation method ===| '''27''' <ol style="list-style|-type: decimal;"><li><p>First set the default | '''locale256''' to Chinese</p><ol style| '''PI0'''| style="list-styletext-typealign: lower-alphaleft;">|<li><p>Enter the following command to start configuring | '''locale29'''</p><p>orangepi@orangepi:~$ |-| '''sudo dpkg-reconfigure locales271'''</p></li><li><p>Then select | '''zh_CN.UTF-8 UTF-8PI15''' in the pop| style="text-up interface (use >align: left; the up and down keys on the keyboard to move up and down, use > the space bar to select, and finally use the Tab key to move > the cursor to "|| '''<OK>31''', and then return Car can be used)</p><p>[[File:zero2w|-img186.png]]</p></li><li><p>Then set the default | '''locale268''' to | '''zh_CN.UTF-8PI12'''</p><p>[[File:zero2w-img187.png]]</p></li><li><p>After exiting the interface, the '| '''localePWM2''' setting will begin. > The output displayed on the command line is as follows:</p><p>orangepi@orangepi:~$ | '''sudo dpkg-reconfigure locales33'''</p><p>Generating locales (this might take a while)...</p><p>en_US.UTF|-8... done</p><p>zh_CN.UTF-8... done</p>| '''258'''<p>Generation complete.</p></li></ol></li><li><p>Then open | '''Input MethodPI2'''</p><p>[[File| style="text-align:zero2w-img188.png]]</p></li>left;"|<li><p>Then select | '''OK35'''</p><p>[[File:zero2w|-img189.png]]</p></li><li><p>Then select | '''272'''| '''YesPI16'''</p><p>[[File| style="text-align:zero2w-img190.png]]</p></li>left;"|<li><p>Then select | '''fcitx37'''</p><p>[[File:zero2w|-img191.png]]</p></li><li><p>Then select | style="text-align: left;"|| style="text-align: left;"|| '''OKGND'''</p><p>[[File:zero2w-img192.png]]</p></li><li><p>| '''39'Then restart the Linux system to make the configuration take effect.'''</p></li><li><p>Then open |}{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"|-| '''Fcitx configurationPin'''</p><p>[[File:zero2w-img193.png]]</p></li>| '''Function'''<li><p>Then click the + sign as shown in the picture below</p>| '''GPIO'''<p>[[File:zero2w| '''GPIO NO.'''|-img194.png]]</p></li><li><p>Then search | '''Google Pinyin2''' and click | '''OK5V'''</p><div class| style="figure">text-align: left;"|| style="text-align: left;"|[[File:zero2w|-img195.png]]| '''4'''</div></li><li><p>Then put '| '''Google Pinyin5V''' on top</p><p>[[File| style="text-align:zero2w-img196.png]]</p>left;"|<p>[[File| style="text-align:zero2wleft;"||-img197.png]]</p></li><li><p>Then open the | '''Geany6''' editor to test the Chinese input method</p><p>[[File| '''GND'''| style="text-align:zero2wleft;"|| style="text-img198.png]]</p></li><li><p>The Chinese input method test is as follows</p>align: left;"|<p>[[File:zero2w|-img199.png]]</p></li><li><p>You can switch between Chinese and English input methods through the | '''Ctrl+Space8''' shortcut key</p></li><li><p>If you need the entire system to be displayed in Chinese, you can set all variables in | '''/etc/default/localeUART0_TX''' to | '''zh_CN.UTF-8PH0'''</p><p>orangepi@orangepi:~$ | '''sudo vim /etc/default/locale224'''</p><p># File generated by update|-locale</p><p>LC_MESSAGES=| '''zh_CN.UTF-810'''</p><p>LANG=| '''zh_CN.UTF-8UART0_RX'''</p><p>LANGUAGE=| '''zh_CN.UTF-8PH1'''</p></li><li><p>Then | '''restart the system225''' and you will see that the system is displayed in Chinese.</p><p>[[File:zero2w|-img200.png]]</p></li></ol> <span id| '''12'''| style="installationtext-method-of-ubuntu-20.04-systemalign: left;"></span>|=== Installation method of Ubuntu 20.04 system === <ol style="list-style-type: decimal;"><li><p>First open | '''Language SupportPI1'''</p><p>[[File:zero2w| '''257'''|-img201.png]]</p></li><li><p>Then find the | '''Chinese (China)14''' option</p><p>[[File:zero2w-img202.png]]</p></li><li><p>Then please use the left button of the mouse to select '| '''GND''Chinese (China)''' and hold it down, then drag it up to the starting position. After dragging, the display will be as shown below:</p><p>[[File| style="text-align:zero2w-img203.png]]</p></li></ol>left;"|| style="text-align: left;"||-| '''Note that this step is not easy to drag, please be patient and try it a few times.16'''| '''PWM4/UART4_RX'''<ol start="4" style="list-style-type: decimal;"><li><p>Then select | '''Apply System-WidePI14''' to apply the Chinese settings to the entire system</p><p>[[File:zero2w-img204.png]]</p></li><li><p>Then set the | '''Keyboard input method system270''' system to |-| '''fcitx18'''</p><p>[[File:zero2w| style="text-img205.png]]</p></li>align: left;"|<li><p>| '''Then restart the Linux system to make the configuration take effectPH4'''</p></li><li><p>After re-entering the system, please select | '''Do not ask me again228''' in the following interface, and then please decide according to your own preferences whether the standard folder should also be updated to Chinese</p><p>[[File:zero2w|-img206.png]]</p></li><li><p>Then you can see that the desktop is displayed in Chinese</p>| '''20'''<p>[[File:zero2w-img207.png]]</p></li><li><p>Then we can open | '''GeanyGND''' to test the Chinese input method. The opening method is as shown in the figure below</p><p>[[File| style="text-align:zero2w-img208.png]]</p></li>left;"|| style="text-align: left;"||-<li><p>After opening | '''Geany22''', the English input method is still the default. We can switch to the Chinese input method through the | '''Ctrl+SpaceTWI0_SDA/UART2_RX'''| '''PI6'''| '''262''' shortcut key, and then we can input Chinese.</p><p>[[File:zero2w|-img209.png]]| '''</pspan style="color:#FF0000">24</li></olspan>''' | '''<span idstyle="installation-method-of-ubuntu-22.04-systemcolor:#FF0000">SPI1_CS0</span>'''=== Installation method of Ubuntu 22.04 system === | '''<ol span style="list-style-typecolor: decimal;#FF0000">PH5<li><p/span>First open '''Language Support| '''</p><p>[[Filespan style="color:zero2w-img201.png]]</p#FF0000">229</lispan><li><p>Then find the '''Chinese (China)|-| ''' option</p><p>[[Filespan style="color:zero2w-img210.png]]</p#FF0000">26</lispan>'''| '''<lispan style="color:#FF0000">SPI1_CS1<p/span>Then please use the left button of the mouse to select '''Chinese (China)| ''' and hold it down, then drag it up to the starting position. After dragging, the display will be as shown below:</p><p>[[Filespan style="color:zero2w-img211.png]]</p#FF0000">PH9</lispan></ol> '''Note that this step is not easy to drag, please be patient and try it a few times.| ''' <ol startspan style="4" style="list-style-type: decimal;color:#FF0000">233<li><p/span>Then select '''Apply System|-Wide| '''28''' to apply the Chinese settings to the entire system</p><p>[[File:zero2w| '''TWI2-img212.png]]<SCL/p></li>UART3_TX'''<li><p>| '''Then restart the Linux system to make the configuration take effectPI9'''</p></li><li><p>After re-entering the system, please select | '''Do not ask me again265''' in the following interface, and then please decide whether the standard folder should also be updated to Chinese according to your own preferences.</p><p>[[File:zero2w|-img206.png]]</p></li><li><p>Then you can see that the desktop is displayed in Chinese</p>| '''30'''<p>[[File:zero2w| '''GND'''| style="text-img207.png]]</p></li>align: left;"|<li><p>Then open the Fcitx5 configuration program</p><p>[[File| style="text-align:zero2wleft;"||-img213.png]]</p></li><li><p>Then choose to use Pinyin input method</p>| '''32'''<div class="figure">| '''PWM1'''| '''PI11'''| '''267'''[[File:zero2w|-img214.png]]| '''34'''</div></li>| '''GND'''<li><p>The interface after selection is as shown below, then click OK</p>| style="text-align: left;"|<p>[[File| style="text-align:zero2wleft;"||-img215.png]]</p></li><li><p>Then we can open '| '''Geany36''' to test the Chinese input method. The opening method is as shown in the figure below</p><p>[[File| style="text-align:zero2w-img208.png]]</p></li>left;"|<li><p>After opening | '''PC12'Geany''', the English input method is still the default. We can switch to the Chinese input method through the | '''Ctrl+Space76''' shortcut key, and then we can enter Chinese.</p><p>[[File:zero2w|-img216.png]]</p></li></ol>| '''38'''<span id| style="howtext-to-remotely-log-in-to-the-linux-system-desktopalign: left;"></span>== How to remotely log in to the Linux system desktop == <span id="remote-login-using-nomachine"></span>=== Remote login using NoMachine ===|| '''PI4'''| '''Please ensure that the Ubuntu or Debian system installed on the development board is a desktop version of the system. In addition, NoMachine also provides detailed usage documentation. It is strongly recommended to read this document thoroughly to become familiar with the use of NoMachine. The document link is as follows:260'''|-| '''https://knowledgebase.nomachine.com/DT10R0016640'''| style="text-align: left;"|| '''NoMachine supports Windows, Mac, Linux, iOS and Android platforms, so we can remotely log in and control the Orange Pi development board through NoMachine on a variety of devices. The following demonstrates how to remotely log in to the Linux system desktop of the Orange Pi development board through NoMachine in Windows. For installation methods on other platforms, please refer to NoMachine's official documentation.PI3''' | '''Before operating, please make sure that the Windwos computer and the development board are in the same LAN, and that you can log in to the Ubuntu or Debian system of the development board through ssh normally.259'''|}</div>
<ol start="2" style="list-style-type: decimal;"><li><p>First download the installation package of the NoMachine software In Linux '''arm64''' deb versionsystems, spi1 is turned off by default and then install needs to be turned on manually before it into the Linux system of the development boardcan be used. The opening steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li>Since H618 is an ARMv8 architecture SOC and the system we use is > Ubuntu or Debian, we need to download the '''NoMachine for ARM > ARMv8 DEB''' installation package. The download link is as > follows:</lip></ol></li></ol> First run '''Note that this download link may change, please look for the Armv8/Arm64 version of the deb package.orangepi-config''' [https://www.nomachine.com/download/download&id=112&s=ARM Ordinary users remember to add '''https://downloads.nomachine.com/download/?id=118&distro=ARMsudo'''] [[File:zero2w-img217permissions.png]]</p><ol start{| class="2wikitable" style="list-style-typewidth: lower-alpha800px;"><li>|-| <p>In addition, you can also download the orangepi@orangepi:~$ '''NoMachinesudo orangepi-config''' installation > package from the official tool.</p>|}<p/li>[[File:zero2w-img218.png]]</pli><p>First enter the Then select '''remote login software-NoMachineSystem''' folder</p><p>[[File:zero2w-img219img80.png]]</p></li><li><p>Then download the arm64 version of the deb installation packageselect '''Hardware'''</p><p>[[File:zero2w-img220img81.png]]</p></li><li><p>Then upload use the downloaded '''nomachine_x.x.x_x_arm64.deb''keyboard' s arrow keys to locate the > Linux system of position shown in the development board</p></li><li><p>Then figure below, and then use the following command to install '''NoMachinespace''' in to select the Linux > system dtbo configuration of the development board</p><p>orangepi@orangepi:~$ '''sudo dpkg -i nomachine_xSPI you want to open.x.x_x_arm64_arm64.deb'''</p></li></ol>
{| class="wikitable" style="width:800px;text-align: center;"
|-
| '''dtbo configuration'''
| '''illustrate'''
|-
| '''spi1-cs0-cs1-spidev'''
| '''Open cs0 and cs1 of spi1 at the same time'''
|-
| '''spi1-cs0-spidev'''
| '''Only open cs0 of spi1'''
|-
| '''spi1-cs1-spidev'''
| '''Only open cs1 of spi1'''
|}
</ol>
<ol start="5" style="list-style-type: lower-alpha;">
<li><p>Then select '''<Save>''' to save</p>
<p>[[File:zero2w-img83.png]]</p></li>
<li><p>Then select '''<Back>'''</p>
<p>[[File:zero2w-img84.png]]</p></li>
<li><p>Then select '''<Reboot>''' to restart the system to make the configuration take effect.</p>
<p>[[File:zero2w-img85.png]]</p></li></ol>
</li></ol>
<!-- -->
<ol start="23" style="list-style-type: decimal;"><li><p>Then download check whether there is a '''spidev1.x''' device node in the installation package Linux system. If it exists, it means that the SPI1 configuration has taken effect.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''ls /dev/spidev1*'''</p><p>/dev/spidev1.0 /dev/spidev1.1</p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that only when you open spi1-cs0-cs1-spidev, you will see the device nodes of the Windows version two spi.'''</p></big>|}</li><li><p>Then you can use the '''spidev_test.py''' program in examples to test the SPI loopback function. The '''spidev_test.py''' program needs to specify the following two parameters:</p><ol style="list-style-type: lower-alpha;"><li><p>'''--channel''': Specify the channel number of SPI</p></li><li><p>'''--port''': Specify the port number of the SPI</p></li></ol></li><li><p>Without shorting the mosi and miso pins of SPI1, the NoMachine softwareoutput result of running spidev_test. The download address py is as follows. You can see that the data of TX and RX are inconsistent.</lip>{| class="wikitable" style="width:800px;" |-| <p>root@orangepi:~/wiringOP-Python# '''cd examples'''</olp>
root@orangepi:~/wiringOP-Python/examples# '''Note that this download link may changepython3 spidev_test.py \'''
'''https://downloads.nomachine.com/download/?id=9--channel 1 --port 0'''
TX | FF FF FF FF FF FF '''Before operating, please make sure that the Windwos computer and the development board are in the same LAN, and that you can log in to the Ubuntu or Debian system of the development board through ssh normally.<span style="color:#FF0000">40 00 00 00 00 95</span>'''FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|
RX | FF FF FF FF FF FF '''There are many problems with VNC testing in Ubuntu20.04, please do not use this method.<span style="color:#FF0000">FF FF FF FF FF FF</span>'''FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |.............….||}</li></ol><ol start="6" style="list-style-type: decimal;"><li><p>First Then use Dupont wire to short-circuit the txd (pin 19 in the 40pin interface) and rxd (pin 21 in the 40pin interface) of SPI1 and then run spidev_test.py. The output is as follows, you can see If the data sent and received are the same, it means that the '''set_vncSPI1 loopback test is normal.sh''' script to set up vnc, '''remember to add sudo permission'''s</p>{| class="wikitable" style="width:800px;" |-| <p>orangepiroot@orangepi:~$ /wiringOP-Python# '''sudo set_vnc.shcd examples'''</p><p>You will require a password to access your desktops.</p><p>Passwordroot@orangepi: '''#Set the vnc password here, 8 characters'''</p><p>Verify: '''#Set the vnc password here, 8 characters'''<~/p><p>Would you like to enter a viewwiringOP-only password (yPython/n)? examples# '''npython3 spidev_test.py \'''</p><p>xauth: file /root/.Xauthority does not exist</p><p>New 'X' desktop is orangepi:'--channel 1</p><p>Creating default startup script /root/.vnc/xstartup</p><p>Starting applications specified in /root/.vnc/xstartup</p><p>Log file is /root/.vnc/orangepi:1.log</p><p>Killing Xtightvnc process ID 3047</p><p>New --port 0''X' desktop is orangepi:1</p><p>Starting applications specified in /root/.vnc/xstartup</p><p>Log file is /root/.vnc/orangepispi mode:1.log</p></li>0x0<li><p>The steps to use MobaXterm software to connect to the development board Linux system desktop are as follows:</p><ol style="list-style-typemax speed: lower-alpha;"><li>First click Session, then select VNC, then fill in the IP > address and port of the development board, and finally click > OK to confirm.</li></ol></li></ol>500000 Hz (500 KHz)
RX | FF FF FF FF FF FF '''</div><ol start="2" span style="list-style-typecolor: lower-alpha;#FF0000"><li><p>Then enter the VNC password set earlier40 00 00 00 00 95</pspan>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…||}<p>[[File:zero2w-img228.png]]</pli></liol><li><p>After successful login, the interface is displayed as shown below, > and then you can remotely operate the desktop of the development > board Linux system.</pspan id="pin-i2c-test-1"></li></olspan>
<ol div style="listdisplay: flex;">::{| class="wikitable" style="width:390px;margin-styleright: 20px;text-typealign: decimalcenter;"><li><p>Use the following script to install QT5 and QT Creator</p>|-<p>orangepi@orangepi:~$ | '''install_qtGPIO NO.sh'''</p></li><li><p>After installation, the QT version number will be automatically printed.</p>| '''GPIO'''<ol style| '''Function'''| '''Pin'''|-| style="listtext-align: left;"|| style="text-typealign: lower-alphaleft;">|<li><p>The qt version that comes with Ubuntu20.04 is | ''''5.123.83V'''</p><p>orangepi@orangepi:~$ | '''install_qt.sh1'''</p>|-| '''<pspan style="color:#FF0000">......264</pspan>'''<p>QMake version 3.1</p><p>Using Qt version | '''5.12.8''' in /usr/lib/aarch64-linux-gnu</pspan style="color:#FF0000">PI8</lispan>'''<li| '''<span style="color:#FF0000">TWI1-SDA<p/span>The QT version that comes with Ubuntu22.04 is '''5.15.3| '''</p>span style="color:#FF0000">3<p/span>orangepi@orangepi:~$ '''install_qt.sh|-| '''</pspan style="color:#FF0000">263<p>......</p/span>'''| '''<pspan style="color:#FF0000">QMake version 3.1v</pspan>'''<p>Using Qt version | '''5.15.3''' in /usr/lib/aarch64-linux-gnu</pspan style="color:#FF0000">TWI1-SCL</lispan>'''| '''<lispan style="color:#FF0000">5<p/span>The QT version that comes with Debian11 is '''5.15.2|-| '''</p><p>orangepi@orangepi:~$ 269'''install_qt.sh| '''PI13'''</p><p>......<| '''PWM3/p>UART4_TX'''<p>QMake version 3.1</p><p>Using Qt version | '''7''5.15.2''' in /usr/lib/aarch64|-linux| style="text-gnu</p></li>align: left;"|| style="text-align: left;"|<li><p>The QT version that comes with Debian12 is | '''5.15.8GND'''</p><p>orangepi@orangepi:~$ | '''9'''|-| '''install_qt.sh226'''</p><p>......</p>| '''PH2'''<p>QMake version 3.1</p><p>Using Qt version | '''UART5_TX'5.15.8''| ' in /usr/lib/aarch64-linux''11'''|-gnu</p></li></ol></li><li><p>Then you can see the QT Creator startup icon in | '''Applications227'''| '''PH3'''</p><p>[[File:zero2w-img230.png]]</p><p>You can also use the following command to open QT Creator</p><p>orangepi@orangepi:~$ | '''qtcreatorUART5_RX'''| '''13'''|-| '''</pspan style="color:#FF0000">261</lispan>'''| '''<li><pspan style="color:#FF0000">The interface after QT Creator is opened is as followsPI5</pspan>'''| '''<pspan style="color:#FF0000">[[File:zero2w-img231.png]]TWI0_SCL</pspan></li>UART2_TX'''| '''<lispan style="color:#FF0000"><p>The version of QT Creator is as follows15</pspan>'''|-<ol | style="listtext-align: left;"|| style="text-typealign: lower-alphaleft;">|<li><p>The default version of QT Creator in | '''Ubuntu203.043V''' is as > follows</p><p>[[File:zero2w-img232.png]]</p></li>| '''17'''|-<li><p>The default version of QT Creator in | '''Ubuntu22.04231''' is as > follows</p><p>[[File:zero2w-img233.png]]</p></li>| '''PH7'''| '''SPI1_MOSI'''<li><p>The default version of QT Creator in | '''Debian1119''' is as follows</p><p>[[File:zero2w|-img234.png]]</p></li><li><p>The default version of QT Creator in | '''232'''| '''Debian12PH8''' is as follows</p><p>[[File:zero2w| '''SPI1_MISO'''| '''21'''|-img235.png]]</p></li></ol></li><li><p>Then set up QT</p>| '''230'''<ol style="list-style-type: lower-alpha;"><li><p>First open | '''HelpPH6'''->| '''About Plugins...SPI1_CLK'''.</p><p>[[File:zero2w-img236.png]]</p></li><li><p>Then remove the check mark of | '''ClangCodeModel23'''</p><p>[[File|-| style="text-align:zero2wleft;"|| style="text-img237.png]]</p></li>align: left;"|<li><p>| '''After setting up, you need to restart QT CreatorGND'''</p></li><li><p>Then make sure the GCC compiler used by QT Creator. If the > default is Clang, please change it to GCC.</p><p>| '''Debian12 please skip this step.25'''</p>|-| '''<pspan style="color:#FF0000">[[File:zero2w-img238.png]]266</pspan>'''| '''<p>[[File:zero2w-img239.png]]span style="color:#FF0000">PI10</pspan>'''| '''</lispan style="color:#FF0000">TWI2-SDA</olspan></li>UART3_RX'''| '''<li><pspan style="color:#FF0000">Then you can open a sample code27</pspan>'''<p>[[File:zero2w|-img240.png]]</p></li><li><p>After clicking on the sample code, the corresponding instruction document will automatically open. You can read the instructions carefully.</p>| '''256'''| '''PI0'''<p>[[File| style="text-align:zero2w-img241.png]]</p></li>left;"|<li><p>Then click | '''Configure Project29'''</p><p>[[File:zero2w|-img242.png]]</p></li><li><p>Then click the green triangle in the lower left corner to compile and run the sample code</p>| '''271'''| '''PI15'''<p>[[File| style="text-align:zero2wleft;"|| '''31'''|-img243.png]]</p></li><li><p>After waiting for a period of time, the interface shown in the figure below will pop up, which means that QT can compile and run normally.</p>| '''268'''| '''PI12'''<p>[[File:zero2w-img244.png]]</p></li><li><p>References</p><p>[https://wiki.qt.io/Install_Qt_5_on_Ubuntu | '''PWM2'https://wiki.qt.io/Install_Qt_5_on_Ubuntu''| ']</p>''33'''|-<p>[https://download.qt.io/archive/qtcreator | '''https://download.qt.io/archive/qtcreator258''']</p><p>[https://download.qt.io/archive/qt | '''https://download.qt.io/archive/qtPI2''']</p></li></ol>| style="text-align: left;"|| '''35'''<span id="ros|-installation-method"></span>== ROS installation method ==| '''272'''| '''PI16'''<span id| style="howtext-to-install-ros-1-noetic-on-ubuntu20.04"></span>align: left;"|=== How to install ROS 1 Noetic on Ubuntu20.04 === # The currently active version of ROS 1 is as follows, the recommended version is | '''Noetic Ninjemys37''' [[File:zero2w|-img245.png]]| style="text-align: left;"|[[File| style="text-align:zero2w-img246.png]]left;"| [http://docs.ros.org/ | '''GND''http://docs.ros.org'''] | '''https://wiki.ros.org/Distributions39'''|}<ol start{| class="2wikitable" style="listwidth:390px;margin-styleright: 20px;text-typealign: decimalcenter;"><li><p>The link to the official installation documentation of ROS 1 |-| '''Noetic NinjemysPin''' is as follows:</p><p>[http://wiki.ros.org/noetic/Installation/Ubuntu | '''Function''http://wiki.ros.org/noetic/Installation/Ubuntu'| '''GPIO''']</p></li><li><p>In the official installation documentation of ROS | '''Noetic NinjemysGPIO NO.''', Ubuntu recommends using Ubuntu20.04, so please ensure that the system used by the development board is |-| '''Ubuntu20.04 desktop system2'''.</p><p>[http://wiki.ros.org/noetic/Installation | '''5V''http://wiki.ros.org/noetic/Installation''']</p><p>[[File| style="text-align:zero2w-img247.png]]</p></li>left;"|<li><p>Then use the script below to install ros1</p>| style="text-align: left;"|<p>orangepi@orangepi:~$ |-| '''install_ros.sh ros14'''</p></li><li><p>Before using the ROS tool, you first need to initialize rosdep. Then when compiling the source code, you can quickly install some system dependencies and some core components in ROS.</p></li></ol> | '''Note that when running the following command, you need to ensure that the development board can access github normally, otherwise an error will be reported due to network problems.5V'''| style="text-align: left;"|| style="text-align: left;"||-| '''The install_ros.sh script will try to modify /etc/hosts and automatically run the following commands. 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 Order.6''' | '''https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yamlGND'''| style="text-align: left;"|'''Hit https| style="text-align://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yamlleft;"||-| '''8''' | '''ERROR: error loading sources list:UART0_TX''' | '''The read operation timed outPH0''' orangepi@orangepi:~$ | ''''source /opt/ros/noetic/setup.bash224'''|-orangepi@orangepi:~$ | '''sudo rosdep init10''' Wrote /etc/ros/rosdep/sources.list.d/20-default.list Recommended: please run rosdep update orangepi@orangepi:~$ | '''rosdep updateUART0_RX'''| '''PH1'''reading in sources list data from /etc/ros/rosdep/sources.list.d| '''225'''|-Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx| '''12'''| style="text-homebrew.yamlalign: left;"|| '''PI1'''Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml| '''257'''|-Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml| '''14'''| '''GND'''Hit https| style="text-align://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yamlleft;"|| style="text-align: left;"||-Hit https://raw.githubusercontent.com| '''16'''| '''PWM4/ros/rosdistro/master/releases/fuerte.yamlUART4_RX'''| '''PI14'''Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index| '''270'''|-v4.yaml| '''18'''Skip end| style="text-of-life distro "ardent"align: left;"|| '''PH4'''Skip end-of-life distro "bouncy"| '''228'''|-Skip end-of-life distro "crystal"| '''20'''| '''GND'''Skip end| style="text-of-life distro "dashing"align: left;"| Skip end| style="text-of-life distro "eloquent"align: left;"| Add distro "foxy" Add distro "galactic" Skip end-of|-life distro "groovy"| '''<span style="color:#FF0000">22</span>'''Add distro "humble" Skip end-of-life distro "hydro"| '''<span style="color:#FF0000">TWI0_SDA</span>/UART2_RX'''| '''<span style="color:#FF0000">PI6</span>'''Skip end-of-life distro "indigo" Skip end-of-life distro "jade"| '''<span style="color:#FF0000">262</span>''' Skip end|-of-life distro "kinetic"| '''24'''Skip end-of-life distro "lunar"| '''SPI1_CS0'''| '''PH5'''| '''229'''|-| '''26'''| '''SPI1_CS1'''| '''PH9'''| '''233'''|-| '''<span style="color:#FF0000">28</span>'''| '''<span style="color:#FF0000">TWI2-SCL</span>/UART3_TX'''| '''<span style="color:#FF0000">PI9</span>'''| '''<span style="color:#FF0000">265</span>'''|-| '''30'''| '''GND'''| style="text-align: left;"|| style="text-align: left;"||-| '''32'''| '''PWM1'''| '''PI11'''| '''267'''|-| '''34'''| '''GND'''| style="text-align: left;"|| style="text-align: left;"||-| '''36'''| style="text-align: left;"|| '''PC12'''| '''76'''|-| '''38'''| style="text-align: left;"|| '''PI4'''| '''260'''|-| '''40'''| style="text-align: left;"|| '''PI3'''| '''259'''|}</div>
[[File:zero2w-img173.png]]</ol><ol start="65" style="list-style-type: decimallower-alpha;"><li><p>Then open a command line terminal window on the '''desktop''', and then use the '''test_ros.sh''' script select <span class="mark"><Save></span> to start a small turtle routine to test whether ROS can be used normallysave</p><p>[[File:zero2w-img83.png]]</p></li><li><p>Then select <span class="mark"><Back></span></p><p>orangepi@orangepi[[File:~$ '''test_roszero2w-img84.sh'''png]]</p></li><li><p>After running Then select <span class="mark"><Reboot></span> to restart the '''test_ros.sh''' script, a small turtle as shown in system to make the picture below will pop upconfiguration take effect.</p><p>[[File:zero2w-img248img85.png]]</p></li></ol></li></ol><!-- --><ol start="3" style="list-style-type: decimal;"><li><p>Then please keep After starting the Linux system, first confirm that there is an open i2c device node under <span class="mark">/dev</span></p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p><p>'''/dev/i2c-*'''</p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''注意,这里说的Linux镜像具体指的是从Orange Pi资料下载页面下载的Debian或者Ubuntu这样的Linux发行版镜像。'''</big>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Sometimes the i2c device node and the i2c bus serial number do not correspond one to one. For example, the terminal window you just opened at i2c device node of the topi2c1 bus may be /dev/i2c-3.'''</p><p>'''The method to accurately confirm the device node under /dev corresponding to the i2c bus is: '''</lip></olbig>
<span id="howpin-touart-installtest-kernel-header-files1"></span>== How to install kernel header files ==
<span iddiv style="testing-of-some-programming-languages-supported-by-linux-systemdisplay: flex;"></span>::{| class== Testing of some programming languages supported by Linux system == <span id"wikitable" style="debianwidth:390px;margin-bullseyeright: 20px;text-system"></span>=== Debian Bullseye system === <ol style="list-style-typealign: decimalcenter;"><li><p>Debian Bullseye is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system of the development board.</p>|-<ol style="list-style-type: lower-alpha;"><li><p>The version of a| '''GPIO NO.gcc is as follows</p><p>orangepi@orangepi:~$ '''gcc --version| '''GPIO'''| '''Function'''| '''Pin'''</p><p>gcc (Debian 10.2.1|-6) 10.2.1 20210110</p><p>Copyright (C) 2020 Free Software Foundation, Inc| style="text-align: left;"|| style="text-align: left;"|| '''3.</p><p>This is free software; see the source for copying conditions. There is NO</p>3V'''<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li><li><p>Write the | '''hello_world.c1''' program in C language</p><p>orangepi@orangepi:~$ |-| '''vim hello_world.c264'''</p><p>#include <stdio.h></p>| '''PI8'''<p>int main(void)</p>| '''TWI1-SDA'''<p>{</p>| '''3'''<p>printf("Hello World!\n");</p>|-<p>return 0;</p>| '''263'''<p>}</p></li><li><p>Then compile and run | '''hello_world.cPI7'''</p><p>orangepi@orangepi:~$ | '''gcc TWI1-o hello_world hello_world.cSCL'''| '''5'''|-| '''269'''| '''PI13'''</p><p>orangepi@orangepi:~$ | '''.PWM3/hello_worldUART4_TX'''</p><p>Hello World!</p></li></ol>| '''7'''</li>|-<li><p>Debian Bullseye has Python3 installed by default</p><ol | style="listtext-align: left;"|| style="text-typealign: lower-alphaleft;"><li><p>The specific version of Python is as follows</p>|<p>orangepi@orangepi:~$ | '''python3GND'''</p><p>| '''Python 3.9.2''' (default, Feb 28 2021, 17:03:44)</p><p>[GCC 10.2.1 20210110] on linux</p>|-| '''226'''<p>Type "help", "copyright", "credits" or "license" for more information.</p>| '''PH2'''<p>>>></p>| '''UART5_TX'''<p>| '''Use the Ctrl+D shortcut key to exit python11's interactive mode.''|-| '''227'''</p></li><li><p>Write the | '''hello_world.pyPH3''' program in Python language</p><p>orangepi@orangepi:~$ | '''vim hello_world.pyUART5_RX'''</p><p>print(| ''Hello World!')</p></li>13'''|-<li><p>The result of running | '''hello_world.py261''' is as follows</p><p>orangepi@orangepi:~$ | '''PI5'''python3 hello_world.py| '''<TWI0_SCL/p>UART2_TX'''<p>Hello World!</p></li></ol>| '''15'''</li>|-<li><p>Debian Bullseye does not install Java compilation tools and operating environment by default.</p><ol | style="listtext-align: left;"|| style="text-typealign: lower-alphaleft;">|<li><p>You can use the following command to install openjdk| '''3. The latest > version in Debian Bullseye is openjdk-17</p>3V'''<p>orangepi@orangepi:~$ | '''sudo apt install -y openjdk-17-jdk'''</p></li><li><p>After installation, you can check the Java version.</p>|-<p>orangepi@orangepi:~$ | '''java --version231'''</p></li><li><p>Write the Java version of | '''hello_world.javaPH7'''</p><p>orangepi@orangepi:~$ | '''vim hello_world.javaSPI1_MOSI'''</p><p>public class hello_world</p>| '''19'''<p>{</p>|-<p>public static void main(String[] args)</p>| '''232'''<p>{</p>| '''PH8'''<p>System.out.println("Hello World!");</p><p>}</p>| '''SPI1_MISO'''<p>}</p></li><li><p>Then compile and run | '''hello_world.java21'''|-| '''230'''</p><p>orangepi@orangepi:~$ | '''javac hello_world.javaPH6'''</p><p>orangepi@orangepi:~$ | '''java hello_worldSPI1_CLK'''</p><p>Hello World!</p></li></ol>| '''23'''</li></ol>|- <span id| style="debiantext-bookworm-systemalign: left;"></span>|| style=== Debian Bookworm system === <ol style="list-style-type"text-align: decimalleft;">|<li><p>Debian Bookworm is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system of the development board.</p>| '''GND'''<ol style="list-style-type: lower| '''25'''|-alpha;"><li><p>The version of a.gcc is as follows</p><p>orangepi@orangepi:~$ | '''gcc --version266'''</p><p>gcc (Debian 12.2.0| '''PI10'''| '''TWI2-14) 12.2.0<SDA/p>UART3_RX'''<p>Copyright (C) 2022 Free Software Foundation, Inc.</p>| '''27'''<p>This is free software; see the source for copying conditions. There is NO</p>|-<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li><li><p>Write the | '''hello_world.c256''' program in C language</p><p>orangepi@orangepi:~$ | '''vim hello_world.cPI0'''</p><p>#include <| style="text-align: left;stdio.h></p>"|<p>int main(void)</p>| '''29'''<p>{</p>|-<p>printf("Hello World!\n");</p>| '''271'''<p>return 0| '''PI15'''| style="text-align: left;</p>"|<p>}</p></li><li><p>Then compile and run | '''hello_world.c31'''</p><p>orangepi@orangepi:~$ |-| '''268'''| '''gcc -o hello_world hello_world.cPI12'''</p><p>orangepi@orangepi:~$ | '''./hello_worldPWM2'''</p><p>Hello World!</p></li></ol>| '''33'''</li>|-<li><p>Debian Bookworm has Python3 installed by default</p>| '''258'''<ol | '''PI2'''| style="list-styletext-typealign: lower-alphaleft;">|| '''35'''<li><p>The specific version of Python is as follows</p>|-<p>orangepi@orangepi:~$ | '''python3272'''</p><p>Python 3.11.2 (main, Mar 13 2023, 12| '''PI16'''| style="text-align:18:29) [GCC 12.2.0] on linux</p>left;"|<p>Type "help", "copyright", "credits" or "license" for more information.</p><p>>>></p><p>| '''Use the Ctrl+D shortcut key to exit python37's interactive mode.'''</p></li><li><p>Write the |-| style="text-align: left;"|| style="text-align: left;"|| '''hello_world.pyGND''' program in Python language</p><p>orangepi@orangepi:~$ | '''39'vim hello_world.py'''</p><p>print(|}{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"|-| '''Pin''Hello World!')</p></li><li><p>The result of running | '''hello_world.pyFunction''' is as follows</p><p>orangepi@orangepi:~$ | '''python3 hello_world.pyGPIO'''</p><p>Hello World!</p></li></ol>| '''GPIO NO.'''</li>|-<li><p>Debian Bookworm does not install Java compilation tools and operating environment by default.</p>| '''2'''| '''5V'''<ol | style="listtext-align: left;"|| style="text-typealign: lower-alphaleft;">|<li><p>You can use the following command to install openjdk. The latest > version in Debian Bookworm is openjdk|-17</p><p>orangepi@orangepi:~$ | '''sudo apt install -y openjdk-17-jdk4'''</p></li><li><p>After installation, you can check the Java version.</p><p>orangepi@orangepi:~$ | '''java --version5V'''</p></li><li><p>Write the Java version of | style="text-align: left;"|| style="text-align: left;"||-| '''hello_world.java6'''</p><p>orangepi@orangepi:~$ | '''vim hello_world.javaGND'''</p><p>public class hello_world</p>| style="text-align: left;"|| style="text-align: left;"|<p>{</p>|-<p>public static void main(String[] args)</p>| '''8'''<p>{</p>| '''UART0_TX'''<p>System.out.println("Hello World!");</p><p>}</p>| '''PH0'''<p>}</p></li><li><p>Then compile and run | '''hello_world.java224'''|-| '''10'''</p><p>orangepi@orangepi:~$ | '''javac hello_world.javaUART0_RX'''</p><p>orangepi@orangepi:~$ | '''java hello_worldPH1'''</p><p>Hello World!</p></li></ol>| '''225'''</li></ol>|-| '''12'''<span id| style="ubuntutext-focal-systemalign: left;"></span>|| '''PI1'''=== Ubuntu Focal system ===| '''257'''|-<ol style="list-| '''14'''| '''GND'''| style="text-typealign: decimalleft;">|<li><p>Ubuntu Focal is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system of the development board.</p><ol | style="list-styletext-typealign: lower-alphaleft;">|<li><p>The version of a.gcc is as follows</p>|-<p>orangepi@orangepi:~$ | '''16'''gcc --version| '''<PWM4/p>UART4_RX'''<p>gcc (Ubuntu 9.4.0| '''PI14'''| '''270'''|-1ubuntu1~20.04.1) 9.4.0</p><p>Copyright (C) 2019 Free Software Foundation, Inc.</p>| '''18'''<p>This is free software| style="text-align: left; see the source for copying conditions. There is NO</p>"|<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li><li><p>Write the | '''hello_world.cPH4''' program in C language</p><p>orangepi@orangepi:~$ | '''vim hello_world.c228'''</p><p>#include <stdio.h></p>|-<p>int main(void)</p>| '''20'''<p>{</p>| '''GND'''<p>printf("| style="text-align: left;Hello World!\n");</p>"|<p>return 0| style="text-align: left;</p>"|<p>}</p></li>|-<li><p>Then compile and run | '''hello_world.c22'''</p><p>orangepi@orangepi:~$ | '''gcc -o hello_world hello_world.cTWI0_SDA/UART2_RX'''| '''PI6'''</p><p>orangepi@orangepi:~$ | '''./hello_world262'''</p><p>Hello World!</p></li></ol>|-</li>| '''24'''<li><p>Ubuntu Focal has Python3 installed by default</p>| '''SPI1_CS0'''<ol style="list-style-type: lower| '''PH5'''| '''229'''|-alpha;"><li><p>The specific version of Python3 is as follows</p><p>orangepi@orangepi:~$ | '''python326'''</p><p>Python 3.8.10 (default, Nov 14 2022, 12:59:47)</p>| '''SPI1_CS1'''| '''PH9'''<p>[GCC 9.4.0] on linux</p><p>Type "help", "copyright", "credits" or "license" for more information.</p><p>>>></p><p>| '''Use the Ctrl+D shortcut key to exit python233's interactive mode.'''</p></li><li><p>Write the |-| '''hello_world.py28''' program in Python language</p><p>orangepi@orangepi:~$ | '''vim hello_world.pyTWI2-SCL/UART3_TX'''</p><p>print(| '''PI9''Hello World!')</p></li><li><p>The result of running | '''hello_world.py265''' is as follows</p><p>orangepi@orangepi:~$ |-| '''python3 hello_world.py30'''</p><p>Hello World!</p></li></ol></li>| '''GND'''<li><p>Ubuntu Focal does not have Java compilation tools and running environment installed by default.</p><ol | style="list-styletext-typealign: lower-alphaleft;">|<li><p>You can use the following command to install openjdk| style="text-align: left;"||-17</p><p>orangepi@orangepi:~$ | '''sudo apt install -y openjdk-17-jdk32'''</p></li><li><p>After installation, you can check the Java version.</p>| '''PWM1'''| '''PI11'''<p>orangepi@orangepi:~$ | '''java --version267'''</p><p>openjdk 17.0.2 2022|-01-18</p><p>OpenJDK Runtime Environment (build 17.0.2+8| '''34'''| '''GND'''| style="text-Ubuntu-120.04)</p>align: left;"|<p>OpenJDK 64| style="text-Bit Server VM (build 17.0.2+8-Ubuntualign: left;"||-120.04, mixed mode, sharing)</p></li><li><p>Write the Java version of | '''36'''| style="text-align: left;"|| '''hello_world.javaPC12'''</p><p>orangepi@orangepi:~$ | '''vim hello_world.java76'''</p><p>public class hello_world</p>|-| '''38'''<p>{</p>| style="text-align: left;"|<p>public static void main(String[] args)</p>| '''PI4'''<p>{</p>| '''260'''<p>System.out.println("Hello World!");</p>|-<p>}</p><p>}</p></li><li><p>Then compile and run ''| '''hello_world.java40'''</p><p>orangepi@orangepi| style="text-align:~$ '''javac hello_world.java'''</p><p>orangepi@orangepi:~$ '''java hello_world'''</p><p>Hello World!</p></li></ol></li></ol> <span id=left;"ubuntu-jammy-system"></span>=== Ubuntu Jammy system === <ol style="list-style-type: decimal;"><li><p>Ubuntu Jammy is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system of the development board.</p><ol style="list-style-type: lower-alpha;"><li><p>The version of a.gcc is as follows</p><p>orangepi@orangepi:~$ '''gcc --version'''</p><p>gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) '''11.3.0'''</p><p>Copyright (C) 2021 Free Software Foundation, Inc.</p><p>This is free software; see the source for copying conditions. There is NO</p><p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li><li><p>Write the '''hello_world.c''' program in C language</p><p>orangepi@orangepi:~$ '''vim hello_world.c'''</p><p>#include <stdio.h></p><p>int main(void)</p><p>{</p><p>printf("Hello World!\n");</p><p>return 0;</p><p>}</p></li><li><p>Then compile and run '''hello_world.c'''</p><p>orangepi@orangepi:~$ '''gcc -o hello_world hello_world.c'''</p><p>orangepi@orangepi:~$ '''./hello_world'''</p><p>Hello World!</p></li></ol></li><li><p>Ubuntu Jammy has Python3 installed by default</p><ol style="list-style-type: lower-alpha;"><li><p>The specific version of Python3 is as follows</p><p>orangepi@orangepi:~$ '''python3'''</p><p>Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux</p><p>Type "help", "copyright", "credits" or "license" for more information.</p><p>>>></p><p>'''Use the Ctrl+D shortcut key to exit python's interactive mode.'''</p></li><li><p>Write the '''hello_world.py''' program in Python language</p><p>orangepi@orangepi:~$ '''vim hello_world.py'''</p><p>print('Hello World!')</p></li><li><p>The result of running '''hello_world.py''' is as follows</p><p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p><p>Hello World!</p></li></ol></li><li><p>Ubuntu Jammy does not install Java compilation tools and operating environment by default.</p><ol style="list-style-type: lower-alpha;"><li><p>You can use the following command to install openjdk-18</p><p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-18-jdk'''</p></li><li><p>After installation, you can check the Java version.</p><p>orangepi@orangepi:~$ '''java --version'''</p><p>openjdk 18.0.2-ea 2022-07-19</p><p>OpenJDK Runtime Environment (build 18.0.2-ea+9-Ubuntu-222.04)</p><p>OpenJDK 64-Bit Server VM (build 18.0.2-ea+9-Ubuntu-222.04, mixed mode, sharing)</p></li><li><p>Write the Java version of '''hello_world.java'''</p><p>orangepi@orangepi:~$ '''vim hello_world.java'''</p><p>public class hello_world</p><p>{</p><p>public static void main(String[] args)</p><p>{</p><p>System.out.println("Hello World!");</p><p>}</p><p>}</p></li><li><p>Then compile and run '''hello_world.java'''</p>|<p>orangepi@orangepi:~$ | '''javac hello_world.javaPI3'''</p><p>orangepi@orangepi:~$ | '''java hello_world259'''</p><p>Hello World!</p></li></ol>|}</li></oldiv>
<span id="method-of-uploading-files-to-the-development-board-linux-system"></span>== Method of uploading files to the development board Linux system == <span idol start="method-to-upload-files-to-the-development-board-linux-system-in-ubuntu-pc2"></span>=== Method to upload files to the development board Linux system in Ubuntu PC === <span id="how-to-upload-files-using-scp-command"></span>==== How to upload files using scp command ==== <ol style="list-style-type: decimal;"><li><p>Use the scp command In Linux systems, uart is turned off by default and needs to upload files to the Linux system of the development board in Ubuntu PCbe turned on manually before it can be used. The specific command is opening steps are as follows:: </p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''file_path: orangepi-config'''Needs to be replaced with the path of the file . Ordinary users remember to > be uploaded</p></li><li><p>add '''orangepi: sudo'''This is the user name of the development board's > Linux system. It can also be replaced with something else, > such as rootpermissions.</p></li><li><p>'''192.168.xx.xx{| class="wikitable" style="width:''' This is the IP address of the development >800px; board. Please modify it according to the actual situation.</p></li>" |-| <li><p>'''/home/orangepi:''' The path in the development board Linux > system can also be modified to other paths.</p><p>test@testorangepi:~$ '''scp file_path sudo orangepi@192.168.xx.xx:/home/orangepi/-config'''</p></li></ol>|}
</li>
<li><p>If you want to upload a folder, you need to add the -r parameterThen select '''System'''</p><p>test@test[[File:~$ '''scp zero2w-r dir_path orangepi@192img80.168.xx.xx:png]]</home/orangepip></li><li><p>Then select '''Hardware'''</p><p>[[File:zero2w-img81.png]]</p></li><li><p>There are more usages of scpThen use the keyboard's arrow keys to locate the position shown in the picture below, please and then use the following command '''space''' to view select the man manualserial port you want to open.</p></li></ol>
[[File:zero2w-img255img175.png]]</ol><ol start="5" style="list-style-type: lower-alpha;"><li><p>Then select '''<Save>''' to save</p><p>[[File:zero2w-img83.png]]</p></li><li><p>Then select '''<Back>'''</p><p>[[File:zero2w-img84.png]]</p></li><li><p>Then select '''<Reboot>''' to restart the system to make the configuration take effect.</p><p>[[File:zero2w-img85.png]]</p></li></ol></li></ol><!-- --><ol start="3" style="list-style-type: decimal;"><li><p>After entering the Linux system, first confirm whether there is a uart5 device node under '''<span class="mark">/dev</span>'''</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''注意, linux5.4系统为/dev/ttyASx.'''</p></big>|}{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''ls /dev/ttyS*'''</p><p>/dev/ttySx</p>|}</li><li><p>Then start testing the uart interface. First use Dupont wire to short-circuit the rx and tx pins of the uart interface to be tested.</p></li><li><p>Use the '''gpio''' command in wiringOP to test the loopback function of the serial port as shown below. If you can see the following print, it means the serial port communication is normal.</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that the last x in the gpio serial /dev/ttySx command needs to be replaced with the serial number of the corresponding uart device node.'''</p></big>|}{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''gpio serial /dev/ttySx # linux-6.1 test command'''</p><p>orangepi@orangepi:~$ '''gpio serial /dev/ttyASx # linux-5.4 test command'''</p>
<div class="figure"p>Out: 0: -> 0</p><p>Out: 1: -> 1</p><p>Out: 2: -> 2</p>[[File<p>Out: 3:zero2w-img256.png]]> 3^C</p>|}</divli><ol startli><p>Finally, you can run the '''serialTest.py''' program in examples to test the loopback function of the serial port. If you can see the following print, it means that the serial port loopback test is normal.</p>{| class="5wikitable" style="listbackground-style-typecolor:#ffffdc;width: decimal800px;">|-| <libig><p>Then choose to '''save Note that the x in /dev/ttySx or /dev/ttyASx in the passwordcommand needs to be replaced with the serial number of the corresponding uart device node.''' and click </p></big>|}{| class="wikitable" style="width:800px;" |-| <p>root@orangepi:~/wiringOP-Python# '''OKcd examples'''</p><p>[[Fileroot@orangepi:zero2w~/wiringOP-Python/examples# '''python3 serialTest.py --img257device "/dev/ttySx" # linux6.png]]1 use'''</p></li><li><p>Then select root@orangepi:~/wiringOP-Python/examples# '''Always trust this host''' and click '''OKpython3 serialTest.py --device "/dev/ttyASx" # linux5.4 use'''</p></li></ol>
</div><ol startspan id="7" style="listhardware-stylewatchdog-type: decimal;test"><li>After the connection is successful, you can see the directory structure of the development board's Linux file system on the right side of the filezilla software.</li></olspan>
<div ol style="list-style-type: lower-alpha;"><li><p>The second parameter 10 represents the counting time of the watchdog. If the dog is not fed within this time, the system will restart.</p></li><li><p>We can feed the dog by pressing any key on the keyboard (except ESC). After feeding the dog, the program will print a line "keep alive" to indicate that the dog feeding is successful.</p>{| class="figurewikitable" style="width:800px;"|-| <p>orangepi@orangepi:~$ '''sudo watchdog_test 10'''</p><p>open success</p><p>options is 33152,identity is sunxi-wdt</p><p>put_usr return,if 0,success:0</p><p>The old reset time is: 16</p><p>return ENOTTY,if -1,success:0</p><p>return ENOTTY,if -1,success:0</p><p>put_user return,if 0,success:0</p><p>put_usr return,if 0,success:0</p><p>keep alive</p><p>keep alive</p><p>keep alive</p>|}</li></ol>
<div classspan id="figurehow-to-compile-and-install-python-source-code"></span>=== How to compile and install Python source code ===
<div classspan id="figurehow-to-replace-pip-source-in-python"></span>
<div ol style="list-style-type: decimal;"><li><p>First install '''python3-pip'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo apt-get update'''</p><p>orangepi@orangepi:~$ '''sudo apt-get install -y python3-pip'''</p>|}</li><li><p>How to permanently change the pip source under Linux</p><ol style="list-style-type: lower-alpha;"><li><p>First create a new '''~/.pip''' directory, then add the '''pip.conf''' configuration file, and set the pip source in it to Tsinghua source.</p>{| class="figurewikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''mkdir -p ~/.pip'''</p><p>orangepi@orangepi:~$ '''cat <<EOF > ~/.pip/pip.conf'''</p><p>'''[global]'''</p><p>'''timeout = 6000'''</p><p>'''index-url = https://pypi.tuna.tsinghua.edu.cn/simple'''</p><p>'''trusted-host = pypi.tuna.tsinghua.edu.cn'''</p><p>'''EOF'''</p>|}</li><li><p>Then use pip3 to install the Python library very quickly</p></li></ol></li><li><p>How to temporarily change the pip source under Linux, where '''<packagename>''' needs to be replaced with a specific package name</p>{| class="wikitable" style="width:800px;"|-| <p>orangepi@orangepi:~$ '''pip3 install <packagename> -i \'''</p><p>'''https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn'''</p>|}</li></ol>
'''</div><ol start="8" span style="list-style-typecolor: decimal;#FF0000"><li>Then select the path This message shows that your installation appears to be uploaded to the development board on the right side of the filezilla software, select the file to be uploaded on the Windows PC on the left side of the filezilla software, right-click the mouse, and then click the upload option to start uploading the file to the development boardworking correctly.</li></olspan>'''
<ol stylespan id="listhow-styleto-type: decimal;"><li><p>The power on/off logo will only be displayed on the desktop version of the system by default.</p></li><li><p>Set the '''bootlogo''' variable to '''false''' in '''/boot/orangepiEnv.txt''' to turn off the switch logo.</p><p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p><p>verbosity=1</p><p>'''bootlogo=false'''</p></li><li><p>Set the '''bootlogo''' variable to '''true''' in '''/boot/orangepiEnv.txt''' to enable the power on/off logo.</p><p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p><p>verbosity=1</p><p>'''bootlogo=true'''</p></li><li><p>The location of the boot logo picture in the Linux system is</p><p>'''/usr/share/plymouth/themes/orangepi/watermark.png'''</p></li><li><p>After replacing the boot logo image, you need to run the following command to take effect</p><p>orangepi@orangepi:~$ '''sudo updateinstall-initramfs home-u'''</p></liassistant"></olspan>
<ol style="list-style-type: decimal;">
<li><p>First , please install docker and ensure that docker can run '''orangepi-config'''normally. Ordinary users remember For the installation steps of docker, please refer to add the instructions in the [[Orange Pi Zero 2W#How to install Docker|'''sudoHow to Install Docker''' permissions]] section.</p></li><li><p>Then you can search for the docker image of Home Assistant</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo orangepi-configdocker search homeassistant'''</p>|}</li><li><p>Then select use the following command to download the Docker image of Home Assistant to your local computer. The image size is about 1GB, and the download time will be relatively long. Please be patient and wait for the download to complete.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''Systemdocker pull homeassistant/home-assistant'''</p><p>[[FileUsing default tag: latest</p><p>latest:zero2wPulling from homeassistant/home-img80.png]]assistant</p><p>be307f383ecc: Downloading</lip><lip>5fbc4c07ac88: Download complete</p><p>Then select '''Hardware...... (Omit some output)'''</p><p>[[File3cc6a1510c9f: Pull complete</p><p>7a4e4d5b979f: Pull complete</p><p>Digest: sha256:81d381f5008c082a37da97d8b08dd8b358dae7ecf49e62ce3ef1eeaefc4381bb</p><p>Status:zero2wDownloaded newer image for homeassistant/home-img81assistant:latest</p><p>docker.png]]io/homeassistant/home-assistant:latest</p>|}</li><li><p>Then you can use the keyboard's arrow keys following command to locate the position shown in the picture below, and then use view the docker image of Home Assistant you just downloaded</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''spacedocker images homeassistant/home-assistant''' to select the dtbo configuration of the SPI you want to open.</p><p>[[FileREPOSITORY TAG IMAGE ID CREATED SIZE</p><p>homeassistant/home-assistant latest bfa0ab9e1cf5 2 months ago '''<span style="color:zero2w-img270#FF0000">1.png]]17GB</span>'''</p>|}</li><li><p>Then select At this point you can run the Home Assistant docker container</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''<Save>docker run -d \''' to save</p>:<p>[[File'''--name homeassistant \'''</p>:zero2w<p>'''-img83.png]]-privileged \'''</p>:<p>'''--restart=unless-stopped \'''</lip>:<p>'''-e TZ=Asia/Shanghai \'''<li/p>:<p>Then select '''<Back>-v /home/orangepi/home-assistant:/config \'''</p>:<p>'''--network=host \'''</p>[[File:zero2w<p>'''homeassistant/home-img84.png]]assistant:latest'''</p>|}</li><li><p>Then select '''<Reboot>''' to restart enter【the IP address of the development board: 8123】in the system browser to make see the configuration take effect.Home Assistant interface</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>[[File:zero2w-img85'''It takes a while for the Home Assistant container to start. If the interface below does not display normally, please wait a few seconds before refreshing it. If the following interface is not displayed normally after waiting for more than a minute, it means there is a problem with the Home Assistant installation. At this time, you need to check whether there is a problem with the previous installation and setting process.png]]'''</p></libig>|}</oldiv class="figure">
</div></li><li><p>Then follow the interface prompts to set according to your own preferences, and then click Next</p><div class= '''Linux SDK——orangepi-build usage instructions''' ="figure">
</div></li>
<li><p>The main interface finally displayed by Home Assistant is as shown below</p>
<p>[[File:zero2w-img185.png]]</p></li>
<li><p>Method to stop Home Assistant container</p>
<ol style="list-style-type: lower-alpha;">
<li>For <p>The command to view the docker container is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''docker ps -a'''</p>|}</li><li><p>The command to stop the method of replacing Tsinghua Source, please refer Home Assistant container is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''docker stop homeassistant'''</p>|}</li><li><p>The command to delete the instructions on this page.Home Assistant container is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''docker rm homeassistant'''</p>|}</li></ol></li></ol>
<ol start="3" style="list-style-type: lower-alphadecimal;"><li>The contents of the '''/etc/apt/sources.list''' file that need to be replaced are:</lip>First install dependency packages</olp> test@test:~$ '''sudo mv /etc/apt/sources.list cat /etc/apt/sources.list.bak''' test@test:~$ '''sudo vim /etc/apt/sources.list''' # The source code image is commented by default to improve apt update speed. You can uncomment it yourself if necessary. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse # Pre-release software source, not recommended to be enabled # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse <ol start{| class="4" style="list-style-type: lower-alpha;"><li>After the replacement, you need to update the package information and ensure that no errors are reported.</li></ol> test@test:~$ '''sudo apt-get update''' <ol start="5wikitable" style="list-style-typewidth: lower-alpha800px;"><li>'''In addition, since the source code of the kernel and Uboot are stored on GitHub, it is very important to ensure that the computer can download the code from GitHub normally when compiling the image.'''</li></ol> <span id="obtain-the-source-code-of-linux-sdk"></span>== Obtain the source code of linux sdk == <span id="download-orangepi-build-from-github"></span>=== Download orangepi-build from github === Linux sdk refers to the orangepi-build set of codes. Orangepi-build is modified based on the armbian build compilation system. Multiple versions of Linux images can be compiled using orangepi-build. Use the following command to download the orangepi-build code: test@test:~$ '''sudo apt-get update''' test@test:~$ '''sudo apt-get install -y git''' test@test:~$ '''git clone https://github.com/orangepi-xunlong/orangepi-build.git -b next''' '''Note that when using the H618 Soc development board, you need to download the source code of the next branch of orangepi-build. The above git clone command needs to specify the branch of the orangepi-build source code as next.''' <div class="figure"> [[File:zero2w-img272.png]] </div>'''When downloading the orangepi-build code through the git clone command, you do not need to enter the user name and password of the github account (the same is true for downloading other codes in this manual). If after entering the git clone command, Ubuntu PC prompts you to enter the user name of the github account. The name and password are usually entered incorrectly in the address of the orangepi-build warehouse behind git clone. Please carefully check whether there are any errors in the spelling of the command, rather than thinking that we have forgotten to provide the username and password of the github account.''' The u-boot and linux kernel versions currently used by the H618 series development boards are as follows: {| class="wikitable"
|-
| <p>orangepi@orangepi:~$ '''branchsudo apt-get update'''</p>| <p>orangepi@orangepi:~$ '''usudo apt-boot Versionget install -y python3 python3-dev python3-venv \'''</p>| <p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''linux Kernel version</p><p>'''libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata'''</p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
| <big><p>'''If it is debian12, please use the following command:'''</p></big><p>orangepi@orangepi:~$ '''currentsudo apt-get update'''</p><p>orangepi@orangepi:~$ '''sudo apt-get install -y python3 python3-dev python3-venv \'''</p><p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''</p><p>'''libopenjp2-7 libturbojpeg0-dev tzdata'''</p>|}</li><li><p>Then you need to compile and install Python3.9. For the method, please refer to the [[Orange Pi Zero 2W#Python related instructions| '''uPython source code compilation and installation method''']] section.</p>{| class="wikitable" style="background-boot v2018color:#ffffdc;width:800px;" |-| <big><p>'''The default Python version of Debian Bullseye is Python3.9, so there is no need to compile and install it.'''</p><p>'''The default Python version of Ubuntu Jammy is Python3.10, so there is no need to compile and install it.'''</p><p>'''The default Python version of Debian Bookworm is Python3.11, so there is no need to compile and install it.05'''</p></big>| }</li><li><p>Then create a Python virtual environment</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''linux5Debian Bookworm is python3.11, please remember to replace the corresponding command.4'''</p></big>|}{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo mkdir /srv/homeassistant'''</p><p>orangepi@orangepi:~$ '''sudo chown orangepi:orangepi /srv/homeassistant'''</p><p>orangepi@orangepi:~$ '''cd /srv/homeassistant'''</p><p>orangepi@orangepi:~$ '''python3.9 -m venv .'''</p><p>orangepi@orangepi:~$ '''source bin/activate'''</p><p>(homeassistant) orangepi@orangepi:/srv/homeassistant$</p>|}</li><li><p>Then install the required Python packages</p>{| class="wikitable" style="width:800px;" |-| <p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''python3 -m pip install wheel'''</p>|}</li><li><p>Then you can install Home Assistant Core</p>{| class="wikitable" style="width:800px;" |-| <p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''pip3 install homeassistant'''</p>|}</li><li><p>Then enter the following command to run Home Assistant Core</p>{| class="wikitable" style="width:800px;" |-| <p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''hass'''</p>|}</li><li><p>Then enter【'''development board IP address: 8123'''】 in the browser to see the Home Assistant interface</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
| '''next'''| <big><p>'''u-boot v2021When you run the hass command for the first time, some libraries and dependency packages necessary for operation will be downloaded, installed and cached. This process may take several minutes.07'''| '''linux6Note that you cannot see the Home Assistant interface in the browser at this time. Please wait for a while and then refresh it.1'''</p></big>
|}
<div class="figure">
<ol stylespan id="listuse-styleapt-type: lowerto-install-alpha;opencv"><li><p>'''build.sh''': Compile startup script</p></lispan><li><p>'''external''': Contains configuration files needed === Use apt to compile the image, specific scripts, and source code of some programs, etc.</p></li><li><p>'''LICENSE''': GPL 2 license file</p></li><li><p>'''README.md''': orangepi-build documentation</p></li><li><p>'''scripts''': Common script for compiling linux images</p></li></ol>install OpenCV ===
<div ol style="list-style-type: decimal;"><li><p>First set the default '''locale''' to Chinese</p><ol style="list-style-type: lower-alpha;"><li><p>Enter the following command to start configuring '''locale'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo dpkg-reconfigure locales'''</p>|}</li><li><p>Then select '''zh_CN.UTF-8 UTF-8''' in the pop-up interface (use the up and down keys on the keyboard to move up and down, use the space bar to select, and finally use the Tab key to move the cursor to '''<OK>''', and then return Car can be used)</p><p>[[File:zero2w-img186.png]]</p></li><li><p>Then set the default '''locale''' to '''zh_CN.UTF-8'''</p><p>[[File:zero2w-img187.png]]</p></li><li><p>After exiting the interface, the '''locale''' setting will begin. The output displayed on the command line is as follows:</p>{| class="figurewikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo dpkg-reconfigure locales'''</p><p>Generating locales (this might take a while)...</p>:<p>en_US.UTF-8... done</p>:<p>zh_CN.UTF-8... done</p><p>Generation complete.</p>|}</li></ol></li><li><p>Then open '''Input Method'''</p><p>[[File:zero2w-img188.png]]</p></li><li><p>Then select '''OK'''</p><p>[[File:zero2w-img189.png]]</p></li><li><p>Then select '''Yes'''</p><p>[[File:zero2w-img190.png]]</p></li><li><p>Then select '''fcitx'''</p><p>[[File:zero2w-img191.png]]</p></li><li><p>Then select '''OK'''</p><p>[[File:zero2w-img192.png]]</p></li><li><p>'''<span style="color:#FF0000">Then restart the Linux system to make the configuration take effect.</span>'''</p></li><li><p>Then open '''Fcitx configuration'''</p><p>[[File:zero2w-img193.png]]</p></li><li><p>Then click the + sign as shown in the picture below</p><p>[[File:zero2w-img273img194.png]]</p></li><li><p>Then search '''Google Pinyin''' and click '''OK'''</p><div class="figure">
</div></li><li><p>Then put '''Google Pinyin''' on top</p><p>[[File:zero2w-img196.png]]</p><p>[[httpsFile:zero2w-img197.png]]</p></li><li><p>Then open the '''Geany''' editor to test the Chinese input method</mirrorsp><p>[[File:zero2w-img198.tunapng]]</p></li><li><p>The Chinese input method test is as follows</p><p>[[File:zero2w-img199.tsinghuapng]]</p></li><li><p>You can switch between Chinese and English input methods through the '''Ctrl+Space''' shortcut key</p></li><li><p>If you need the entire system to be displayed in Chinese, you can set all variables in '''/etc/default/locale''' to '''zh_CN.edu.cnUTF-8'''</armbianp>{| class="wikitable" style="width:800px;" |-releases| <p>orangepi@orangepi:~$ '''sudo vim /etc/_toolchaindefault/ locale'''https</p><p># File generated by update-locale</p><p>LC_MESSAGES='''<span style="color:#FF0000">zh_CN.UTF-8</span>'''</mirrorsp><p>LANG='''<span style="color:#FF0000">zh_CN.tunaUTF-8</span>'''</p><p>LANGUAGE='''<span style="color:#FF0000">zh_CN.tsinghua.edu.cnUTF-8</armbian-releasesspan>'''</_toolchainp>|}</li><li><p>Then '''<span style="color:#FF0000">restart the system</span>''' and you will see that the system is displayed in Chinese.</p><p>[[File:zero2w-img200.png]]</p></li></ol>
<ol style="list-style-type: lowerdecimal;"><li><p>First open '''Language Support'''</p><p>[[File:zero2w-alphaimg201.png]]</p></li><li><p>Then find the '''Chinese (China)''' option</p><p>[[File:zero2w-img210.png]]</p></li><li><p>Then please use the left button of the mouse to select '''Chinese (China)''' and hold it down, then drag it up to the starting position. After dragging, the display will be as shown below:</p><p>[[File:zero2w-img211.png]]</p></li>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that this step is not easy to drag, please be patient and try it a few times.'''</big>|}</ol><ol start="4" style="list-style-type: decimal;"><li>linux5<p>Then select '''Apply System-Wide''' to apply the Chinese settings to the entire system</p><p>[[File:zero2w-img212.png]]</p></li><li><p>'''<span style="color:#FF0000">Then restart the Linux system to make the configuration take effect</span>'''</p></li><li><p>After re-entering the system, please select '''Do not ask me again''' in the following interface, and then please decide whether the standard folder should also be updated to Chinese according to your own preferences.</p><p>[[File:zero2w-img206.4png]]</p></li><li><p>Then you can see that the desktop is displayed in Chinese</p><p>[[File:zero2w-img207.png]]</p></li><li><p>Then open the Fcitx5 configuration program</p><p>[[File:zero2w-img213.png]]</p></li><li><p>Then choose to use Pinyin input method</olp><div class="figure">
<ol start="2" style="list/div></li><li><p>The interface after selection is as shown below, then click OK</p><p>[[File:zero2w-style-typeimg215.png]]</p></li><li><p>Then we can open '''Geany''' to test the Chinese input method. The opening method is as shown in the figure below</p><p>[[File: lowerzero2w-alpha;"img208.png]]</p></li><li>linux6<p>After opening '''Geany''', the English input method is still the default. We can switch to the Chinese input method through the '''Ctrl+Space''' shortcut key, and then we can enter Chinese.1</p><p>[[File:zero2w-img216.png]]</p></li></ol>
<ol stylespan id="listremote-stylelogin-type: lowerusing-alpha;nomachine"><li>v2018.05</li></olspan>=== Remote login using NoMachine ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''gcc-linaro-7Please ensure that the Ubuntu or Debian system installed on the development board is a <span style="color:#FF0000">desktop version</span> of the system.4In addition, NoMachine also provides detailed usage documentation.1-2019It is strongly recommended to read this document thoroughly to become familiar with the use of NoMachine.02-x86_64_arm-linux-gnueabiThe document link is as follows:'''
'''https://knowledgebase.nomachine.com/DT10R00166'''<ol start/big>|}{| class="2wikitable" style="listbackground-style-typecolor:#ffffdc;width: lower-alpha800px;">|-| <li>v2021.07</li></olbig> '''gcc-arm-11NoMachine supports Windows, Mac, Linux, iOS and Android platforms, so we can remotely log in and control the Orange Pi development board through NoMachine on a variety of devices. The following demonstrates how to remotely log in to the Linux system desktop of the Orange Pi development board through NoMachine in Windows.2-2022For installation methods on other platforms, please refer to NoMachine's official documentation.02-x86_64-aarch64-none-linux-gnu'''</big>|}<span id{| class="wikitable" style="orangepibackground-buildcolor:#ffffdc;width:800px;" |-complete-directory-structure-description"| <big>'''Before operating, please make sure that the Windwos computer and the development board are in the same LAN, and that you can log in to the Ubuntu or Debian system of the development board through ssh normally.'''</spanbig>=== orangepi-build complete directory structure description ===|}
<ol style="list-style-type: decimal;">
<li><p>After downloading, the orangepi-build warehouse does not contain First download the source code installation package of the linux kernelNoMachine software Linux '''<span style="color:#FF0000">arm64</span>''' deb version, u-boot and cross-compilation tool chain. The source code then install it into the Linux system of the linux kernel and u-boot is stored in an independent git warehouse.development board</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The git warehouse where Since H618 is an ARMv8 architecture SOC and the linux kernel source code system we use is stored Ubuntu or Debian, we need to download the '''NoMachine for ARM ARMv8 DEB''' installation package. The download link is as follows. Please note that the branch of the linux-orangepi warehouse is switched to:</pli><ol {| class="wikitable" style="listbackground-style-typecolor:#ffffdc;width: lower-alpha800px;">|-| <libig>Linux5'''Note that this download link may change, please look for the Armv8/Arm64 version of the deb package.4</li>'''</olbig></li></ol>|}{| class="wikitable" style="width:800px;" </li></ol>|-| [https://githubwww.nomachine.com/orangepi-xunlong/linux-orangepi/treedownload/download&id=112&s=ARM '''orange-pi-5https://downloads.nomachine.4-sun50iw9com/download/?id=118&distro=ARM''']|}
[[File:zero2w-img217.png]]
</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Linux6<p>In addition, you can also download the '''NoMachine''' installation package from the official tool.1</lip><p>[[File:zero2w-img218.png]]</olp><p>First enter the '''remote login software-NoMachine''' folder</p>https<p>[[File://githubzero2w-img219.compng]]</orangepi-xunlongp><p>Then download the arm64 version of the deb installation package</linuxp><p>[[File:zero2w-orangepiimg220.png]]</treep></li><li><p>Then upload the downloaded '''orange-pi-6nomachine_x.x.x_x_arm64.1-sun50iw9deb''' to the Linux system of the development board</p><ol start="2" style="list-style-type: lower-alpha;"/li><li><p>The git warehouse where Then use the u-boot source code is stored is as follows. Please note that following command to install '''NoMachine''' in the branch Linux system of the u-boot-orangepi warehouse is switched todevelopment board</p><ol {| class="wikitable" style="list-style-typewidth: lower-alpha800px;">|-| <lip>v2018orangepi@orangepi:~$ '''sudo dpkg -i nomachine_x.05x.x_x_arm64_arm64.deb'''</p>|}</li></ol>
</li></ol>
<ol start="2" style="list-style-type: decimal;">
<li>Then download the installation package of the Windows version of the NoMachine software. The download address is as follows<p/li>When orangepi{| class="wikitable" style="background-build is run for the first time, it will color:#ffffdc;width:800px;" |-| <big>'''Note that this download the crosslink may change.'''</big>|}{| class="wikitable" style="width:800px;" |-compilation tool chain, u| '''https://downloads.nomachine.com/download/?id=9'''|} [[File:zero2w-boot and linux kernel source codeimg221. After successfully compiling a linux image, the files and folders that can be seen in orangepi-build are:png]]</pol><ol start="3" style="list-style-type: lower-alphadecimal;"><li><p>Then install NoMachine in Windows. '''buildPlease restart your computer after installation.sh''': Compile startup script</p></li><li><p>Then open '''externalNoMachine'''in Window</p><p>[[File: Contains the configuration files needed to compile the image, scripts for specific functions, and the source code of some programs. The rootfs compressed package cached during the image compilation process is also stored in externalzero2w-img222.png]]</p></li><li><p>'''kernel''': Store After NoMachine is started, it will automatically scan other devices with NoMachine installed on the LAN. After entering the main interface of NoMachine, you can see that the development board is already in the list of connectable devices, and then click on the location shown in the red box in the picture below You can now log in to the source code Linux system desktop of the linux kerneldevelopment board.</p></li><li><p>'''LICENSE'''[[File: GPL 2 license filezero2w-img223.png]]</p></li><li><p>Then click '''README.mdOK''': orangepi-build documentation</p></li><li><p>'''output'''[[File: Store compiled uzero2w-boot, linux and other deb packages, compilation logs, and compiled images and other filesimg224.png]]</p></li><li><p>'''scripts''': Common script for compiling linux imagesThen enter the username and password of the development board Linux system in the corresponding positions in the figure below, and then click OK to start logging in.</p></li><li><p>'''toolchains'''[[File: Store crosszero2w-compilation tool chainimg225.png]]</p></li><li><p>'''u-boot''': Store Then click OK in the source code of u-bootnext interface.</p></li><li><p>'''userpatches''': Store Finally you can see the configuration files needed to compile desktop of the scriptdevelopment board Linux system</p></lip>[[File:zero2w-img226.png]]</olp></li></ol>
'''<span style="color:# Run the buildFF0000">There are many problems with VNC testing in Ubuntu20.sh script04, remember to add sudo permissionsplease do not use this method.</span>'''</big>|}
<div classp>Password: '''<span style="figurecolor:#FF0000">#Set the vnc password here, 8 characters</span>'''</p><p>Verify: '''<span style="color:#FF0000">#Set the vnc password here, 8 characters</span>'''</p><p>Would you like to enter a view-only password (y/n)? '''<span style="color:#FF0000">n</span>'''</p><p>xauth: file /root/.Xauthority does not exist</p>
</divp><ol start="3" style="list-style-typeNew 'X' desktop is orangepi: decimal;"><li>Then select the model of the development board</li>1</olp>
<ol startdiv class="3figure" style="list-style-type: lower-alpha;"><li>Path to the compiled u-boot deb package</li></ol>
[ o.k[File:zero2w-img227. png] Target directory [ '''orangepi-build/output/debs/u-boot''' ]
</div></ol><ol start="42" style="list-style-type: lower-alpha;"><li>The package name of <p>Then enter the compiled uVNC password set earlier</p><p>[[File:zero2w-boot deb packageimg228.png]]</p></li><li><p>After successful login, the interface is displayed as shown below, and then you can remotely operate the desktop of the development board Linux system.</olp></li>
[ o.k[File:zero2w-img229. png]] File name [ '''linux</ol></li></ol><span id="qt-uinstallation-boot-next-orangepizero2w_x.x.x_arm64.deb''' ]method"></span>
</li></ol>
::[[File:zero2w-img278img245.png]]
::{| class="wikitable" style="width:800px;" |-| [[Filehttp://docs.ros.org/ '''http:zero2w-img279//docs.ros.png]org''']
<ol start="2" style="list-style-type: decimal;"><li><p>The link to the official installation documentation of ROS 1 '''Noetic Ninjemys''' is as follows:</p>{| class="wikitable" style="width:800px;" |-| <p>[http://wiki.ros.org/noetic/Installation/Ubuntu '''http://wiki.ros.org/noetic/Installation/Ubuntu''']</p>|}</li><li><p>In the official installation documentation of ROS '''Noetic Ninjemys''', Ubuntu recommends using Ubuntu20.04, so please ensure that the system used by the development board is '''<span style="color:#FF0000">Ubuntu20.04 desktop system</span>'''.</p>{| class="wikitable" style="width:800px;" |-| <p>[http://wiki.ros.org/noetic/Installation '''http://wiki.ros.org/noetic/Installation''']</p><p>[[File:zero2w-img280img247.png]]</p>|}</li><li><p>Then use the script below to install ros1</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''install_ros.sh ros1'''</p>|}</li><li><p>Before using the ROS tool, you first need to initialize rosdep. Then when compiling the source code, you can quickly install some system dependencies and some core components in ROS.</p></li>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''<span style="color:#FF0000">Note that when running the following command, you need to ensure that the development board can access github normally, otherwise an error will be reported due to network problems.</span>'''
'''<div classspan style="figurecolor:#FF0000">ERROR: error loading sources list:</span>'''
</div></ol>
<ol start="9" style="list-style-type: decimal;">
<li>When the orangepi-bulid compilation system compiles the linux kernel source code<p>At this time, it will first synchronize press the linux kernel source code with direction keys on the linux kernel source code of keyboard to control the github server. Therefore, if you want little turtle to modify the linux kernel source codemove up, you first need to turn off the update function of the source code ('''it needs to be completely compiled once This function can only be turned off after obtaining the Linux kernel source codedown, otherwise it will prompt that the source code of the Linux kernel cannot be found''')left, otherwise the modifications will be restoredand right. The method is as follows</p><p>[[File:zero2w-img250.png]]</p></li></ol>
<blockquote>Set the IGNORE_UPDATES variable in '''userpatches/configspan id="how-to-install-ros-2-galactic-on-defaultubuntu20.conf''' to "yes"04"></blockquotespan>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''
<ol start="10" style="list-style-type: decimal;"><li><p>If the kernel The currently active version of ROS 2 is modifiedas follows, you can use the following method recommended version is '''Galactic Geochelone'''</p><p>[[File:zero2w-img251.png]]</p><p>[[File:zero2w-img252.png]]</p>{| class="wikitable" style="width:800px;" |-| <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 update the kernel and kernel module official installation documentation of the development board Linux systemROS 2 '''Galactic Geochelone''' is as follows:</p><ol {| class="wikitable" style="listwidth:800px;" |-style| <p>'''docs.ros.org/en/galactic/Installation.html'''</p><p>'''http://docs.ros.org/en/galactic/Installation/Ubuntu-type: lowerInstall-alpha;"Debians.html'''</p>|}</li><li>Upload <p>In the compiled deb package official installation documentation of the ROS 2 '''Galactic Geochelone''', Ubuntu Linux kernel to recommends using Ubuntu20.04, so please ensure that the Linux system of used by the development boardis the '''<span style="color:#FF0000">Ubuntu20.04 desktop system</span>'''. There are several ways to install ROS 2. The following demonstrates how to install ROS 2 '''Galactic Geochelone''' through '''Debian packages'''.</p></li><li><p>Use the '''install_ros.sh''' script to install ros2</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''install_ros.sh ros2'''</olp>|}</li><li><p>The '''install_ros.sh''' script will automatically run the '''ros2 -h''' command after installing ros2. If you can see the following print, it means that the ros2 installation is complete.</p>{| class="wikitable" style="width:800px;" |-| <p>usage: ros2 [-h] Call `ros2 <command> -h` for more detailed usage. ...</olp>
<ol start="2" style="list-style-typep>optional arguments: lower-alpha;"</p>:<li>Install the deb package of the new linux kernel just uploaded.</lip>-h, --help show this help message and exit</olp>
<ol start="3" style="listp>Commands:</p>:<p>action Various action related sub-stylecommands</p>:<p>bag Various rosbag related sub-commands</p>:<p>component Various component related sub-typecommands</p>: lower<p>daemon Various daemon related sub-alpha;"commands</p>:<lip>Then restart the development board doctor Check ROS setup and check whether the kernelother potential issues</p>:<p>interface Show information about ROS interfaces</p>:<p>launch Run a launch file</p>:<p>lifecycle Various lifecycle related sub-commands</p>:<p>multicast Various multicast related sub-commands</p>:<p>node Various node related sub-commands</p>:<p>param Various param related sub-commands</p>:<p>pkg Various package related sub-commands</p>:<p>run Run a package specific executable</p>:<p>security Various security related sub-commands</p>:<p>service Various service related sub-commands</p>:<p>topic Various topic related modifications have taken effect.sub-commands</lip>:<p>wtf Use `wtf` as alias to `doctor`</olp>
:<span id="compilep>Call `ros2 <command> -rootfs">h` for more detailed usage.</spanp>== Compile rootfs ==|}</li># Run <li><p>Then you can use the build'''test_ros.sh ''' scriptto test whether ROS 2 is installed successfully. If you can see the following print, remember to add sudo permissionsit means ROS 2 can run normally.</p>{| class="wikitable" style="width:800px;" |-| test<p>orangepi@testorangepi:~/orangepi-build$ '''sudo test_ros.sh'''</buildp><p>[INFO] [1671174101.sh200091527] [talker]: Publishing: 'Hello World: 1'</p><p>[INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]</p><p>[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'</p><p>[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]</p><ol startp>[INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'</p><p>[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]</p>|}</li><li><p>Run the following command to open rviz2</p>{| class="2wikitable" style="list-style-typewidth: decimal800px;"|-| <p>orangepi@orangepi:~$ '''source /opt/ros/galactic/setup.bash'''</p><lip>Select orangepi@orangepi:~$ '''Rootfs and all deb packagesros2 run rviz2 rviz2''' and press Enter</p>|}<p>[[File:zero2w-img253.png]]</p></li><li><p>For how to use ROS, please refer to the documentation of ROS 2.</olp> <div {| class="figurewikitable"style="width:800px;" |-| <p>[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/galactic/Tutorials.html''']</p>|}</li></ol>
<div class="figure"p>Commands:</p>:<p>action Various action related sub-commands</p>:<p>bag Various rosbag related sub-commands</p>:<p>component Various component related sub-commands</p>:<p>daemon Various daemon related sub-commands</p>:<p>doctor Check ROS setup and other potential issues</p>:<p>interface Show information about ROS interfaces</p>:<p>launch Run a launch file</p>:<p>lifecycle Various lifecycle related sub-commands</p>:<p>multicast Various multicast related sub-commands</p>:<p>node Various node related sub-commands</p>:<p>param Various param related sub-commands</p>:<p>pkg Various package related sub-commands</p>:<p>run Run a package specific executable</p>:<p>security Various security related sub-commands</p>:<p>service Various service related sub-commands</p>:<p>topic Various topic related sub-commands</p>:<p>wtf Use `wtf` as alias to `doctor`</p>
:<p>Call `ros2 <command> -h` for more detailed usage.</p>|}</divli><ol startli><p>Then you can use the '''test_ros.sh''' script to test whether ROS 2 is successfully installed. If you can see the following print, it means ROS 2 can run normally.</p>{| class="7wikitable" style="list-style-typewidth: decimal800px;">|-| <lip>If you are compiling the server version of the image, you can also choose to compile the Standard version or the Minimal version. The Minimal version will have much less pre-installed software than the Standard version (orangepi@orangepi:~$ '''please do not choose the Minimal version without special needs, because many things are not pre-installed by defaulttest_ros. Some functions may not be availablesh''')</lip><p>[INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'</olp> <div class="figure"p> [INFO] [File:zero2w-img2881671174101.png235661048] [listener]: I heard: [Hello World: 1] </divp><ol start="8" style="list-style-typep>[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: decimal;"2'</p><lip>If you are compiling a desktop version of the image, you also need to select the type of desktop environment. Currently, only XFCE is maintained, so please select an XFCE type desktop[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]</lip></olp> [INFO] [File:zero2w-img2891671174103.png199580322][talker]: Publishing: 'Hello World: 3'</p> <p>[INFO] [File:zero2w-img2901671174103.png204019965] [listener]: I heard: [Hello World: 3]</p>|}</li>You can then select additional packages that need to be installed. Please press <li><p>Run the Enter key here following command to skip directlyopen rviz2</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''source /opt/ros/humble/setup.bash'''</p><p>orangepi@orangepi:~$ '''ros2 run rviz2 rviz2'''</p><p>[[File:zero2w-img291img254.png]]</p>|}<ol start="9" style="list-style-type: decimal;"/li><li><p>Then the compilation of rootfs will start. Some of the information prompted during compilation are as follows:Reference documentation</p><ol {| class="wikitable" style="list-style-typewidth: lower-alpha800px;">|-| <lip>Type of rootfs'''http://docs.ros.org/en/humble/index.html'''</lip><p>[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html''']</olp>|}
</li></ol>
<ol start="3" style="list-style-type: lower-alphadecimal;"><li><p>The name Linux image released by OPi comes with the deb package of the rootfs compressed package generated kernel header file by compilationdefault, and the storage location is '''/opt/'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''ls /opt/linux-headers*'''</p><p>/opt/linux-headers-xxx-sun50iw9_x.x.x_arm64.deb</p>|}</li><li><p>Use the following command to install the deb package of the kernel header file</olp>{| class="wikitable" style="width:800px;" |-[ o| <p>orangepi@orangepi:~$ '''sudo dpkg -i /opt/linux-headers*.kdeb'''</p>|}</li><li><p>After installation, you can see the folder where the kernel header file is located under '''/usr/src'''. ] File name [ </p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''ls /usr/src'''bullseye</p><p>linux-xfceheaders-arm64x.5250ec7002de9e81a41de169f1f89721x.tarx</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'''.lz4After entering this directory, then use the make command to compile.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ ''' cd /usr/src/hello/'''</p><p>orangepi@orangepi:/usr/src/hello$ '''sudo make'''</p><p>make -C /lib/modules/5.4.125/build M=/usr/src/hello modules</p><p>make[1]: Entering directory '/usr/src/linux-headers-5.4.125'</p>:<p>CC [M] /usr/src/hello/hello.o</p>:<p>Building modules, stage 2.</p>:<p>MODPOST 1 modules</p>:<p>CC [M] /usr/src/hello/hello.mod.o<ol start/p>:<p>LD [M] /usr/src/hello/hello.ko</p><p>make[1]: Leaving directory '/usr/src/linux-headers-5.4.125'</p>|}</li><li><p>After compilation, the '''hello.ko''' kernel module will be generated</p>{| class="10wikitable" style="list-style-typewidth: decimal800px;"|-| <p>orangepi@orangepi:/usr/src/hello$ '''ls *.ko'''</p><p>hello.ko</p>|}</li><li><p>View Use the compiled rootfs compressed package'''insmod''' command to insert the '''hello.ko''' kernel module into the kernel</p><ol {| class="wikitable" style="list-style-typewidth: lower-alpha800px;"|-| <p>orangepi@orangepi:/usr/src/hello$ '''sudo insmod hello.ko'''</p>|}</li><li><p>Then use the '''demsg'''command to view the output of the ''bullseye-xfce-arm64'hello.5250ec7002de9e81a41de169f1f89721ko''' kernel module.tarIf you can see the following output, it means that the '''hello.lz4ko''' It kernel module is a compressed package of rootfsloaded correctly.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:/usr/src/hello$ '''dmesg | grep "Hello"'''</p><p>[ 2871. The meaning of each field in 893988] '''Hello Orange Pi -- init'''</p>|}</li><li><p>Use the '''rmmod''' command to uninstall the name is'''hello.ko''' kernel module</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:/usr/src/hello$ '''sudo rmmod hello'''</p><p>orangepi@orangepi:/usr/src/hello$ '''dmesg | grep "Hello"'''</p><p>[ 2871.893988] Hello Orange Pi -- init</lip><p>[ 3173.800892] '''Hello Orange Pi -- exit'''</olp>|}
</li></ol>
<blockquotespan id="testing-of-some-programming-languages-supported-by-linux-system"></span>a) '''bullseye''' represents the type of Linux distribution of rootfs
</li></ol>
<ol style="list-style-type: lower-alpha;">
<li><p>If the development board you purchased has a memory size The specific version of Python is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''python3'''</p><p>'''Python 3.9.2''' (default, Feb 28 2021, 17:03:44)</p><p>[GCC 10.2.120210110] on linux</p><p>Type "help", "copyright", "credits" or "license" for more information.5GB, please select </p><p>>>></p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Use the first optionCtrl+D shortcut key to exit python's interactive mode.'''</p></big>|}</li><li><p>If Write the development board you purchased has 1GB or 2GB or 4GB memory size, please choose the second option'''hello_world.py''' program in Python language</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''vim hello_world.py'''</p><p>print('Hello World!')</p>|}</li><li><p>[[FileThe result of running '''hello_world.py''' is as follows</p>{| class="wikitable" style="width:zero2w800px;" |-img277| <p>orangepi@orangepi:~$ '''python3 hello_world.png]]py'''</p><p>Hello World!</p>|}</li></ol>
</li>
<li><p>Then select the type of rootfs</p></li></ol> [[File:zero2w-img286Debian Bullseye does not install Java compilation tools and operating environment by default.png]] <ol start="7" style="list-style-type: decimal;"><li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>You can use the following command to install openjdk. The latest version in Debian Bullseye is openjdk-17</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''Image with console interface (server)sudo apt install -y openjdk-17-jdk''' Represents </p>|}</li><li><p>After installation, you can check the image of the server Java version, which is relatively small in size.</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''java --version'''</p>|}</li><li><p>Write the Java version of '''Image with desktop environmenthello_world.java'''Represents an image with a desktop, which is relatively large in size</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''vim hello_world.java'''</p><p>public class hello_world</lip><p>{</olp>:<p>public static void main(String[] args)</lip>:<p>{</olp>::<p>System.out.println("Hello World!");</p>:<p>}<div class="figure"/p><p>}</p>[[File:zero2w-img287.png]]|}</li><li><p>Then compile and run '''hello_world.java'''</divp><ol start{| class="8wikitable" style="list-style-typewidth: decimal800px;"|-| <p>orangepi@orangepi:~$ '''javac hello_world.java'''</p><lip>If you are compiling the server version of the image, you can also choose to compile the Standard version or the Minimal version. The Minimal version will have much less pre-installed software than the Standard version (orangepi@orangepi:~$ '''please do not choose the Minimal version without special needs, because many things are not pre-installed by default. Some functions may not be availablejava hello_world''')</p><p>Hello World!</p>|}</li></ol> <div class="figure"/li></ol> [[File:zero2w-img288.png]]
</div><ol startspan id="9" style="listdebian-stylebookworm-type: decimal;system"><li>If you are compiling a desktop version of the image, you also need to select the type of desktop environment. Currently, only XFCE is maintained, so please select an XFCE type desktop.</li></olspan>
<ol style="list-style-type: lower-alpha;">
<li><p>The storage path specific version of the compiled imagePython is as follows</li></olp></li></ol> [ o.k. ] Done building [ '''output/images/orangepizero2w_x.x.x_debian_bullseye_linux6.1.xx_xfce_desktop/orangepizero2w_x.x.x_debian_bullseye_linux6.1.xx_xfce_desktop.img''' ] <ol start{| class="2" style="list-style-type: lower-alpha;"><li>Compilation time</li></ol> '''[ o.k. ] Runtime [ 19 min ]''' <ol start="3wikitable" style="list-style-typewidth: lower-alpha800px;"><li>Repeat the command to compile the image. Use the following command to start compiling the image directly without selecting it through the graphical interface.</li></ol> [ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=image RELEASE=bullseye BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes''' ] <span id="instructions-for-using-the-orange-pi-os-arch-system"></span> = '''Instructions for using the Orange Pi OS Arch system''' = <span id="orange-pi-os-arch-system-function-adaptation-status"></span>== Orange Pi OS Arch system function adaptation status == {| class="wikitable"
|-
| <p>orangepi@orangepi:~$ '''Motherboard functionspython3'''</p><p>Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux</p><p>Type "help", "copyright", "credits" or "license" for more information.</p><p>>>></p>|}{| '''OPi OS Arch'''class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
| <big><p>'''HDMI videoUse the Ctrl+D shortcut key to exit python's interactive mode.'''</p></big>| }</li><li><p>Write the '''OKhello_world.py'''program in Python language</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''vim hello_world.py''HDMI Audio'</p><p>print('Hello World!')</p>| }</li><li><p>The result of running '''OKhello_world.py'''is as follows</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''Type-C USB2python3 hello_world.0 x 2py'''</p><p>Hello World!</p>|}</li></ol></li><li><p>Debian Bookworm does not install Java compilation tools and operating environment by default.</p><ol style="list-style-type: lower-alpha;"><li><p>You can use the following command to install openjdk. The latest version in Debian Bookworm is openjdk-17</p>{| '''OK'''class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''TF Card Startupsudo apt install -y openjdk-17-jdk'''</p>|}</li><li><p>After installation, you can check the Java version.</p>{| '''OK'''class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''WIFIjava --version'''</p>| }</li><li><p>Write the Java version of '''OKhello_world.java'''</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''Bluetoothvim hello_world.java'''</p><p>public class hello_world</p><p>{</p>:<p>public static void main(String[] args)</p>:<p>{</p>::<p>System.out.println("Hello World!");</p>:<p>}</p><p>}</p>| }</li><li><p>Then compile and run '''OKhello_world.java'''</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''LED Lightjavac hello_world.java'''</p>| <p>orangepi@orangepi:~$ '''OKjava hello_world'''</p><p>Hello World!</p>|}</li></ol></li></ol> <span id="ubuntu-focal-system"></span> === Ubuntu Focal system === <ol style="list-style-type: decimal;"><li><p>Ubuntu Focal is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system of the development board.</p><ol style="list-style-type: lower-alpha;"><li><p>The version of a.gcc is as follows</p>{| class="wikitable" style="width:800px;"
|-
| '''40pin GPIO'''| <p>orangepi@orangepi:~$ '''OKgcc --version'''</p>|<p>gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0</p><p>Copyright (C) 2019 Free Software Foundation, Inc.</p><p>This is free software; see the source for copying conditions. There is NO</p><p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>| }</li><li><p>Write the '''40pin I2Chello_world.c'''program in C language</p>{| '''OK'''class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''40pin SPIvim hello_world.c'''</p><p>#include <stdio.h></p> <p>int main(void)</p><p>{</p>:<p>printf("Hello World!\n");</p> :<p>return 0;</p><p>}</p>| }</li><li><p>Then compile and run '''OKhello_world.c'''</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''40pin UARTgcc -o hello_world hello_world.c'''</p>| <p>orangepi@orangepi:~$ '''OK./hello_world'''</p><p>Hello World!</p>|}</li></ol></li><li><p>Ubuntu Focal has Python3 installed by default</p><ol style="list-style-type: lower-alpha;"><li><p>The specific version of Python3 is as follows</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''40pin PWMpython3'''</p><p>Python 3.8.10 (default, Nov 14 2022, 12:59:47)</p><p>[GCC 9.4.0] on linux</p><p>Type "help", "copyright", "credits" or "license" for more information.</p><p>>>></p>| '''OK'''}{| class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
| <big><p>'''Temperature SensorUse the Ctrl+D shortcut key to exit python's interactive mode.'''</p></big>| }</li><li><p>Write the '''OKhello_world.py'''program in Python language</p>{| class="wikitable" style="width:800px;"
|-
| '''Hardware watchdog'''| <p>orangepi@orangepi:~$ '''OKvim hello_world.py'''</p>|-| '''Mali GPU'''| '''NO'''|-| '''Video codec'''| '''NO'<p>print('Hello World!')</p>
|}
</li><li><p>The result of running '''hello_world.py''' is as follows</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''24pin expansion board functionpython3 hello_world.py'''</p><p>Hello World!</p>| '''OPi OS Arch'''}</li></ol></li><li><p>Ubuntu Focal does not have Java compilation tools and running environment installed by default.</p><ol style="list-style-type: lower-alpha;"><li><p>You can use the following command to install openjdk-17</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''100M network portsudo apt install -y openjdk-17-jdk'''</p>|}</li><li><p>After installation, you can check the Java version.</p>{| '''OK'''class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''100M Ethernet port lightjava --version'''</p><p>openjdk 17.0.2 2022-01-18</p><p>OpenJDK Runtime Environment (build 17.0.2+8-Ubuntu-120.04)</p><p>OpenJDK 64-Bit Server VM (build 17.0.2+8-Ubuntu-120.04, mixed mode, sharing)</p>| }</li><li><p>Write the Java version of '''OKhello_world.java'''</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''USB2vim hello_world.0 HOST x 2java'''</p><p>public class hello_world</p><p>{</p>:<p>public static void main(String[] args)</p>:<p>{</p>::<p>System.out.println("Hello World!");</p>:<p>}</p><p>}</p>| }</li><li><p>Then compile and run '''OKhello_world.java'''</p>{| class="wikitable" style="width:800px;"
|-
| '''Infrared reception'''| <p>orangepi@orangepi:~$ '''OKjavac hello_world.java'''</p>|-| <p>orangepi@orangepi:~$ '''Headphone audio playbackjava hello_world'''</p>| '''OK'''|-| '''On<p>Hello World!</off button'''| '''OK'''|-| '''LRADC''' '''Custom buttons x 2'''| '''OK'''|-| '''TV-OUT'''| '''NO'''p>
|}
</li></ol>
</li></ol>
<span id="orangeubuntu-pi-os-archjammy-system-user-guide-instructions"></span>== Orange Pi OS Arch System User Guide Instructions ==
<ol style="list-style-type: decimal;">
<li><p>Ubuntu Jammy is installed with the gcc compilation tool chain by default, which can directly compile C language programs in the Linux system of the development board.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>After burning The version of a.gcc is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''gcc --version'''</p><p>gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) '''11.3.0'''</p><p>Copyright (C) 2021 Free Software Foundation, Inc.</p><p>This is free software; see the system, when you start it source for copying conditions. There is NO</p><p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>|}</li><li><p>Write the first time and enter the desktop, you will see the user wizard '''hello_world.c''' program shown in the figure below.C language</p><div {| class="figurewikitable" style="width:800px;"|-| <p>orangepi@orangepi:~$ '''vim hello_world.c'''</p><p>#include <stdio.h></p>
</divp>int main(void)</lip><lip>{</p>First you need to select the language you want:</p>printf("Hello World!\n");<div class="figure"/p>
:<p>return 0;</p><p>}</p>|}</li><li><p>Then compile and run '''hello_world.c'''</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''gcc -o hello_world hello_world.c'''</p><p>orangepi@orangepi:~$ '''./hello_world'''</p><p>Hello World!</p>|}</divli></ol></li><li><p>After selecting the languageUbuntu Jammy has Python3 installed by default</p><ol style="list-style-type: lower-alpha;"><li><p>The specific version of Python3 is as follows</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''python3'''</p><p>Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux</p><p>Type "help", "copyright", "credits" or "license" for more information.</p><p>>>></p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Use the user wizard will immediately switch Ctrl+D shortcut key to exit python's interactive mode.'''</p></big>|}</li><li><p>Write the corresponding '''hello_world.py''' program in Python language interface, as shown below in Chinese</p><div {| class="figurewikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''vim hello_world.py'''</p><p>print('Hello World!')</p>|}[[File</li><li><p>The result of running '''hello_world.py''' is as follows</p>{| class="wikitable" style="width:zero2w800px;" |-img295| <p>orangepi@orangepi:~$ '''python3 hello_world.png]]py'''</p><p>Hello World!</p>|}</divli></ol></li><li><p>Then select Ubuntu Jammy does not install Java compilation tools and operating environment by default.</p><ol style="list-style-type: lower-alpha;"><li><p>You can use the areafollowing command to install openjdk-18</p>{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-18-jdk'''</p>|}</li><li><p>After installation, you can check the Java version.<div /p>{| class="figurewikitable">style="width:800px;" |-| [[File<p>orangepi@orangepi:zero2w~$ '''java --img296version'''</p><p>openjdk 18.png]]0.2-ea 2022-07-19</p><p>OpenJDK Runtime Environment (build 18.0.2-ea+9-Ubuntu-222.04)</p><p>OpenJDK 64-Bit Server VM (build 18.0.2-ea+9-Ubuntu-222.04, mixed mode, sharing)</divp>|}</li><li><p>Then select Write the keyboard modelJava version of '''hello_world.java'''</p><div {| class="figurewikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''vim hello_world.java'''</p><p>public class hello_world</p><p>{</p>:<p>public static void main(String[[File] args)</p>:<p>{</p>::zero2w-img297<p>System.out.png]]println("Hello World!");</p>:<p>}</p><p>}</divp>|}</li><li><p>Then create a new username compile and set a passwordrun '''hello_world.java'''</p><div {| class="figurewikitable"style="width:800px;" |-| <p>orangepi@orangepi:~$ '''javac hello_world.java'''</p><p>orangepi@orangepi:~$ '''java hello_world'''</p><p>Hello World!</p>|}</li></ol></li></ol>
</divspan id="method-to-upload-files-to-the-development-board-linux-system-in-ubuntu-pc"></lispan><li><p>Then make sure there is no problem with === Method to upload files to the selection, and then click the install '''button'''</p><div classdevelopment board Linux system in Ubuntu PC ==="figure">
<ol style="list-style-type: decimal;"><li><p>Use the scp command to upload files to the Linux system of the development board in Ubuntu PC. The specific command is as follows</p><ol style="list-style-type: lower-alpha;"><li><p>'''file_path: '''Needs to be replaced with the path of the file to be uploaded</divp></li><li><p>Then wait for '''orangepi: '''This is the installation user name of the development board's Linux system. It can also be replaced with something else, such as root.</p></li><li><p>'''192.168.xx.xx:''' This is the IP address of the development board. Please modify it according to the actual situation.</p></li><li><p>'''/home/orangepi:''' The path in the development board Linux system can also be modified to other paths.</p>{| class="wikitable" style="width:800px;" |-| <p>test@test:~$ '''scp file_path orangepi@192.168.xx.xx:/home/orangepi/'''</p>|}</li></ol></li><li><p>If you want to upload a folder, you need to completeadd the -r parameter</p>{| class="wikitable" style="width:800px;" |-| <div p>test@test:~$ '''scp <span style="color:#FF0000">-r</span> dir_path orangepi@192.168.xx.xx:/home/orangepi/'''</p>|}</li><li><p>There are more usages of scp, please use the following command to view the man manual</p></li>{| class="figurewikitable" style="width:800px;" |-| test@test:~$ '''man scp'''|}</ol><span id="how-to-upload-files-using-filezilla"></span>
<ol style="list-style-type: decimal;"><li><p>First install filezilla in Ubuntu PC</divp>{| class="wikitable" style="width:800px;" |-| <p>test@test:~$ '''sudo apt install -y filezilla'''</p>|}</li><li><p>After Then use the installation is complete, you need following command to click the open filezilla</p>{| class="wikitable" style="width:800px;" |-| <p>test@test:~$ '''Finishfilezilla''' button to restart </p>|}</li><li><p>The interface after opening filezilla is as shown below. At this time, the remote site on the systemright is empty.</p>
<div class="figure">
[[File:zero2w-img301img255.png]]
</div></li>
<li><p>The Orange Pi Hello program will automatically start after restarting. At this time, you need to remove method of connecting the check '''mark of Start on startup''' development board is as shown in the lower right corner, otherwise you need to manually close the Orange Pi Hello program every time you start it.figure below</p></li>
<div class="figure">
[[File:zero2w-img302img256.png]]
</div></ol><ol start="5" style="list-style-type: decimal;"><li><p>At this point, you can use Then choose to '''save the newly created username password''' and password to log in to the OPi OS system through the serial port or sshclick '''OK'''</p><p>[[File:zero2w-img257.png]]</p></li><li><p>Then select '''Always trust this host''' and click '''OK'''</p></olli>
<span iddiv class="how-to-set-dt-overlaysfigure"></span>== How to set DT overlays ==
[orangepi@orangepi[File:zero2w-pc ~img259.png]]$ '''sudo vim /boot/extlinux/extlinux.conf'''
</div></ol><ol start="28" style="list-style-type: decimal;"><li>Then open select the path to be uploaded to the development board on the right side of the filezilla software, select the corresponding configuration by adding '''FDTOVERLAYS''' '''/dtbs/allwinner/overlay/xxx.dtbo''' file to be uploaded in '''/boot/extlinux/extlinuxUbuntu PC on the left side of the filezilla software, right-click the mouse, and then click the upload option to start uploading the file to the development board.conf'''</li></ol>
[orangepi@orangepi[File:zero2w-pc ~img260.png]]$ '''sudo vim /boot/extlinux/extlinux.conf'''
::{| class="wikitable" style="width:800px;"
|-
| [https://filezilla-project.org/download.php?type=client '''Functions on the development boardhttps://filezilla-project.org/download.php?type=client''']| '''Corresponding DT overlays configuration'''} ::[[File:zero2w-img261.png]] <div class="figure"> ::[[File:zero2w-img262.png]] </div><ol start="2" style="list-style-type: decimal;"><li><p>The downloaded installation package is as shown below, then double-click to install it directly</p>{| class="wikitable" style="width:800px;"
|-
| '''40pin - i2c0'''| <p>'''sun50i-h616-pi-i2c0FileZilla_Server_1.dtbo'''|-| '''40pin - i2c1'''| '''sun50i-h616-pi-i2c15.dtbo'''|-| '''40pin - i2c2'''| '''sun50i-h6161_win64-pi-i2c2setup.dtboexe'''</p>|-}| During the installation process, please select '''40pin - uart2Decline'''| on the following installation interface, and then select '''sun50i-h616-pi-uart2.dtboNext>'''|-| '''40pin - uart3'''| '''sun50i-h616-pi-uart3.dtbo'''<div class="figure">|-| '''40pin - uart4'''| '''sun50i-h616-pi-uart4.dtbo'''|-| '''40pin - uart5'''| '''sun50i-h616-ph-uart5.dtbo'''|-| '''40pin - pwm1'''| '''sun50i-h616-pi-pwm1.dtbo'''|-| '''40pin - pwm2'''| '''sun50i-h616-pi-pwm2.dtbo'''|-| '''40pin - pwm3'''| '''sun50i-h616-pi-pwm3.dtbo'''|-| '''40pin - pwm4'''| '''sun50i-h616-pi-pwm4.dtbo'''|-| '''40pin - spi1 cs0'''| '''sun50i-h616-spi1-cs0-spidev.dtbo'''|-| '''40pin - spi1 cs1'''| '''sun50i-h616-spi1-cs1-spidev.dtbo'''|-| '''40pin - spi1 cs0 cs1'''| '''sun50i-h616-spi1-cs0-cs1-spidev.dtbo'''|-| '''设Set USB0 to Host mode'''| '''sun50i-h616-usb0-host.dtbo'''|-| '''Turn off the green LED light'''| '''sun50i-h616-[[File:zero2w-disable-ledimg263.dtbo'''|-| '''How to close the UART0 debugging serial port'''| '''sun50i-h616-disable-uart0.dtbo'''|}png]]
</div></li></ol><ol start="53" style="list-style-type: decimal;"><li>If you need to open multiple configurations at the same time, just add the paths of multiple configurations directly The interface after '''FDTOVERLAYSopening filezilla is as shown below.''' For exampleAt this time, the configuration of opening i2c1 and uart5 at remote site on the same time right is as followsempty.</li></ol>
</div></ol><ol start="65" style="list-style-type: decimal;"><li>After setting, you need Then choose to restart the system for '''save the configuration to take effect.password''' and click '''OK'''</li></ol>
<div class="figure"> [orangepi@orangepi[File:zero2w-pc ~img265.png]$ ] </div></ol><ol start="6" style="list-style-type: decimal;"><li>Then select '''Always trust this host''' and click '''sudo rebootOK'''</li> <div class="figure"> [[File:zero2w-img266.png]] </div></ol><ol start="7" style="list-style-type: decimal;"><li>After the connection is successful, you can see the directory structure of the development board's Linux file system on the right side of the filezilla software.</li>
<span iddiv class="how-to-install-softwarefigure"></span>== How to install software ==
<span iddiv class="android-12-tv-system-usage-instructionsfigure"></span>
<span id/div></ol><ol start="9" style="supportedlist-androidstyle-versionstype: decimal;"><li><p>After the upload is completed, you can go to the corresponding path in the development board Linux system to view the uploaded file.</p></spanli>== Supported Android versions ==<li><p>The method of uploading a folder is the same as the method of uploading a file, so I won't go into details here.</p></li></ol>
<ol style="list-style-type: decimal;"><li><p>The power on/off logo will only be displayed on the desktop version of the system by default.</p></li><li><p>Set the '''bootlogo''' variable to '''false''' in '''/boot/orangepiEnv.txt''' to turn off the switch logo.</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''Motherboard functionssudo vim /boot/orangepiEnv.txt'''</p><p>verbosity=1</p><p>'''<span style="color:#FF0000">bootlogo=false</span>'''</p>| }</li><li><p>Set the '''Android12 TVbootlogo'''variable to '''true''' in '''/boot/orangepiEnv.txt''' to enable the power on/off logo.</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''HDMI videosudo vim /boot/orangepiEnv.txt'''</p>| <p>verbosity=1</p><p>'''OK<span style="color:#FF0000">bootlogo=true</span>'''</p>|}</li><li><p>The location of the boot logo picture in the Linux system is</p>{| class="wikitable" style="width:800px;"
|-
| <p>'''HDMI Audio/usr/share/plymouth/themes/orangepi/watermark.png'''</p>|}</li><li><p>After replacing the boot logo image, you need to run the following command to take effect</p>{| '''OK'''class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''Typesudo update-C USB2.0 x 2initramfs -u'''</p>| }</li></ol> <span id="how-to-turn-on-the-power-button-in-linux5.4"></span> == How to turn on the power button in Linux5.4 == There is no power on/off button on the main board of the development board. We can expand it through a 24pin expansion board. The location of the power on/off button on the expansion board is as follows: [[File:zero2w-img269.png]] The power on/off button of the Linux 6.1 image is turned on by default, but the power on/off button of the Linux 5.4 kernel image is turned off by default and needs to be turned on manually for normal use. The steps are as follows: <ol style="list-style-type: decimal;"><li><p>First run '''OKorangepi-config'''. Ordinary users remember to add '''sudo''' permissions.</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''TF card startupsudo orangepi-config'''</p>| }</li><li><p>Then select '''System'''</p><p>[[File:zero2w-img80.png]]</p></li><li><p>Then select '''Hardware'''</p><p>[[File:zero2w-img81.png]]</p></li><li><p>Then use the keyboard's arrow keys to locate the position shown in the picture below, and then use the '''space''' to select the dtbo configuration of the SPI you want to open.</p><p>[[File:zero2w-img270.png]]</p></li><li><p>Then select '''<Save>''' to save</p><p>[[File:zero2w-img83.png]]</p></li><li><p>Then select '''<Back>'''</p><p>[[File:zero2w-img84.png]]</p></li><li><p>Then select '''<Reboot>'OK''to restart the system to make the configuration take effect.</p><p>[[File:zero2w-img85.png]]</p></li></ol> <span id="how-to-shut-down-and-restart-the-development-board"></span> == How to shut down and restart the development board == <ol style="list-style-type: decimal;"><li><p>During the running of the Linux system, if you directly unplug the power supply, it may cause the file system to lose some data. It is recommended to use the '''poweroff''' command to shut down the Linux system of the development board before powering off, and then unplug the power supply.</p>{| class="wikitable" style="width:800px;"
|-
| <p>orangepi@orangepi:~$ '''WIFIsudo poweroff'''</p>| '''OK'''}{| class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
| <big><p>'''BluetoothNote that after turning off the development board, you need to unplug and replug the power supply before it can be turned on.'''</p></big>|}</li><li><p>In addition to using the poweroff command to shut down, you can also use the power on/off button on the expansion board to shut down.</p><p>[[File:zero2w-img269.png]]</p>{| '''OK'''class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
| <big><p>'''USB CameraNote that Linux 5.4 requires manual configuration of the power on/off button before it can be used. For the opening method, please refer to [[Orange Pi Zero 2W#How to turn on the power button in Linux5.4|the method of opening the power button in Linux5.4]].'''</p></big>| }</li><li><p>Use the '''OKreboot'''command to restart the Linux system in the development board</p>{| class="wikitable" style="width:800px;"
|-
| '''LED Light'''| '''OK'''|-| '''40pin GPIO'''| '''OK'''|-| '''40pin I2C'''| '''OK'''|-| '''40pin SPI1'''| <p>orangepi@orangepi:~$ '''OKsudo'''|-| '''40pin UART'''| '''OK'''|-| '''40pin PWM'''| '''OK'''|-| '''Temperature Sensor'''| '''OK'''|-| '''Hardware watchdog'''| '''OK'''|-| '''Mali GPU'''| '''OK'''|-| '''Video codec'''| '''OKreboot'''</p>
|}
</li></ol>
<span id="linux-sdkorangepi-build-usage-instructions"></span>
= '''Linux SDK——orangepi-build usage instructions''' =
<span id="compilation-system-requirements"></span>== Compilation system requirements == The Linux SDK, '''orangepi-build''', only supports running on X64 computers with '''<span style="color:#FF0000">Ubuntu 22.04</span>''' installed. Therefore, before downloading orangepi-build, please first ensure that the Ubuntu version installed on your computer is Ubuntu 22.04. The command to check the Ubuntu version installed on the computer is as follows. If the Release field does not display '''<span style="color:#FF0000">22.04</span>''', it means that the Ubuntu version currently used does not meet the requirements. Please change the system before performing the following operations. {| class="wikitable" style="width:800px;"
|-
| '''24pin Expansion board function'''| '''Android12 TVtest@test:~$ '''|lsb_release -| '''100M network porta'''| '''OK'''|-No LSB modules are available.| '''100M Ethernet port light'''| '''OK'''Distributor ID: Ubuntu|-| '''USB2Description: Ubuntu 22.0 HOST x 2'''| '''OK'''04 LTS|-| Release: '''Infrared reception'''| '''OK'''|-| '''Headphone audio playback'''| '''OK'''|-| '''On<span style="color:#FF0000">22.04</off button'''| '''OK'''|-| '''LRADC''' '''Custom buttons x 2'''| '''OK, The default setting is the volume up and down keys.span>'''|-| '''TV-OUT'''| Codename: '''OKjammy'''
|}
{| class="wikitable" style="width:800px;"
|-
|| [https://repo.huaweicloud.com/ubuntu-releases/21.04/ubuntu-21.04-desktop-amd64.iso '''green light'''| '''red light'''|https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-| '''u22.04-boot startup phase'''| '''Off'''| '''on'''|desktop-| '''Kernel boot to enter the system'''| '''on'''| '''onamd64.iso''']
|}
[[File:zero2w-img303img271.png]]</ol><span idol start="how3" style="list-tostyle-usetype: lower-adbalpha;"><li>The contents of the '''/etc/apt/sources.list''' file that need to be replaced are:</spanli>{| class="wikitable" style= How to use ADB =="width:800px;" |-| test@test:~$ '''sudo mv /etc/apt/sources.list cat /etc/apt/sources.list.bak'''
'''Using network adb does not require a USB Typc C interface data cable #''' The source code image is commented by default to connect the computer and the development boardimprove apt update speed. Instead, You can uncomment it communicates through the network, so first make sure that the development board's wired or wireless network is connected, and then obtain the IP address of the development boardyourself if necessary. Next To be used.'''
test@test:~$ '''adb shellgit clone https://github.com/orangepi-xunlong/orangepi-build.git -b next'''|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that when using the H618 Soc development board, you need to download the source code of the <span style="color:#FF0000">next</span> branch of orangepi-build. The above git clone command needs to specify the branch of the orangepi-build source code as next.'''</big>
</div>|}{| class="wikitable" style="background-color:# Prepare a USB Type C interface data cable, plug one end of ffffdc;width:800px;" |-| <big>'''When downloading the USB interface into orangepi-build code through the USB interface of git clone command, you do not need to enter the computer, user name and plug one end password of the USB Type C interface into github account (the USB0 interface of same is true for downloading other codes in this manual). If after entering the development board (see git clone command, Ubuntu PC prompts you to enter the description user name of the picture on github account. The name and password are usually entered incorrectly in the right below for address of the location of USB0)orangepi-build warehouse behind git clone. In this case, Please carefully check whether there are any errors in the development board is powered by spelling of the computer's USB interfacecommand, so please ensure rather than thinking that the computer's USB interface can we have forgotten to provide the most sufficient power to drive username and password of the development boardgithub account.'''</big>|}[[File:zero2wThe u-img304.png]] [[Fileboot and linux kernel versions currently used by the H618 series development boards are as follows:zero2w-img305.png]] <ol start{| class="2wikitable" style="list-stylewidth:800px;text-typealign: decimalcenter;"><li>Install adb tool on Ubuntu PC</li></ol>|-| '''branch'''| '''u-boot Version'''| '''linux Kernel version'''|-| '''current'''| '''u-boot v2018.05'''| '''linux5.4'''|-| '''next'''| '''u-boot v2021.07'''| '''linux6.1'''|}
<ol style="list-style-type: lower-alpha;"><li><p>'''build.sh''': Compile startup script</p></li><li><p>'''external''': Contains configuration files needed to compile the image, specific scripts, and source code of some programs, etc.</p></li><li><p>'''LICENSE''': GPL 2 license file</p></li><li><p>'''README.md''': orangepi-build documentation</p></li><li><p>'''scripts''': Common script for compiling linux images</p></li></ol>{| class="wikitable" style="width:800px;" |-| test@test:~/orangepi-build$ '''adb devicesls'''
<ol start="4" style="list-style-type: decimallower-alpha;"><li>After turning on WIlinux5.4</li>{| class="wikitable" style="width:800px;" |-FI, you can see the searched signals under | '''Available networksgcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''|}</ol><ol start="2" style="list-style-type: lower-alpha;"><li>linux6.1</li>{| class="wikitable" style="width:800px;" |-| '''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''|}</ol>The cross-compilation tool chain used to compile the H618 u-boot source code is:
<ol startdiv class="7figure" style="list-style-type: decimal;"><li>After the connection is successful, it will be displayed as shown below (the interface will be different on different mobile phones, the specific interface is subject to the one displayed on your mobile phone). At this time, you can open a web page on your mobile phone to see if you can access the Internet. If the web page can be opened normally, it means that the '''WI-FI Hotspot''' of the development board can be used normally.</li></ol>
[[File:zero2w-img323img274.png]]
<span id="how-to-check-the-ip-address-of-the-ethernet-port"/div></spanol>== How to check the IP address of the Ethernet port == # There is no wired network interface on the main board of the development board. We can expand the 100M Ethernet through a 24pin expansion board. [[File:zero2w-img107.png]] <ol start="23" style="list-style-type: decimal;"><li><p>Then make sure the network port of the expansion board is connected to the router or switch</p></li><li><p>Then open '''Settings'''</p><p>[[File:zero2w-img324.png]]</p></li><li><p>Then select '''Network & Internet'''</p><p>[[File:zero2w-img325.png]]</p></li><li><p>Then you can see the IP address model of the development board's wired network port at the location shown in the picture below.</p><p>[[File:zero2w-img326.png]]</p></li></ol> <span id="bluetooth-connection-method"></span>== Bluetooth connection method == # Choose first '''Settings''' [[File:zero2w-img306.png]] <ol start="2" style="list-style-type: decimal;"><li>Then select '''Bluetooth'''</li></ol> [[File:zero2w-img327.png]] <ol start="3" style="list-style-type: decimal;"><li>Then Open '''Bluetooth Enable'''</li></ol> [[File:zero2w-img328.png]] <ol start="4" style="list-style-type: decimal;"><li>Then click '''Pair new device'''to start scanning for surrounding Bluetooth devices</li></ol> [[File:zero2w-img329.png]] <ol start="5" style="list-style-type: decimal;"><li>The searched Bluetooth devices will be displayed under '''Available devices'''</li></ol> [[File:zero2w-img330.png]]
[[File:zero2w-img275.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li><p>Then select the branch type of u-boot</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The current branch will compile the u-boot v2018.05 version code that needs to be used by the linux5.4 image.</p></li>
<li><p>The next branch will compile the u-boot v2021.07 version code that needs to be used by the linux6.1 image.</p>
<p>[[File:zero2w-img276.png]]</p></li></ol>
</li>
<li><p>If you select the next branch, you will also be prompted to select the memory size, and you do not need to select the current branch.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>If the development board you purchased has a memory size of 1.5GB, please select the first option.</p></li>
<li><p>If the development board you purchased has 1GB or 2GB or 4GB memory size, please choose the second option.</p>
<p>[[File:zero2w-img277.png]]</p></li></ol>
</li></ol>
<ol start="6" style="list-style-type: decimal;">
<li><p>Then click on the Bluetooth device you want it will start to connect to start pairingcompile u-boot. When Some of the following interface pops up, please use the mouse to select information prompted when compiling the next branch is as follows:</p><ol style="list-style-type: lower-alpha;"><li>Version of u-boot source code</li>{| class="wikitable" style="width:800px;" |-| [ o.k. ] Compiling u-boot [ '''Pairv2021.07'''option]|}</ol><ol start="2" style="list-style-type: lower-alpha;"><li>Version of the cross-compilation tool chain</olli>{| class="wikitable" style="width:800px;" |-| [o.k. ] Compiler version [File'''aarch64-linux-gnu-gcc 11''' ]|}</ol><ol start="3" style="list-style-type: lower-alpha;"><li>Path to the compiled u-boot deb package</li>{| class="wikitable" style="width:zero2w800px;" |-img331| [ o.k.png]Target directory [ '''orangepi-build/output/debs/u-boot''' ]|}</ol><ol start="74" style="list-style-type: decimallower-alpha;"><li>What is tested here is The package name of the Bluetooth configuration process between the development board and the Android phonecompiled u-boot deb package</li>{| class="wikitable" style="width:800px;" |-| [ o.k. ] File name [ '''linux-u-boot-next-orangepizero2w_x. At this time, the following confirmation interface will pop up on the phonex. Click the pairing button on the phone to start the pairing processx_arm64.deb''' ]|}</ol><ol start="5" style="list-style-type: lower-alpha;"><li>Compilation time</olli>{| class="wikitable" style="width:800px;" |-| [[File:zero2w-img332o.k.png]Runtime [ '''1 min''' ]|}</ol><ol start="86" style="list-style-type: decimallower-alpha;"><li>After pairing is completed, open Repeat the command to compile u-boot. Use the following command without selecting through the graphical interface. You can start compiling u-boot directly.</li>{| class="wikitable" style="width:800px;" |-| [ o.k. ] Repeat Build Options [ '''Paired devicessudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=u-boot''' and you will see the paired Bluetooth devices.]|}</ol></li></ol><ol start="7" style="list-style-type: decimal;"><li>View the compiled u-boot deb package</li>{| class="wikitable" style="width:800px;" |-[[File| test@test:zero2w~/orangepi-img333.png]]build$ '''ls output/debs/u-boot/'''
'''linux-u-boot-next-orangepizero2w_x.x.x_arm64.deb'''|}</ol><ol start="98" style="list-style-type: decimal;"><li>At this timeWhen the orangepi-bulid compilation system compiles the u-boot source code, you can use it will first synchronize the u-boot source code with the Bluetooth u-boot source code of your mobile phone to send a picture to the development boardgithub server. After sendingTherefore, if you can see want to modify the following confirmation interface in u-boot source code, you first need to turn off the Android system download and update function of the development board, and then click source code. ('''AcceptYou need to completely compile u-boot before you can turn off this function, otherwise it will prompt that the source code of u-boot cannot be found''' to start receiving the pictures sent by ), otherwise the mobile phonemodifications will be restored.The method is as follows:</li></ol>
IGNORE_UPDATES="'''<span idstyle="how-to-set-usb0-to-host-mode-1color:#FF0000">yes</span>== How to set USB0 to HOST mode == As shown in the figure below, there are two Type-C interfaces on the motherboard of the development board: USB0 and USB1. Both of these interfaces can be used to power the development board, and they can also be used as USB2.0 HOST interfaces. The difference between USB0 and USB1 is that in addition to being set to HOST mode, USB0 can also be set to Device mode, while USB1 only has HOST mode. [[File:zero2w-img160.png]] USB0 of the Android12 TV system released by Orange Pi is set to Device mode by default, so when there is no need to use USB0 Device mode (ADB function needs to ensure that USB0 is in Device mode), it is recommended to use USB0 for power supply, so that USB1 can be directly used to connect USB devices . If you want to use USB0 to connect USB devices, you need to set USB0 to HOST mode. The method is as follows:'''"
......
|}
</ol>
<ol start="9" style="list-style-type: decimal;">
<li><p>When debugging u-boot code, you can use the following method to update u-boot in the linux image for testing</p>
<ol style="list-style-type: lower-alpha;">
<li>Run First upload the following command compiled deb package of u-boot to set USB0 to HOST mode:the Linux system of the development board.</li><{| class="wikitable" style="width:800px;" |-| test@test:~/orangepi-build$ '''cd output/debs/ol>u-boot'''
[[File:zero2w-img279.png]]</ol><ol start="26" style="list-style-type: lower-alpha;"><li>Run Press the Enter key again to start updating u-boot. After the update is completed, the following command to switch back to Device modeinformation will be displayed.</li></ol>
[[File:zero2w-img275.png]]</devol><ol start="5" style="list-style-type: decimal;"><li>Then select the branch type of the kernel source code</video0li>
::[[File:zero2w-img336img276.png]]</ol><ol start="6" style="list-style-type: decimal;"><li>If you choose to display the kernel configuration menu (the second option) in step 3), the kernel configuration interface opened through '''make menuconfig''' will pop up. At this time, you can directly modify the kernel configuration. After modification, save and exit. Yes, compilation of the kernel source code will begin after exiting.</li>
[[File:zero2w-img284.png]]
</ol>
</ol>
<ol start="7" style="list-style-type: decimal;">
<li>Then double-click to open <p>Part of the USB camera APP and you can see information prompted when compiling the output video next branch kernel source code is explained as follows:</p><ol style="list-style-type: lower-alpha;"><li>Version of the USB camera.linux kernel source code</li>{| class="wikitable" style="width:800px;" |-| [ o.k. ] Compiling current kernel [ '''6.1.31''' ]|}</ol> <span idol start="android2" style="list-systemstyle-roottype: lower-descriptionalpha;"><li>The version of the cross-compilation tool chain used</spanli>{| class="wikitable" style= Android system ROOT description =="width:800px;" |-| [ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 11''' ]|}</ol><ol start="3" style="list-style-type: lower-alpha;"><li>The Android system released default configuration file used by Orange Pi has been ROOT the kernel and can be tested using the following methodpath where it is stored are as follows</li>{| class="wikitable" style="width:800px;" |-| [ o.k. ] Using kernel config file [ '''orangepi-build/external/config/kernel/linux-6.1-sun50iw9-next.config''']|}</ol><ol start="4" style="list-style-type: lower-alpha;"># Download from <li>The path to the kernel-related deb package generated by compilation</li>{| class="wikitable" style="width:800px;" |-| [ o.k. ] Target directory [ '''official tooloutput/debs/''' on ]|}</ol><ol start="5" style="list-style-type: lower-alpha;"><li>The package name of the development board data download page kernel image deb package generated by compilation</li>{| class="wikitable" style="width:800px;" |-| [ o.k. ] File name [ '''rootchecklinux-image-next-sun50iw9_x.x.x_arm64.apkdeb''']|}<div class/ol><ol start="6" style="figurelist-style-type: lower-alpha;"><li>Compilation time</li>[[File{| class="wikitable" style="width:zero2w800px;" |-img336| [ o.k.png]Runtime [ '''10 min''' ]|}</divol><div classol start="7" style="figurelist-style-type: lower-alpha;"><li>Finally, the compilation command to repeatedly compile the last selected kernel will be displayed. Use the following command without selecting through the graphical interface, and you can directly start compiling the kernel source code.</li>[[File{| class="wikitable" style="width:zero2w800px;" |-img339| [ o.k.png]Repeat Build Options [ '''sudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=kernel KERNEL_CONFIGURE=no''' ]|}</divol></li></ol><ol start="28" style="list-style-type: decimal;"><li><p>Then make sure that View the adb connection between the Ubuntu PC and the development board is normal. For how to use adb, please refer to the instructions in the section "kernel-related deb package generated by compilation</p><ol style="list-style-type: lower-alpha;"><li><p>'''How to use ADBlinux-dtb-next-sun50iw9_x.x.x_arm64.deb'''".Contains dtb files used by the kernel</p></li><li><p>Then use the adb command to install rootcheck'''linux-headers-next-sun50iw9_x.apk into the Android systemx. Of course, you can also use a USB disk copy to install itx_arm64.deb''' Contains kernel header files</p></li><li><p>'''linux-image-next-sun50iw9_x.x.x_arm64.deb''' Contains kernel images and kernel modules</olp></li>{| class="wikitable" style="width:800px;" |-| test@test:~/orangepi-build$ '''ls output/debs/linux-*'''
'''linux-image-next-sun50iw9_x.x.x_arm64.deb root@192.168.1.xxx:/root'''|}</ol ><ol start="2" style="list-style-type: decimallower-alpha;"><li><p>First, please make sure that both Install the development board and deb package of the mobile phone are connected to the same WIFI hotspotnew linux kernel just uploaded. For the method of connecting the development board to WIFI, please refer to </li>{| class="wikitable" style="width:800px;" |-| orangepi@orangepi:~$ '''the instructions in the WIsudo dpkg -i linux-image-next-FI connection methodsun50iw9_x.x.x_arm64.deb'''|}</pol></liol start="3" style="list-style-type: lower-alpha;"><li><p>Then open the '''MiracastReceiver'''application in the Android system of restart the development boardand check whether the kernel-related modifications have taken effect.</pli><p>[[File{| class="wikitable" style="width:zero2w800px;" |-img343.png]]| orangepi@orangepi:~$ '''sudo''' '''reboot'''|}</pol></li><li><p>The interface after '''MiracastReceiver''' is opened is as follows</pol><div classspan id="figurecompile-rootfs"></span>
[[File:zero2w-img349img276.png]]</ol></li></ol><ol start="5" style="list-style-type: decimal;"><li>Then select the type of rootfs</li>
<span id/div></ol></li></ol><ol start="7" style="pin-interface-gpio-uartlist-spistyle-testtype: decimal;"></spanli>== 40pin interface GPIOIf you are compiling the server version of the image, UARTyou can also choose to compile the Standard version or the Minimal version. The Minimal version will have much less pre-installed software than the Standard version ('''please do not choose the Minimal version without special needs, SPI test ==because many things are not pre-installed by default. Some functions may not be available''')</li>
[[File:zero2w-img351img289.png]]
[[File:zero2w-img291.png]]</ol><ol start="39" style="list-style-type: decimal;"><li>The GPIO test interface is as shown in <p>Then the figure belowcompilation of rootfs will start. The two rows Some of '''CheckBox''' buttons on the left have a oneinformation prompted during compilation are as follows:</p><ol style="list-tostyle-one correspondence with the 40pin pinstype: lower-alpha;"><li>Type of rootfs</li>{| class="wikitable" style="width:800px;" |-| [ o.k. When the ] local not found [ Creating new rootfs cache for '''CheckBoxbullseye''' button is checked, ]|}</ol><ol start="2" style="list-style-type: lower-alpha;"><li>The storage path of the corresponding GPIO pin will be set to compiled rootfs compressed package</li>{| class="wikitable" style="width:800px;" |-| [ o.k. ] Target directory [ '''OUTorangepi-build/external/cache/rootfs''' mode and the pin level is set to high level]|}</ol><ol start="3" style="list-style-type: lower-alpha; when unchecked, "><li>The name of the GPIO pin level will be set to low levelrootfs compressed package generated by compilation</li>{| class="wikitable" style="width:800px; when the GPIO is clicked When you click the " |-| [ o.k. ] File name [ '''GPIO READALL''' button, you can get information such as wPi number, GPIO mode, pin level, etcbullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.; when you click thelz4'''BLINK ALL GPIO''' button, all GPIO ports will cycle through outputting high and low levels. This function can be used to test all the 40pin pins. GPIO port.]|}</ol></li></ol> [[File:zero2w-img353.png]] <ol start="410" style="list-style-type: decimal;"><li>Then click <p>View the compiled rootfs compressed package</p><ol style="list-style-type: lower-alpha;"><li>'''GPIO READALLbullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4''' button, and It is a compressed package of rootfs. The meaning of each field in the output information name is as shown below:</li></ol>
bullseye-xfce-arm64.5250ec7002de9e81a41de169f1f89721.tar.lz4.list|}</ol></li></ol><ol start="711" style="list-style-type: decimal;"><li>Click If the required rootfs already exists under '''CheckBoxexternal/cache/rootfs''' button in , then compiling the picture below rootfs again to uncheck it, will directly skip the compilation process and pin 12 will be set to low levelnot restart the compilation. After settingWhen compiling the image, you can use a multimeter it will also go to measure the voltage value of the pin. If it is '''0vexternal/cache/rootfs'''to check whether it already exists. There is a cached rootfs available. If it is available, use it means the low level setting is successfuldirectly. This can save a lot of download and compilation time.</li></ol>
|-
| '''269'''| [ o.k. ] Done building [ '''PI13output/images/orangepizero2w_x.x.x_debian_bullseye_linux6.1.xx_xfce_desktop/orangepizero2w_x.x.x_debian_bullseye_linux6.1.xx_xfce_desktop.img''']| '''PWM3'''}| '''7'''|| '''8'''</ol>| '''UART0_TX'''<ol start="2" style="list-style-type: lower-alpha;">| '''PH0'''<li>Compilation time</li>{| '''224'''class="wikitable" style="width:800px;"
|-
| '''[ o.k. ] Runtime [ 19 min ]'''|}</ol><ol start="3" style="textlist-style-aligntype: leftlower-alpha;"|><li>Repeat the command to compile the image. Use the following command to start compiling the image directly without selecting it through the graphical interface.</li>{| class="wikitable" style="text-alignwidth: left800px;"|-| [ o.k. ] Repeat Build Options [ '''GNDsudo ./build.sh BOARD=orangepizero2w BRANCH=next BUILD_OPT=image RELEASE=bullseye BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes''']| }</ol></li></ol><span id="instructions-for-using-the-orange-pi-os-arch-system"></span> = '''9Instructions for using the Orange Pi OS Arch system'''=|| '''10'''<span id="orange-pi-os-arch-system-function-adaptation-status"></span>| '''UART0_RX'''== Orange Pi OS Arch system function adaptation status ==| '''PH1'''{| '''225'''class="wikitable" style="width:800px;text-align: center;"
|-
| '''226Motherboard functions'''| '''PH2'''| '''UART5_TX'''| '''11'''|| '''12'''| style="text-align: left;"|| '''PI1'''| '''257OPi OS Arch'''
|-
| '''227HDMI video'''| '''PH3OK'''| '''UART5_RX'''| '''13'''|| '''14'''| '''GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''261HDMI Audio'''| '''PI5'''| '''UART2_TX'''| '''15'''|| '''16'''| '''PWM4'''| '''PI14'''| '''270OK'''
|-
|-
| '''231TF Card Startup'''| '''PH7OK'''| '''SPI1_MOSI'''| '''19'''|| '''20'''| '''GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''232WIFI'''| '''PH8'''| '''SPI1_MISO'''| '''21'''|| '''22'''| '''UART2_RX'''| '''PI6'''| '''262OK'''
|-
| '''230Bluetooth'''| '''PH6'''| '''SPI1_CLK'''| '''23'''|| '''24'''| '''SPI1_CS0'''| '''PH5'''| '''229OK'''
|-
|-
| '''26640pin GPIO'''| '''PI10'''| '''TWI2-SDA'''| '''27'''|| '''28'''| '''TWI2-SCL'''| '''PI9'''| '''265OK'''
|-
| '''25640pin I2C'''| '''PI0OK'''| style="text-align: left;"|| '''2940pin SPI'''|| '''30''OK'| '''GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''27140pin UART'''| '''PI15'''| style="text-align: left;"|| '''31'''|| '''32'''| '''PWM1'''| '''PI11'''| '''267OK'''
|-
| '''26840pin PWM'''| '''PI12OK'''| '''PWM2'''| '''33'''|| '''34'''| '''GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''258Temperature Sensor'''| '''PI2'''| style="text-align: left;"|| '''35'''|| '''36'''| style="text-align: left;"|| '''PC12'''| '''76OK'''
|-
| '''272Hardware watchdog'''| '''PI16'''| style="text-align: left;"|| '''37'''|| '''38'''| style="text-align: left;"|| '''PI4'''| '''260OK'''
|-
|}
<ol start="4" style="list-style-type: decimallower-alpha;"><li>Then click <p>After burning the system, when you start it for the '''UART_TEST'''button to open first time and enter the UART test interfacedesktop, you will see the user wizard program shown in the figure below.</lip></oldiv class="figure">
[[File:zero2w-img359img293.png]]
<ol start="5" style="list-style-type: decimal;"/div></li><li>The serial port test interface of wiringOP is as shown in <p>First you need to select the figure belowlanguage you want</lip></oldiv class="figure">
[[File:zero2w-img360img294.png]]
[[File:zero2w-img362img295.png]] </div></li><li><p>Then select the area</p><div class="figure"> [[File:zero2w-img296.png]] </div></li><li><p>Then select the keyboard model</p><div class="figure"> [[File:zero2w-img297.png]] </div></li><li><p>Then create a new username and set a password</p><div class="figure"> [[File:zero2w-img298.png]] </div></li><li><p>Then make sure there is no problem with the selection, and then click the install '''button'''</p><div class="figure"> [[File:zero2w-img299.png]] </div></li><li><p>Then wait for the installation to complete</p><div class="figure"> [[File:zero2w-img300.png]] </div></li><li><p>After the installation is complete, you need to click the '''Finish''' button to restart the system.</p><div class="figure"> [[File:zero2w-img301.png]] </div></li><li><p>The Orange Pi Hello program will automatically start after restarting. At this time, you need to remove the check '''mark of Start on startup''' in the lower right corner, otherwise you need to manually close the Orange Pi Hello program every time you start it.</p><div class="figure">
<ol startspan id="10" style="listhow-to-set-styledt-type: decimal;overlays"><li>If everything is normal, the received string will be displayed in the receiving box</li></olspan>== How to set DT overlays ==
# As can be seen from First open the table below, the spi available for the 40pin interface is spi1, and there are two chip select pins cs0 and cs1'''/boot/extlinux/extlinux.conf''' configuration file
::{| class="wikitable" style="width:800px;"
|-
| '''GPIO serial number'''| [orangepi@orangepi-pc ~]$ '''GPIOsudo vim /boot/extlinux/extlinux.conf'''| '''Function'''}| '''pin'''|<ol start="2" style="list-style-type: decimal;">| <li>Then open the corresponding configuration by adding '''pinFDTOVERLAYS'''| '''Function/dtbs/allwinner/overlay/xxx.dtbo'''| in '''GPIO/boot/extlinux/extlinux.conf'''</li> {| '''GPIO serial number'''class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
|-
| [orangepi@orangepi-pc ~]$ '''264sudo vim /boot/extlinux/extlinux.conf'''| '''PI8'''| '''TWI1LABEL Orange Pi KERNEL /Image FDT /dtbs/allwinner/sun50i-h616-orangepi-SDA'''zero2w.dtb | '''3FDTOVERLAYS /dtbs/allwinner/overlay/<span style="color:#FF0000">xxx.dtbo</span>'''#Configuration that needs to be added|}| '''4'''</ol>| '''5V'''| <ol start="3" style="textlist-style-aligntype: leftdecimal;"|><li><p>The storage path of xxx.dtbo in the OPi OS Arch image is as follows. Please note that not all dtbo under this path can be used.</p>{| class="wikitable" style="text-alignwidth: left800px;"|
|-
| '''263'''| <p>'''PI7/boot/dtbs/allwinner/overlay/'''</p>| '''TWI1-SCL'''}| '''5'''</li>|<li><p>The DT overlays configuration that can be used by the development board is as follows</p></li>| '''6'''| '''GND'''{| styleclass="text-align: left;wikitable"|| style="width:800px;text-align: leftcenter;"|
|-
| '''269Functions on the development board'''| '''PI13'''| '''PWM3'''| '''7'''|| '''8'''| '''UART0_TX'''| '''PH0'''| '''224Corresponding DT overlays configuration'''
|-
|-
| '''22640pin - i2c1'''| '''PH2'''| '''UART5_TX'''| '''11'''|| '''12'''| style="textsun50i-h616-pi-align: left;"|| '''PI1'''| '''257i2c1.dtbo'''
|-
| '''22740pin - i2c2'''| '''PH3'''| '''UART5_RX'''| '''13'''|| '''14''sun50i-h616-pi-i2c2.dtbo'| '''GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''26140pin - uart2'''| '''PI5'''| '''UART2_TX'''| '''15'''|| '''16'''| '''PWM4'''| '''PI14'''| '''270sun50i-h616-pi-uart2.dtbo'''
|-
|-
| '''23140pin - uart4'''| '''PH7sun50i-h616-pi-uart4.dtbo'''| '''SPI1_MOSI'''-| '''1940pin - uart5'''|| '''20sun50i-h616-ph-uart5.dtbo'''| '''GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''23240pin - pwm1'''| '''PH8'''| '''SPI1_MISO'''| '''21'''|| '''22'''| '''UART2_RX'''| '''PI6'''| '''262sun50i-h616-pi-pwm1.dtbo'''
|-
| '''23040pin - pwm2'''| '''PH6'''| '''SPI1_CLK'''| '''23'''|| '''24'''| '''SPI1_CS0'''| '''PH5'''| '''229sun50i-h616-pi-pwm2.dtbo'''
|-
|-
| '''26640pin - pwm4'''| '''PI10'''| '''TWI2sun50i-h616-SDA'''| '''27'''|| '''28'''| '''TWI2pi-SCL'''| '''PI9'''| '''265pwm4.dtbo'''
|-
| '''25640pin - spi1 cs0'''| '''PI0sun50i-h616-spi1-cs0-spidev.dtbo'''| style="text-align: left;"|| '''2940pin - spi1 cs1'''|| '''30sun50i-h616-spi1-cs1-spidev.dtbo'''|-| '''GND40pin - spi1 cs0 cs1'''| style="text'''sun50i-h616-spi1-align: left;"|| style="textcs0-cs1-align: left;"|spidev.dtbo'''
|-
| '''271设Set USB0 to Host mode'''| '''PI15'''| style="textsun50i-h616-usb0-align: left;"|| '''31'''|| '''32'''| '''PWM1'''| '''PI11'''| '''267host.dtbo'''
|-
| '''268Turn off the green LED light'''| '''PI12'''| '''PWM2'''| '''33'''|| '''34''sun50i-h616-zero2w-disable-led.dtbo'| '''GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''258How to close the UART0 debugging serial port'''| '''PI2'''| style="textsun50i-h616-align: left;"|| '''35'''|| '''36'''| style="textdisable-align: left;"|| '''PC12'''| '''76uart0.dtbo'''
|}
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>If you need to open multiple configurations at the same time, just add the paths of multiple configurations directly after '''FDTOVERLAYS.''' For example, the configuration of opening i2c1 and uart5 at the same time is as follows</li>
{| class="wikitable" style="width:800px;"
|-
|
[orangepi@orangepi-pc ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''
'''FDTOVERLAYS <span style="color:#FF0000">/dtbs/allwinner/overlay/sun50i-h616-pi-i2c1.dtbo /dtbs/allwinner/overlay/sun50i-h616-ph-uart5.dtbo</span>'''|}</ol><ol start="36" style="list-style-type: decimal;"><li>Here is a demonstration After setting, you need to test restart the SPI1 interface through system for the '''w25qxx''' module. First, connect the w25qxx module configuration to the SPI1 interfacetake effect.</li></ol>{| class="wikitable" style="width:800px;" |-| [orangepi@orangepi-pc ~]$ '''It doesn't matter if there is no w25qxx module, because there is a SPIFlash on the development board connected to SPI0, and the configuration of SPI0 is also turned on by default in Android, so we can also directly use the onboard SPIFlash for testing.sudo reboot'''|}</ol start><span id="4" style="listhow-to-styleinstall-type: decimal;software"><li>Then open wiringOP APP on the desktop</li></olspan>
{| class="wikitable" style="width:800px;" |-| [[File:zero2worangepi@orangepi-img365.png]pc ~]$ '''sudo pacman -Syy vim'''|}
<ol startspan id="6" style="listandroid-12-tv-system-styleusage-type: decimal;instructions"><li><p>Then select the spi device node in the upper left corner. If you test the onboard SPIFlash directly, just keep the default '''/dev/spidev0.0'''. If the '''w25qxx''' module is connected to the 40pin spi1 cs0, then please select'''/dev/spidev1.0''', if the w25qxx module is connected to the 40pin spi1 cs1, then please select '''/dev/spidev1.1'''</p><div class="figure"span>
</divspan id="supported-android-versions"></lispan><li><p>Then click the '''OPEN''' button to initialize the SPI</p></li></ol>== Supported Android versions ==
<ol startspan id="8" style="listandroid-12-tv-function-styleadaptation-type: decimal;status"><li>Then fill in the bytes that need to be sent, such as reading the ID information of the onboard SPIFlash, filling in the address 0x9f in data[0], and then click the '''TRANSFER''' button</li></olspan>== Android 12 TV function adaptation status ==
|-
| '''GPIO serial numberMotherboard functions'''| '''GPIO'''| '''Function'''| '''pin'''|| '''pin'''| '''Function'''| '''GPIO'''| '''GPIO serial numberAndroid12 TV'''
|-
|-
| '''264'''| '''PI8'''| '''TWI1Type-SDA'''| '''3C USB2.0 x 2'''|| '''4OK'''| '''5V'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''263TF card startup'''| '''PI7OK'''| '''TWI1-SCL'''| '''5'''|| '''6'''| '''GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''269WIFI'''| '''PI13'''| '''PWM3'''| '''7'''|| '''8'''| '''UART0_TX'''| '''PH0'''| '''224OK'''
|-
|-
| '''226USB Camera'''| '''PH2'''| '''UART5_TX'''| '''11'''|| '''12'''| style="text-align: left;"|| '''PI1'''| '''257OK'''
|-
| '''227LED Light'''| '''PH3OK'''| '''UART5_RX'''| '''13'''|| '''14'''| '''GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''26140pin GPIO'''| '''PI5'''| '''UART2_TX'''| '''15'''|| '''16'''| '''PWM4'''| '''PI14'''| '''270OK'''
|-
|-
| '''23140pin SPI1'''| '''PH7OK'''| '''SPI1_MOSI'''| '''19'''|| '''20'''| '''GND'''| style="text-align: left;"|| style="text-align: left;"|
|-
| '''23240pin UART'''| '''PH8'''| '''SPI1_MISO'''| '''21'''|| '''22'''| '''UART2_RX'''| '''PI6'''| '''262OK'''
|-
| '''23040pin PWM'''| '''PH6OK'''| '''SPI1_CLK'''| '''23'''|| '''24'''| '''SPI1_CS0'''-| '''PH5Temperature Sensor'''| '''229OK'''
|-
|-
| '''266Mali GPU'''| '''PI10'''| '''TWI2-SDA'''| '''27'''|| '''28'''| '''TWI2-SCL'''| '''PI9'''| '''265OK'''
|-
| '''256Video codec'''| '''PI0OK'''| style="text-align: left;"|| '''29'''}|{| '''30'''| '''GND'''| styleclass="text-align: left;wikitable"|| style="width:800px;text-align: leftcenter;"|
|-
| '''27124pin Expansion board function'''| '''PI15'''| style="text-align: left;"|| '''31'''|| '''32'''| '''PWM1'''| '''PI11'''| '''267Android12 TV'''
|-
| '''268100M network port'''| '''PI12OK'''|-| '''PWM2100M Ethernet port light'''| '''33OK'''|-| '''34USB2.0 HOST x 2'''| '''GNDOK'''| style="text-align: left;"|'''Infrared reception'''| '''OK'''| style="text-align: left;"|'''Headphone audio playback'''| '''OK'''
|-
| '''258On/off button'''| '''PI2'''| style="text-align: left;"|| '''35'''|| '''36'''| style="text-align: left;"|| '''PC12'''| '''76OK'''
|-
| '''272LRADC'''| '''PI16'''| style="text-align: left;"|| '''37'''|| '''38'''| style="text-align: left;"|| '''PI4Custom buttons x 2'''| '''260OK, The default setting is the volume up and down keys.'''
|-
|}
<ol startspan id="2" style="listonboard-styleled-type: decimal;"><li>The device node corresponding to i2c1 is '''/dev/i2clight-1''', and the device node corresponding to i2c2 is '''/dev/i2cdisplay-2'''</liinstructions"></olspan>== Onboard LED light display instructions ==
<ol startspan id="4" style="listhow-to-return-to-the-previous-interface-stylein-type: decimal;android"><li/span>Then click the '''I2C_TEST''' button == How to return to open the i2c test previous interface</li></ol>in Android ==
[[File:zero2w-img371img303.png]]
<ol startspan id="6" style="listhow-to-styleuse-type: decimal;adb"><li/span>Then click the device node selection box in the upper left corner == How to select the i2c you want to test</li></ol>use ADB ==
apollo-p2:/ # '''start adbd'''|}</ol><ol start="3" style="list-style-type: decimal;"><li>Install adb tool on Ubuntu PC</li>{| class="wikitable" style="width:800px;"
|-
| '''GPIO serial number'''| test@test:~$ '''GPIOsudo apt-get update'''| '''Function'''| test@test:~$ '''pinsudo apt-get install -y adb'''|}| '''pin'''</ol>| '''Function'''<ol start="4" style="list-style-type: decimal;">| '''GPIO'''<li>Then connect network adb on Ubuntu PC</li>{| '''GPIO serial number'''class="wikitable" style="width:800px;"
|-
|-
| test@test:~$ '''264adb shell''' apollo-p2:/ #| '''PI8'''}</ol>| '''TWI1<span id="use-data-cable-to-connect-adb-SDA'''debugging"></span> === Use data cable to connect adb debugging === | '''3'# Prepare a USB Type C interface data cable, plug one end of the USB interface into the USB interface of the computer, and plug one end of the USB Type C interface into the USB0 interface of the development board (see the description of the picture on the right below for the location of USB0). In this case, the development board is powered by the computer's USB interface, so please ensure that the computer's USB interface can provide the most sufficient power to drive the development board.|| '''4'''::[[File:zero2w-img304.png]] [[File:zero2w-img305.png]]| '''5V'''| <ol start="2" style="textlist-alignstyle-type: leftdecimal;"|><li>Install adb tool on Ubuntu PC</li>{| class="wikitable" style="text-alignwidth: left800px;"|
|-
| test@test:~$ '''263sudo apt-get update'''| '''PI7'''| test@test:~$ '''TWI1sudo apt-SCLget install -y adb'''| '''5'''}|</ol>| '''6'''| '''GND'''| <ol start="3" style="textlist-style-aligntype: leftdecimal;"|><li>Check whether the ADB device is recognized</li>{| class="wikitable" style="text-alignwidth: left800px;"|
|-
| test@test:~$ '''269adb devices'''| '''PI13'''| '''PWM3'''List of devices attached | '''7'''4c00146473c28651dd0 device|}| '''8'''</ol>| '''UART0_TX'''<ol start="4" style="list-style-type: decimal;">| '''PH0'''<li>Then you can log in to the android system through adb shell on Ubuntu PC</li>{| '''224'''class="wikitable" style="width:800px;"
|-
| styletest@test:~$ '''adb shell''' apollo-p2:/ $|}</ol><span id="textview-how-to-set-hdmi-display-align: left;resolution"|></span> == View how to set HDMI display resolution == | <ol style="textlist-style-aligntype: leftdecimal;"|>| <li><p>Enter first '''GNDSettings'''</p><p>[[File:zero2w-img306.png]]</p></li>| <li><p>Then select '''9Device Preferences'''</p>|<p>[[File:zero2w-img307.png]]</p></li>| <li><p>Then select '''10Display & Sound'''</p><p>[[File:zero2w-img308.png]]</p></li>| <li><p>Then select '''UART0_RXAdvanced display settings'''</p><p>[[File:zero2w-img309.png]]</p></li>| <li><p>Then select '''PH1HDMI output mode'''</p><p>[[File:zero2w-img310.png]]</p></li><li><p>Then you can see the list of resolutions supported by the monitor. At this time, clicking the corresponding option will switch to the corresponding resolution. Please note that different monitors may support different resolutions. If you connect it to a TV, you will generally see more resolution options than the picture below.</p><p>[[File:zero2w-img311.png]]</p></li><li><p>The HDMI output of the development board supports 4K display. When connected to a 4K TV, you can see the 4K resolution option.</p><p>[[File:zero2w-img312.png]]</p></li></ol> <span id="hdmi-to-vga-display-test-1"></span>=== HDMI to VGA display test === <ol style="list-style-type: decimal;"><li><p>First you need to prepare the following accessories</p><ol style="list-style-type: lower-alpha;"><li>HDMI to VGA converter</li> [[File:zero2w-img144.png]]</ol><ol start="2" style="list-style-type: lower-alpha;"><li>A VGA cable and a Mini HDMI male to HDMI female adapter</li> [[File:zero2w-img145.png]] [[File:zero2w-img146.png]]</ol><ol start="3" style="list-style-type: lower-alpha;"><li>A monitor or TV that supports VGA interface</li></ol></li></ol> <ol start="2" style="list-style-type: decimal;"><li>HDMI to VGA display test is as follows</li> [[File:zero2w-img313.png]] {| '''225'''class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
| '''226'''| <big>'''PH2When using HDMI to VGA display, the development board and the Android system of the development board do not need to make any settings. You only need the Mini HDMI interface of the development board to display normally. So if there is a problem with the test, please check whether there is a problem with the HDMI to VGA converter, VGA cable and monitor.'''</big>| '''UART5_TX'''}| '''11'''</ol>|| '''12'''| style<span id="textwi-fi-connection-align: left;method"|| '''PI1'''></span>| '''257'''|== WI-FI connection method ==| '''227'''| '''PH3'''| # Choose first '''UART5_RXSettings'''| '''13'''|| '''14'''::[[File:zero2w-img306.png]]| '''GND'''| style<ol start="text-align: left;2"|| style="textlist-alignstyle-type: leftdecimal;"|>|-| <li>Then select '''261Network & Internet'''</li>| '''PI5'''| '''UART2_TX'''[[File:zero2w-img314.png]]| '''15'''</ol>|<ol start="3" style="list-style-type: decimal;">| '''16'''<li>Then turn on WI-FI</li>| '''PWM4'''| '''PI14'''[[File:zero2w-img315.png]]| '''270'''|-</ol>| style<ol start="text-align: left;4"|| style="textlist-style-aligntype: leftdecimal;"|>| <li>After turning on WI-FI, you can see the searched signals under '''3.3VAvailable networks'''.</li>| '''17'''|[[File:zero2w-img316.png]]| '''18'''</ol>| <ol start="5" style="textlist-style-aligntype: leftdecimal;"|>| '''PH4'''| '''228'''|<li>After selecting the WI-FI you want to connect to, the password input interface shown below will pop up.</li>| '''231'''| '''PH7'''<div class="figure">| '''SPI1_MOSI'''| '''19'''|[[File:zero2w-img317.png]]| '''20'''| '''GND'''</div></ol>| style<ol start="text-align: left;6"|| style="textlist-alignstyle-type: leftdecimal;"|>|<li>Then use the keyboard to enter the password corresponding to the WI-FI, and then use the mouse to click the Enter button on the virtual keyboard to start connecting to the WI-FI.</li>| '''232'''| '''PH8'''<div class="figure">| '''SPI1_MISO'''| '''21'''[[File:zero2w-img318.png]]|| '''22'''</div></ol>| '''UART2_RX'''<ol start="7" style="list-style-type: decimal;">| '''PI6'''<li>The display after successful WI-FI connection is as shown below</li>| '''262'''|[[File:zero2w-img319.png]]| '''230'''</ol>| '''PH6'''| '''SPI1_CLK'''<span id="how-to-use-wi-fi-hotspot"></span>| '''23'''|== How to use WI-FI hotspot ==| '''24'''| '''SPI1_CS0'''# First, please make sure that the Ethernet port is connected to the network cable and can access the Internet normally.| # Then select '''PH5Settings'''| '''229'''|::[[File:zero2w-img306.png]] | style<ol start="text-align: left;3"|| style="textlist-style-aligntype: leftdecimal;"|>| <li>Then select '''GND'''| '''25Network & Internet'''</li>|| '''26'''[[File:zero2w-img314.png]]| '''SPI1_CS1'''</ol>| '''PH9'''| '''233'''|<ol start="4" style="list-style-type: decimal;">| <li>Then select '''266WIFI hotspot'''</li>| '''PI10'''| '''TWI2[[File:zero2w-SDA'''| '''27'''img320.png]]|</ol>| '''28'''| '''TWI2<ol start="5" style="list-style-SCL'''type: decimal;">| <li>Then open '''PI9Hotspot Enable'''. You can also see the name and password of the generated hotspot in the picture below. Remember them and use them when connecting to the hotspot (if you need to modify the name and password of the hotspot, you need to close Hotspot Enable first. Then you can modify it)</li>| '''265'''|[[File:zero2w-img321.png]]| '''256'''| '''PI0'''</ol>| <ol start="6" style="textlist-style-aligntype: leftdecimal;"|>| <li>At this time, you can take out your mobile phone. If everything is normal, you can find the WIFI hotspot with the same name ('''29here AndroidAP_7132'''|| ) shown under the '''30Hotspot name'''| in the picture above in the WI-FI list searched by the mobile phone. Then you can click AndroidAP_7132 to connect to the hotspot. The password can be seen under the '''GNDHotspot password'''in the picture above.</li> [[File:zero2w-img322.png]]</ol>| style<ol start="text-align: left;7"|| style="textlist-style-aligntype: leftdecimal;"|>|-| <li>After the connection is successful, it will be displayed as shown below (the interface will be different on different mobile phones, the specific interface is subject to the one displayed on your mobile phone). At this time, you can open a web page on your mobile phone to see if you can access the Internet. If the web page can be opened normally, it means that the '''271WI-FI Hotspot'''of the development board can be used normally.</li>| '''PI15'''| style[[File:zero2w-img323.png]]</ol><span id="texthow-to-check-the-ip-address-of-the-ethernet-align: left;port"|></span>| '''31'''|== How to check the IP address of the Ethernet port ==| '''32'''| '''PWM1'''# There is no wired network interface on the main board of the development board. We can expand the 100M Ethernet through a 24pin expansion board.| '''PI11'''| '''267'''|::[[File:zero2w-img107.png]]| '''268'''| '''PI12'''| '''PWM2'''| '''33'''|| '''34'''| '''GND'''| style<ol start="text-align: left;2"|| style="textlist-style-aligntype: leftdecimal;"|>|-<li><p>Then make sure the network port of the expansion board is connected to the router or switch</p></li>| <li><p>Then open '''258Settings'''</p><p>[[File:zero2w-img324.png]]</p></li>| <li><p>Then select '''PI2Network & Internet'''</p><p>[[File:zero2w-img325.png]]</p></li>| style<li><p>Then you can see the IP address of the development board's wired network port at the location shown in the picture below.</p><p>[[File:zero2w-img326.png]]</p></li></ol> <span id="textbluetooth-connection-align: left;method"|></span> == Bluetooth connection method == | # Choose first '''35Settings'''|| '''36'''::[[File:zero2w-img306.png]] | <ol start="2" style="textlist-style-aligntype: leftdecimal;"|>| <li>Then select '''PC12Bluetooth'''</li>| '''76'''|[[File:zero2w-img327.png]]| '''272'''</ol>| '''PI16'''| <ol start="3" style="textlist-style-aligntype: leftdecimal;"|>| <li>Then Open '''37Bluetooth Enable'''</li> |[[File:zero2w-img328.png]]| '''38'''</ol>| <ol start="4" style="textlist-style-aligntype: leftdecimal;"|>| <li>Then click '''PI4Pair new device'''to start scanning for surrounding Bluetooth devices</li>| '''260'''|[[File:zero2w-img329.png]]</ol>| style<ol start="text-align: left;5"|| style="textlist-style-aligntype: leftdecimal;"|>| <li>The searched Bluetooth devices will be displayed under '''GNDAvailable devices'''</li>| '''39'''|[[File:zero2w-img330.png]]| '''40'''</ol>| <ol start="6" style="textlist-style-aligntype: leftdecimal;"|>| ''<li>Then click on the Bluetooth device you want to connect to start pairing. When the following interface pops up, please use the mouse to select the 'PI3''Pair'| '''259'''|}option</li>
[[File:zero2w-img331.png]]</ol><ol start="27" style="list-style-type: decimal;"><li>First click What is tested here is the Bluetooth configuration process between the development board and the Android phone. At this time, the wiringOP icon following confirmation interface will pop up on the phone. Click the pairing button on the phone to open wiringOP APPstart the pairing process.</li></ol>
[[File:zero2w-img351img332.png]]</ol><ol start="8" style="list-style-type: decimal;"><li>After pairing is completed, open '''Paired devices''' and you will see the paired Bluetooth devices.</li>
[[File:zero2w-img333.png]]</ol><ol start="39" style="list-style-type: decimal;"><li>Then At this time, you can use the Bluetooth of your mobile phone to send a picture to the development board. After sending, you can see the following confirmation interface in the Android system of the development board, and then click the '''PWM_TESTAccept''' button on to start receiving the main interface of wiringOP to enter pictures sent by the PWM test interfacemobile phone.</li></ol>
[[File:zero2w-img380img334.png]]</ol><ol start="10" style="list-style-type: decimal;"><li>Pictures received by the Bluetooth system of the development board Android system can be viewed in '''Received files'''.</li>
[[File:zero2w-img335.png]]</ol start><span id="4" style="listhow-to-set-usb0-to-host-stylemode-type: decimal;1"><li>The PWM test interface is as follows</li></olspan>
usb_host|}</ol start><span id="9" style="listhow-to-use-styleusb-type: decimal;camera"><li>Then use an oscilloscope to measure the corresponding pins in the 40pin development board and you can see the following waveform.</li></olspan>
::{| class= "wikitable" style="width:800px;" |-| console:/ # '''How to compile Android 12 source codels /dev/video0''' =
<ol start="3" style="list-style-type: decimal;"><li><p>First download Then make sure that the compressed package of adb connection between the Android 12 source code Ubuntu PC and the compressed package of development board is normal. For how to use adb, please refer to the files modified by instructions in the section "[[Orange Pi Zero2w from Google Cloud DriveZero 2W#How to use ADB|'''How to use ADB''']]".</p><ol style="list-style-type: lower-alpha;"/li><li>Google Cloud Drive</lip>Download the USB camera test APP from the '''official tool''' on the development board information download page</olp></li></ol>
[[File:zero2w-img338.png]]</ol><ol start="7" style="list-style-type: decimal;"><li>Then double-click to open the USB camera APP and you can see the output video of the USB camera.....</li></ol>
<ol startspan id="3" style="listandroid-system-styleroot-type: decimal;description"><li>Then you need to merge multiple compressed files into one, and then extract the Android source code. The command looks like this:</li></olspan>
</div><ol start="2" style="list-style-type: decimal;"><li><p>Then make sure that the adb connection between the Ubuntu PC and the development board is normal. For how to use adb, please refer to the instructions in the section "[[Orange Pi Zero 2W#How to use ADB|'''How to use ADB''']]".</p></li><li><p>Then use the adb command to install rootcheck.apk into the Android system. Of course, you can also use a USB disk copy to install it.</p></li>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''cp -rf opizero2w_android12_patchesadb install rootcheck.apk'''|}</* H618ol><ol start="4" style="list-Android12style-Srctype: decimal;"><li>After installation, you can see the startup icon of the ROOT test tool on the Android desktop.</'''li>
[[File:zero2w-img340.png]]<span id/ol><ol start="compile-the5" style="list-sourcestyle-code-of-android-12type: decimal;"><li>The display interface after opening the '''ROOT test tool''' for the first time is as shown below</spanli>== Compile the source code of Android 12 ==
[[File:zero2w-img341.png]]</ol><ol start="6" style="list-style-type: decimal;"><li>Then you can click '''CHECK NOW'''Android12 is compiled on an x86_64 computer with Ubuntu 22.04 installed. Other versions to start checking the ROOT status of Ubuntu the Android system package dependencies may have some differences. The image download address of After the check is completed, the Ubuntu 22.04 amd64 version display is as follows:'''. You can see that the Android system has obtained ROOT permissions.</li>
[https[File://repozero2w-img342.huaweicloud.compng]]</ubuntuol><span id="how-to-use-miracastreceiver-to-cast-releases/22.04/ubuntuthe-22.04.2mobile-desktopphone-amd64.iso '''https://repo.huaweicloud.com/ubuntuscreen-releases/22.04/ubuntuto-22.04.2the-desktopdevelopment-amd64.iso''']board"></span>
</div></ol><ol start="5" style="list-style-type: decimal;"><li>There are a total of 28 GPIO ports available in the 40-pin development board. perf1The following takes pin 12 - corresponding to GPIO PI01 - corresponding to wPi serial number 6 - as an example to demonstrate how to set the high and low levels of the GPIO port. First click the '''CheckBox''' button corresponding to pin 12. When the button is selected, pin 12 will be set to high level. After setting, you can use a multimeter to measure the value of the voltage of the pin. If it is '''3.3v''', it means the setting High level success.</li>
[[File:zero2w-img355.png]]</ol><ol start="6" style="list-style-type: decimal;"><li>Then click the '''GPIO READALL''' button and you can see that the current pin 12 mode is '''OUT''' and the pin level is high level. perf2</li>
[[File:zero2w-img356.png]]</ol><ol start="7" style="list-style-type: decimal;"><li>Click the '''CheckBox''' button in the picture below again to uncheck it, and pin 12 will be set to low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is '''0v''', it means the low level setting is successful. perf3</li>
[[File:zero2w-img357.png]]</ol><ol start="8" style="list-style-type: decimal;"><li>Then click the '''GPIO READALL''' button and you can see that the current pin 12 mode is OUT and the pin level is low level. qa</li>
Opios-arch-aarch64-xfce-opizero2w-23.09-linux6.1.31.img.xz