Enter the following command to view the temperature data returned by the chip-in-chip sensor on the BPI-M4 Berry.
sensorsCopy.
When using Ubuntu&Debian desktop operating system, you can find the display bar in the settings and modify the resolution.
ubuntu desktop.
Debian Desktop.
Prepare a USB flash drive that has been partitioned normally and insert the USB port of the BPI-M4 BERRY.
In Ubuntu desktop version, you can see that the USB flash drive has been recognized, can be opened in the file manager, or can be managed by the gparted tool.
In the terminal, mount the USB flash drive to the local directory
mkdir mnt #create a separate directory in the ~/user directory for mounting for easy managementcat /proc/partitions | grep "sd*" #list partitions starting with sdsudo mount /dev/sda1 ~/mnt/ #mount /dev/sda1 to ~/mnt/ls ~/mnt/ #after mounting, you can list the files in the usb disksudo umount -v /dev/sda1 #umount, then you can remove the usb diskCopy.
Prepare an audio file and copy it to the BPI-M4 Berry Ubuntu desktop system via USB flash drive or SSH.
Prepare a monitor with HDMI audio input, turn on the relevant functions in the monitor settings, and connect the monitor with an HDMI cable.
Set the output device to HDMI audio in the sound bar of the settings.
*Audio.
Have headphones ready for other use3For audio devices with 5mm plugs, insert the plug into the BPI-M4 Berry 35mm jack.
Set the output device as the audio codec in the sound bar of the settings.
*Audio.
aplay -l #list devicesaplay -d hw:0,0 [path] #play the audio file of the specified pathCopy.
Open Settings in the Ubuntu desktop and connect a Bluetooth device, such as a Bluetooth mouse or keyboard, in the Bluetooth bar.
Here's how to connect a Bluetooth device via the command line in the terminal:
pi@bpi-m4berry:~$sudo bluetoothctl #open the bluetooth device management tool[sudo] password for pi:agent registered[chg] controller 2c:c3:e6:ac:d5:d8 pairable: yes[bluetooth]# power on #start the bluetooth function, power off to turn it offchanging power on succeeded[bluetooth]# discoverable on #allow this device to be discoveredchanging discoverable on succeeded[chg] controller 2c:c3:e6:ac:d5:d8 discoverable: yes[bluetooth]# pairable on #allow device pairingchanging pairable on succeeded[bluetooth]# scan on #start scanningdiscovery started[chg] controller 2c:c3:e6:ac:d5:d8 discovering: yes[new] device d4:c4:85:a5:c6:b1 logitech pebble #the mac address and device name of a bluetooth mouse[chg] device d4:c4:85:a5:c6:b1 txpower: 4[bluetooth]# pair d4:c4:85:a5:c6:b1 #pair the mac address of the bluetooth device you want to connect toattempting to pair with d4:c4:85:a5:c6:b1[chg] device d4:c4:85:a5:c6:b1 connected: yes[del] device a4:c1:38:9b:f6:fd slpo20n20200059[chg] device d4:c4:85:a5:c6:b1 uuids: 00001800-0000-1000-8000-00805f9b34fb[chg] device d4:c4:85:a5:c6:b1 uuids: 00001801-0000-1000-8000-00805f9b34fb[chg] device d4:c4:85:a5:c6:b1 uuids: 0000180a-0000-1000-8000-00805f9b34fb[chg] device d4:c4:85:a5:c6:b1 uuids: 0000180f-0000-1000-8000-00805f9b34fb[chg] device d4:c4:85:a5:c6:b1 uuids: 00001812-0000-1000-8000-00805f9b34fb[chg] device d4:c4:85:a5:c6:b1 uuids: 00010000-0000-1000-8000-011f2000046d[chg] device d4:c4:85:a5:c6:b1 servicesresolved: yes[chg] device d4:c4:85:a5:c6:b1 paired: yespairing successful #pairing successfully[chg] device d4:c4:85:a5:c6:b1 modalias: usb:v046dpb021d0007[bluetooth]# exit #exit the bluetooth device management toolpi@bpi-m4berry:~$Copy.
Archlinux Bluetooth reference documentation.
You need to prepare an IR remote control in NEC format.
Enter the following command in the terminal to start receiving infrared signals.
sudo ir-keytable -c -p nec -told keytable clearedprotocols changed to nectesting events. please, press ctrl-c to abort.258.553895: lirc protocol(nec): scancode = 0x45258.553926: event type ev_msc(0x04): scancode = 0x45258.553926: event type ev_syn(0x00).260.667648: lirc protocol(nec): scancode = 0x46260.667671: event type ev_msc(0x04): scancode = 0x46260.667671: event type ev_syn(0x00).260.719552: lirc protocol(nec): scancode = 0x46 repeat260.719568: event type ev_msc(0x04): scancode = 0x46260.719568: event type ev_syn(0x00).273.263728: lirc protocol(nec): scancode = 0x47273.263753: event type ev_msc(0x04): scancode = 0x47273.263753: event type ev_syn(0x00).273.315591: lirc protocol(nec): scancode = 0x47 repeat273.315608: event type ev_msc(0x04): scancode = 0x47273.315608: event type ev_syn(0x00).Copy.
For details about other commands and how to use them, see the ir-keytable documentation.
The SCP (Secure Replication) command in Linux is used to copy files between servers in a secure manner.
The scp command, or secure replication, allows files to be securely transferred between a local host and a remote host, or between two remote hosts.
It uses the same authentication and security used in the Secure Shell (SSH) protocol.
You can copy files from a Windows terminal to a Linux system on the same LAN. Just make sure that the Open SSH client is turned on and can be viewed in Settings > Applications > Optional Features.
If you want to copy files from Windows to Linux, you also need to enable the Open SSH server.
The SCP command format is:
scp [optionals] file_source file_targetCopy.
optionals
is an optional parameter, such as -r, that can be used to recursively copy the entire directory.
file source The file or directory to be replicated.
If a specific file name is entered last, File Target will copy the past path and rename it.
Take copying local files from Windows to Linux as an example. In Windows Terminal, enter:
ps d:\temp\temp_4> scp ".\hello.txt" [email protected]:"/home/pi/downloads/"Copy.
You can also copy files from your Linux system to your local computer in Windows Terminal
ps d:\temp\temp_4> scp [email protected]:"/home/pi/downloads/hello.txt" "d:\temp\temp_4"Copy.
pi@192 of them168.3.12 is the username of the Linux system and the IP address of the BPI-M4 Berry in the LAN.
:"/home/pi/downloads/hello.txt"
The file path on the Linux system is **.
"d:\temp\temp_4"
The path in the Windows system is **.
SCP reference documentation.
Files can be managed through a graphical interface using mobaxterm or other similar software.
mobaxterm **
mobaxterm-linux preview.
As shown in the figure below, after establishing an SSH connection in MobaxTerm, a file management window will appear on the left side of the interface, which supports copying and pasting files by dragging and dropping them.
GNU Nano is a text editor for operating environments like UNIX-like computing systems or using a command-line interface.
It is easier to use than vim and suitable for beginners.
In general, you can finish editing, saving, and exiting the editor in the following order:
nano [file path]
Edit the file. Ctrl+O provides a write file ("Save As").
Edit the file path or name, and then press Enter
Ctrl+X exits nano
nano shortcuts.
Documentation. sudo nano "/boot/bananapienv.txt"
, rewrittenbootlogo=true
forbootlogo=false
Press the keyboard shortcut Ctrl+O to write the file.
You don't need to change the path, press Enter to save.
Press the keyboard shortcut Ctrl+X to exit the nano.
reboot
, the launch logo will not be displayed.
sudo nano "/boot/bananapienv.txt"
, rewrittenbootlogo=false
forbootlogo=true
The boot logo file can be stored in the following path:/usr/share/plymouth/themes/bananapi/watermark.png
Prepare onepng
image, preferably a pattern with a transparent layer, and rename itwatermark.png
/home/pi/watermark.png
Copy it to the path using any method you like.
Copy it to the destination path with root privileges.
sudo cp "/home/pi/watermark.png" "/usr/share/plymouth/themes/bananapi/watermark.png"Copy.
Use this command to apply the changes and wait for tens of seconds for the build to complete.
sudo update-initramfs -uCopy.
reboot
, you will see that the boot logo has been changed to the image you replaced.
Control the GPIO port to light up the LED light.
Set the high and low levels of GPIO
The following is a demonstration of the use of 7 pins.
Plug in the LED light and you can see that it doesn't light up.
Execute.
gpio mode 2 outCopy.
Set it to output mode.
Execute.
gpio write 2 1Copy.
You can see that the LED light is already on.
Execute.
gpio write 2 0Copy.
You can see that the LED light is turned off.