-
Guide to Porting and Configuring Nginx on OKMX6ULx Embedded Linux (Kernel 4.1.15)
5 days ago • 0 commentsNginx (engine x) is an open-source, high-performance Web server, reverse proxy server, load balancer, and HTTP cache server. It is characterized by low memory usage and strong concurrency ability. In fact, Nginx performs well in terms of concurrency among web servers of the same type. It is developed using the C programming language.
Nginx is specifically developed for performance optimization. Performance is an important consideration in its design. It focuses highly on efficiency in implementation and can withstand high-load tests, supporting up to 50,000 concurrent connections.
1. Compilation and Porting
1.1 Compile nginx-1.8 in Yocto
Execute the following commands for compilation:
$ DISTRO=fsl-imx-x11 MACHINE=imx6ull14x14evk source fsl-setup-release.sh -b build_x11 $ bitbake nginx
During the compilation process, the following errors appeared:
Solution:
Modify the build_x11/conf/bblayers.conf file and add the source code path of Nginx to the file. build_x11 is the installation and compilation path defined by yourself.
Modify the content as follows:
After adding, execute bitbake nginx again for compilation.
1.2 Package the Image
After compilation, go to the
build_x11/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/nginx/1.8.1-r0/image
path to package the image.
$ cd tmp/work/cortexa7hf-neon-poky-linux-gnueabi/nginx/1.8.1-r0/image $ tar -cjvf nginx-1.8.1.tar.bz2 *
1.3 Transplant
Extract the image packaged in the previous step to the root path of the system.
tar -xvf nginx-1.8.1.tar.bz2 -C /
2. Test
2.1 Reverse Proxy
2.1.1 Tomcat Installation
① Install the JDK environment
Download address: Oracle JDK 8 Downloads
Download the following two files:
jdk-8u151-linux-arm32-vfp-hflt.tar.gz
and
jdk-8u151-linux-arm32-vfp-hflt-demos.tar.gz
Extract them to the development board:
Extract the above two compressed packages to /home/root/jdk1.8.0_151.
Modify the environment variables:
Add the following content at the end of the /etc/profile file:
JAVA_HOME=/home/root/jdk1.8.0_151 CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar PATH=$JAVA_HOME/bin:$PATH export JAVA_HOME CLASSPATH PATH
Execute the following command to make the environment variables take effect immediately:
$ source /etc/profile
Verify whether the installation is successful:
Enter the following command to check the Java version:
$ java -version
② Install Tomcat
Download the source code: Tomcat 9.0 Downloads. Here, download version 9.0.108.
Extract the downloaded
apache-tomcat-9.0.108.tar.gz
to the
/home/root
path on the development board.
tar -xvf apache-tomcat-9.0.108.tar.gz -C /home/root
Start the Tomcat service:
cd /home/root/apache-tomcat-9.0.108/bin ./startup.sh
After starting, enter 192.168.1.13:8080 in the browser, and the Tomcat interface will be displayed.
2.1.2 Modify Nginx Configuration
Modify the /etc/nginx/nginx.conf file:
server { listen 80; server_name www.123.com; location / { proxy_pass http://192.168.1.13:8080/; index index.html index.htm; } }- listen: It indicates that the port 80 is monitored.
- server_name: The access domain name is defined here.
- proxy_pass: It is a proxy forwarding module. Its main function is to forward www.123.com requests to http://192.168.1.13:8080/.
Start the Nginx service:
mkdir /run/nginx nginx -c /etc/nginx/nginx.conf
Modify the hosts file in Windows:
Press Win + S, run Notepad as an administrator, open the hosts file under C:\Windows\System32\drivers\etc, and add the mapping.
Test:
Enter www.123.com in the browser, and you can access the Tomcat interface via Nginx.
2.2 Load Balancing
1. Setup Service 8080:
Rename the above-mentioned apache-tomcat to apache-tomcat8080, and create a test file:
mv apache-tomcat-9.0.108/ apache-tomcat8080/ cd apache-tomcat8080/webapps mkdir test vi test.html
<!--apache8080--> <html> <body>welcome to service 8080</body> </html>
2. Setup...
Read more » -
Guide to TFTP Flashing the File System on Forlinx Embedded RK3568 Development Board
5 days ago • 0 commentsThe test is conducted using the standard development environment of Linux 4.19.206 on the OK3568-C development board, which is equipped with the Rockchip RK3568 processor. It has a stable network foundation and can meet the transmission requirements of the TFTP protocol. During the testing, the TFTP server was deployed on the Ubuntu system. Ubuntu and the RK3568 development board were configured in the bridge mode (by leveraging the hardware advantage of the dual network interfaces on the development board, the network transmission latency can be reduced). The server address was set to 172.16.0.177.
Make sure to place the system images (boot.img and rootfs.img) in the TFTP server directory beforehand. Additionally, verify that there is a proper network connection between the development board and the server, as this is essential for the process to run smoothly.
Forlinx RK3568 SoM
1. Configuring U-Boot Environment Variables for Network Access
The Uboot environment configuration of the RK3568 development board is simple and intuitive. Coupled with the on-board Type - C Debug interface (which integrates a USB - to - serial chip, eliminating the need for an additional adapter), developers can quickly enter the Uboot command line through terminal tools (such as SecureCRT and Xshell) to complete the network parameter configuration.
Operation tips: The default baud rate of the Type - C Debug interface is 115200bps, with 8 data bits, 1 stop bit, and no parity check. After connecting, restart the development board to enter the Uboot command line.
=> setenv ethaddr 22:51:a2:cc:47:2d # Set the Ethernet MAC address of the development board to ensure a unique network identity => setenv ipaddr 172.16.0.176 # Configure the static IP of the development board, which should be in the same network segment as the server => setenv gatewayip 172.16.0.218 # Set the gateway address to ensure cross - network segment communication (if needed) => setenv netmask 255.255.0.0 # Configure the subnet mask to match the LAN network segment planning => saveenv # Save the environment variables to the eMMC to prevent data loss after restart Saving Environment to ENV_BLK… Saving Environment to ENV_BLK... Writing to mmc(0)... done # Verify network connectivity: first ping the real machine, then ping the Ubuntu server => ping 172.16.0.77 # Test the network connectivity between the development board and the real machine ethernet@fe2a0000 Waiting for PHY auto negotiation to complete. done Using ethernet@fe2a0000 device host 172.16.0.77 is alive => ping 172.16.0.177 # Crucial step: verify the connectivity with the TFTP server (if it fails, check the VMware bridge mode or the network cable connection of the development board) Using ethernet@fe2a0000 device host 172.16.0.177 is alive => setenv serverip 172.16.0.177 # Specify the IP of the TFTP server, and subsequent transmissions will default to this address => saveenv Saving Environment to ENV_BLK... Writing to mmc(0)... done
Note: If pinging the server fails, you need to prioritize the following checks:
- Whether the VMware network is set to ''Bridge mode'';
- Whether the network cable connection of the development board is normal (it is recommended to use Category 5e or better network cables);
- Whether the TFTP port (default port 69) is blocked by the server firewall.
2. Querying the eMMC Partition Table
The Forlinx Embedded RK3568 development board offers multiple eMMC storage options of 8/16/32/64GB. In this test, the standard Linux partition plan is adopted. The complete partition structure can be viewed through the mmc part command to clarify the target partitions for the boot.img (boot image) and rootfs.img (file system image).
= > MMC part # List the partition table for eMMC device 0 (Partition Type: EFI) Partition Map for MMC device 0 -- Partition Type: EFI Part Start LBA End LBA Name Attributes Type GUID Partition GUID 1 0x00004000 0x00005fff "uboot" 0x00000000 0a100000-... b7030000-......
Read more » -
One-click to Achieve Local TTS! Full Process of Deploying Piper Text-to-Speech Tool on OKMX8MP Development Board
12/10/2025 at 05:28 • 0 commentsIn IoT and edge computing projects, the demand for offline and localized text-to-speech (TTS) functionality is increasing. Piper, a fast and open-source neural network TTS engine, perfectly meets this demand.
Today, step by step instructions will be provided to deploy Piper on the Forlinx Embedded OKMX8MP development board and achieve high-quality local voice synthesis. This tutorial includes complete steps, code examples, and troubleshooting for common issues to help you get started easily!
Preparation
Required Files
piper_bin.tar (about 22.6 MB)
Piper executable files and core dependent libraries (e.g., libonnxruntime, libespeak-ng).
piper-voices_cut.tar (about 114.4 MB)
Trimmed Chinese and English voiceprint model libraries.
Development Environment
Forlinx OKMX8MP development board (with Linux system flashed).
Terminal access to the development board via SSH or serial port.
Tools for file transfer (e.g., USB drive, SCP).
Detailed Deployment Steps
Step 1: Deploy Piper Executable Files
1. Copy files to the development board
Copy piper_ok.tar to any directory on the development board (take /root as an example): # Assume the file has been copied to /run/media/sda1 via USB drive root@OK8MP:~# cp /run/media/sda1/piper_ok.tar ./ root@OK8MP:~# sync
2. Extract the files
Enter the working directory and extract the files. The -m parameterpreserves the file modification time.
root@OK8MP:~# tar -xvf piper_ok.tar -m
After extraction, the directory structure of piper is as follows:
piper/ ├── piper # Core executable file ├── lib*.so* # All dynamic link libraries required for running ├── espeak-ng-data/ # Voice data └── *.ort # ONNX-related model files
3. Perform a preliminary test
Try to run the piper program directly:
root@OK8MP:~/piper# ./piper # Expected error output: "Model file doesn't exist"
Note: It's normal to get an error at this point because no voiceprint models have been specified yet. This verifies that the program itself can run.
Step 2: Deploy the Voiceprint Model Library
1. Extract the voiceprint library
Extract piper-voices_cut.tar to the /opt directory, a common locationfor optional software.
root@OK8MP:/opt# tar -xvf /path/to/piper-voices_cut.tar -m
After extraction, you'll get Chinese voiceprint model files, forexample:
/opt/piper-voices_cut/medium_zh/zh_CN-huayan-medium.onnx.
2. Create a Chinese test text
Create a text file named zh_test.txt and write the content to beconverted.
# Use the cat command to quickly create a file root@OK8MP:~/piper# cat > zh_test.txt << EOF Welcome to use Forlinx Embedded OKMX8MP development board: This is a text-to-speech local test. EOF
Note: Ensure that the text file uses UTF-8 encoding to avoid Chinesecharacter garbling.
Step 3: Run Text-to-Speech and Play
1. Execute the conversion command
In the piper directory, execute the following command to convert thetext to an audio file zh_audio.mp3.
root@OK8MP:~/piper# ./piper \ -m /opt/piper-voices_cut/medium_zh/zh_CN-huayan-medium.onnx \ --output_file zh_audio.mp3 < zh_test.txt
Parameter description:
Successful output example:
[piper] [info] Loaded voice in 1.99 second(s) [piper] [info] Real-time factor: 0.61 (infer=1.72 sec, audio=2.82 sec) [piper] [info] Terminated piper
-m: Specify the voiceprint model file to be used.
--output_file: Specify the name of the output audio file.
< zh_test.txt: Redirect the input text from the file.
2. Play the audio file
Use the gst - play - 1.0 tool to play the generated audio.
root@OK8MP:~/piper# gst-play-1.0 ./zh_audio.mp3
Common Questions and Solutions (Q&A)
Question 1:
Error message: ''Model file doesn't exist''
Solution: Check if the path of the voiceprint model after the -m parameter is correct. Ensure that piper - voices_cut.tar has been successfully extracted to the /opt directory and the file permissions are normal.
Question 2:
Unable to directly input Chinese on the command - line or garbled characters...
Read more »
Lutetium
Rui Santos
Thane Hunt
Max.K
Michiel Spithoven
Radu Motisan
dev-lab
Stephane
CNLohr
1BarConnection
Xylitol
Alex M Sunny
AVR
Makerfabs
Adrian Prinz
Holotype Robotics