Difference between revisions of "Template:FriendlyCoreS5Pxx18"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
 
(2 intermediate revisions by the same user not shown)
Line 65: Line 65:
 
your board may be it does not support this feature.
 
your board may be it does not support this feature.
  
===Transfer files using Bluetooth===
+
===Installing and Using OpenCV 4.1.2===
Take the example of transferring files to the mobile phone. First, set your mobile phone Bluetooth to detectable status, then execute the following command to start Bluetooth search.:<br />
+
OpenCV has been pre-installed in FriendlyCore (Version after 20191126) and does not require manual installation.<br />
 +
Please refre this link: https://github.com/friendlyarm/install-opencv-on-friendlycore/blob/s5pxx18/README.md
 +
<br>
 +
Quick test:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
hcitool scan
+
. /usr/bin/cv-env.sh
 +
. /usr/bin/setqt5env-eglfs
 +
cd /usr/local/share/opencv4/samples/python
 +
python3 turing.py
 
</syntaxhighlight>
 
</syntaxhighlight>
<br />
+
 
Search results look like:<br />
+
===Installing and Using Caffe===
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Scanning ...
+
git clone https://github.com/friendlyarm/install-caffe-on-friendlycore
    2C:8A:72:1D:46:02  HTC6525LVW
+
cd install-caffe-on-friendlycore
</syntaxhighlight>
+
sudo ./install-caffe.sh
This means that a mobile phone named HTC6525LVW is searched. We write down the MAC address in front of the phone name, and then use the sdptool command to view the Bluetooth service supported by the phone:<br />
+
<syntaxhighlight lang="bash">
+
sdptool browser 2C:8A:72:1D:46:02
+
</syntaxhighlight>
+
Note: Please replace the MAC address in the above command with the actual Bluetooth MAC address of the mobile phone.<br />
+
This command will detail the protocols supported by Bluetooth for mobile phones. What we need to care about is a file transfer service called OBEX Object Push. Take the HTC6525LVW mobile phone as an example. The results are as follows:<br />
+
<syntaxhighlight lang="bash">
+
Service Name: OBEX Object Push
+
Service RecHandle: 0x1000b
+
Service Class ID List:
+
  "OBEX Object Push" (0x1105)
+
Protocol Descriptor List:
+
  "L2CAP" (0x0100)
+
  "RFCOMM" (0x0003)
+
    Channel: 12
+
  "OBEX" (0x0008)
+
Profile Descriptor List:
+
  "OBEX Object Push" (0x1105)
+
    Version: 0x0100
+
</syntaxhighlight>
+
As can be seen from the above information, the channel used by the OBEX Object Push service of this mobile phone is 12, we need to pass it to the obexftp command, and finally the command to initiate the file transfer request is as follows:
+
<syntaxhighlight lang="bash">
+
obexftp --nopath --noconn --uuid none --bluetooth -b 2C:8A:72:1D:46:02 -B 12 -put example.jpg
+
</syntaxhighlight>
+
Note: Please replace the MAC address, channel and file name in the above command with the actual one.<br /><br />
+
After executing the above commands, please pay attention to the screen of the mobile phone. The mobile phone will pop up a prompt for pairing and receiving files. After confirming, the file transfer will start.<br />
+
<br />
+
Bluetooth FAQ:<br />
+
1) Bluetooth device not found on the development board, try to open Bluetooth with the following command:<br />
+
<syntaxhighlight lang="bash">
+
rfkill unblock 0
+
</syntaxhighlight>
+
2) Prompt can not find the relevant command, you can try to install related software with the following command:<br />
+
<syntaxhighlight lang="bash">
+
apt-get install bluetooth bluez obexftp openobex-apps python-gobject ussp-push
+
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 11:20, 27 November 2019

1 Run Qt 5.10.0 Demo with GPU acceleration

Run the following command

$ sudo qt5demo

S5pxx18-QtE

2 Run Qt 5.10.0 Demo with OpenGL

Run the following command

. setqt5env
cd $QTDIR
cd /examples/opengl/qopenglwidget
./qopenglwidget

For more Qt 5.10.0 examples, please go to:
cd $QTDIR/examples/

3 Play HD Video with Hardware-decoding

gst-player is console player, it base on GStreamer, support VPU with Hardware-decoding:

sudo gst-player /home/pi/demo.mp4

The equivalent gsteamer command is as follows:

sudo gst-launch-1.0 filesrc location=/home/pi/demo.mp4 ! qtdemux name=demux demux. ! queue ! faad ! audioconvert ! audioresample ! alsasink device="hw:0,DEV=1" demux. ! queue ! h264parse ! nxvideodec ! nxvideosink dst-x=0 dst-y=93 dst-w=1280 dst-h=533

4 Connect to DVP Camera CAM500B

The CAM500B camera module is a 5M-pixel camera with DVP interface. For more tech details about it you can refer to Matrix - CAM500B.
Enter the following command to preview the video:

gst-launch-1.0 -e v4l2src device=/dev/video6 ! video/x-raw,format=I420,framerate=30/1,width=1280,height=720 ! nxvideosink

Enter the following command to start recording (VPU hardware encoding):

gst-launch-1.0 -e v4l2src device=/dev/video6 ! video/x-raw,format=I420,framerate=30/1,width=1280,height=720 ! tee name=t t. \
 ! queue ! nxvideosink t. ! queue ! nxvideoenc bitrate=12000000 ! mp4mux ! \
 filesink location=result_720.mp4

5 Power Off and Schedule Power On

“PMU Power Management” feature helps us to auto power on the board at a specific time, it is implemented by an MCU, support software power-off, and RTC alarm power-up functions.

Here’s a simple guide:
Turn on automatically after 100 seconds. (Time must be greater than 60 seconds.):

$ sudo echo 100 > /sys/class/i2c-dev/i2c-3/device/3-002d/wakealarm

After setting up the automatic boot, turn off board with the 'poweroff’ command:

$ sudo poweroff

Cancel automatic boot:

$ sudo echo 0 > /sys/class/i2c-dev/i2c-3/device/3-002d/wakealarm

Query the current settings, in the front is current time, followed by the time of automatic booting: If no automatic boot is set, it will display "disabled”.

$ sudo cat /sys/class/i2c-dev/i2c-3/device/3-002d/wakealarm


Note that some older versions of hardware may not support this feature, if you don't see this file node in your system:
/sys/class/i2c-dev/i2c-3/device/3-002d/wakealarm
your board may be it does not support this feature.

6 Installing and Using OpenCV 4.1.2

OpenCV has been pre-installed in FriendlyCore (Version after 20191126) and does not require manual installation.
Please refre this link: https://github.com/friendlyarm/install-opencv-on-friendlycore/blob/s5pxx18/README.md
Quick test:

. /usr/bin/cv-env.sh
. /usr/bin/setqt5env-eglfs
cd /usr/local/share/opencv4/samples/python
python3 turing.py

7 Installing and Using Caffe

git clone https://github.com/friendlyarm/install-caffe-on-friendlycore
cd install-caffe-on-friendlycore
sudo ./install-caffe.sh