Evaluation Sharing丨Feiling Embedded OK3399-C Development Board + RK1808 Artificial Intelligence Computing Stick (Active Mode)

1.   Hardware platform

Platform: OK3399- C

System: Desktop

Module: TB- RK1808 S0

Environmental preparation:

Feiling OK3399-C development board, rk1808 artificial intelligence computing stick (firmware version is V1.3.4), usb camera, camera and computing stick are all inserted into OK3399-C development board.

Use the lsusb command to view, as follows (the red box 2207:0018 is the RK1808 artificial intelligence computing stick):

Enter the command as follows:

 

 

2.  Overview

AI computing is divided into four different quadrants, namely cloud training, cloud inference, edge training, and edge inference. Among them, terminal reasoning is almost all focused on the Arm architecture ecology. AI neural network calculations can currently be completed by CPU, GPU, DSP, NPU, FAGA, etc., but different hardware characteristics will lead to differences in efficiency and power consumption. Among them, NPU-embedded neural network processor adopts "data-driven parallel computing" architecture, and is best at processing massive multimedia data such as videos and images, and has lower power consumption than GPUs. Our company has launched the OK3399-C Desktop+RK1808 (including 3Tops computing power NPU) combination, which greatly reduces power consumption while meeting AI edge computing.

RK1808 Compute Stick has two modes: active mode and passive mode. In active mode, RK1808 artificial intelligence computing stick is a dedicated AI application module. RK1808 artificial intelligence computing stick is used as an active device. rknn-toolkit and rknn-api are installed by default inside the RK1808 artificial intelligence computing stick. The upper computer (also called host) does not need to install rknn-toolkit and rknn-api. The model and algorithm are fixed in RK1808 In the artificial intelligence computing stick, OK3399-C inputs data (such as pictures and video streams) to the computing stick through the USB port. The RK1808 artificial intelligence computing stick automatically completes the pre-processing, inference, and post-processing of the data, and then outputs the processing results through the USB port Give OK3399-C.

In order to facilitate users to transfer data through the USB port, the RK1808 artificial intelligence computing stick will virtualize the USB port into a standard device such as a network card. Users only need to operate the standard device interface (such as network socket programming) to complete the RK1808 artificial intelligence computing stick. Data input and output.

Details as follow:

        1. After the RK1808 Compute Stick is inserted into the host computer, it will be virtualized as a network card device

        2. The host computer OK3399-C configures the virtual network card, and configures the IP as 192.168.180.1 to ensure that the network connection between the host computer and 1808 is normal

        3. The default IP of the computing stick is 192.168.180.8, and the account password is toybrick. The user can log in to the computing stick through SSH, and copy the model and server service program to the computing stick.

        4. The computing stick runs the server service program to receive the connection request from the upper computer, and calls RKNN for processing, and then returns the result

        5. The host computer runs the client program and after successfully connecting to the server, it sends a reasoning request and obtains the return result from the 1808 end

 

 

3.  Compute stick network  configuration and network  sharing  configuration

1.  Compute stick network  configuration

The host computer uses OK3399-C Forlinx Desktop system, click the network button in the lower right corner to select the "Edit Connections..." option in the pop-up window:

 

Select the wired network node generated by the usb network card of the computing stick:

 

Configure the node in manual mode, set IP: 192.168.180.1, subnet mask: 255.255.255.0, and save:

 

Enter the ifconfig command in the terminal to view the network node configuration as follows, it can be seen that the USB network card configuration is complete:

 

Ping the 1808 computing stick network 192.168.180.8, the following networks can be connected:

 

Use ssh to log in to the 1808 Compute Stick. The user name and password are both toybrick by default. The login is successful as follows:

 

2. Network  sharing  configuration

  Run ifconfig, you can see the host network cards such as e th0 and wlan0, which we use to access the external network, enx10dcb69f022c is the USB network card (RK1808 artificial intelligence computing stick virtual network card). Different system network card names may be different, the actual network card name shall prevail.

 

First, configure the host network so that the host can connect to the Ethernet. Here we use the wlan0 node to access the Internet. The specific configuration will not be repeated.

The command line executes the following commands, among which enx10dcb69f022c needs to be modified to the user's local actual value; under normal circumstances, it only needs to be set once. If the network card name has been changed or the user manually deletes the network card, it needs to be reset.

1. sudo nmcli connection add con-name toybrick type ethernet ifname enx10dcb69f022c autoconnect yes ip4 192.168.180.1/24

To configure the NAT function, execute the following commands, in which eno1 needs to be modified to the user's local actual value; shutdown is invalid, so it must be reset every time the computer restarts.

1. sudo sysctl   -w net.ipv4.ip_forward=1

sudo iptable -F

sudo iptables -t nat -F

sudo  iptables  -t  nat  -A POSTROUTING -o wlan0 -j MASQUERADE

Note:  The actual port connected to your own development board shall prevail, for example: eth0

The iptables command is partially interpreted as follows:

iptables --help

--flush   -F [chain]Delete all rules in  chain or all chains 

--table       -t tabletable to manipulate (default: `filter') 

--append  -A chainAppend to chain 

--jump -j targettarget for rule (may load target extension) 

 

MASQUERAD  , address masquerading, is a special case of snat, which can realize automatic snat

SNAT is the abbreviation of source network address translation, that is, source address to destination translation. For example, multiple PCs use an ADSL router to share the Internet, and each PC is configured with an internal network IP. When the PC accesses the external network, the router replaces the source address in the packet header with the router's ip. When a server such as a website web server receives an access request, his log records the ip address of the router, not the intranet ip of the PC. This is because the "" in the header of the packet received by this server "Source address" has been replaced, so it is called SNAT, address translation based on the source address.

DNAT is the abbreviation of destination networkaddress translation, that is, target network address translation. A typical application is that a web server is placed on the internal network to configure the internal network ip, and there is a firewall at the front end to configure the public network ip, and visitors on the Internet use the public network ip To visit this website, when visiting, the client sends out a data packet. In the header of this data packet, the target address is written as the firewall's public network ip. The firewall will rewrite the header of the data packet once and rewrite the target address. It becomes the intranet ip of the web server, and then sends the data packet to the web server on the intranet. In this way, the data packet penetrates the firewall and changes from the public network ip to an access to the intranet address. Namely DNAT, target-based network address translation.

Related products: Feiling Embedded OK3399-C Development Board: https://www.forlinx.com/product/100.html

Guess you like

Origin blog.csdn.net/ningmengzier/article/details/107664794