3038 views|3 replies

187

Posts

0

Resources
The OP
 

RK3399 Science Section丨OK3399-C Development Board + RK1808 AI Compute Stick (Active Mode) [Copy link]

1. Hardware Platform

Platform: OK3399 -C

System: Desktop

Module: TB- RK1808 S0

Environmental preparation:

< class="p" style="border:0px"> Feiling OK3399-C development board , rk1808 artificial intelligence computing stick (firmware version is V1.3.4), USB camera, the camera and computing stick are both inserted into the OK3399-C development board.

< class="p" style="border:0px">Use the lsusb command to view as follows (the red frame 2207:0018 is the RK1808 AI computing stick):

< class="p" style="border:0px">Enter the command as follows:

< class="p" style="border:0px">

II. Overview

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

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

< class="p" style="border:0px">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 input and output of the RK1808 artificial intelligence computing stick data.

< class="p" style="border:0px">Details are as follows:

< class="p" style="border:0px"> 1. After the RK1808 computing stick is inserted into the host computer, it will be virtualized into a network card device

< class="p" style="border:0px"> 2. Configure the virtual network card on the host computer OK3399-C and set the IP address to 192.168.180.1 to ensure that the network connection between the host computer and 1808 is normal

< class="p" style="border:0px"> 3. The default IP of the computing stick is 192.168.180.8, and the account and password are both toybrick. Users can log in to the computing stick through SSH and copy the model and server service program to the computing stick

< class="p" style="border:0px"> 4. The computing stick runs the server service program to receive the connection request from the host computer, call RKNN for processing, and then return the result

< class="p" style="border:0px"> 5. The host computer runs the client program, connects to the server successfully, sends an inference request, and obtains the return result from the 1808 terminal

< class="p" style="border:0px">

< class="p" style="border:0px">

< class="p" style="border:0px">

< class="p" style="border:0px">

3. Compute Stick Network Configuration and Network Sharing Configuration

1. Compute stick network configuration

< class="p" style="border:0px">Use the OK3399-C Forlinx Desktop system on the host computer. Click the network button in the lower right corner and select the "Edit Connections..." option in the pop-up window:

< class="p" style="border:0px">

< class="p" style="border:0px">

< class="p" style="border:0px">

< class="p" style="border:0px">Select the wired network node generated by the USB network card of the computing stick:

< class="p" style="border:0px">

< class="p" style="border:0px">

< class="p" style="border:0px">Configure the node to manual mode, set IP: 192.168.180.1, subnet mask: 255.255.255.0, and save:

< class="p" style="border:0px">

< class="p" style="border:0px">

< class="p" style="border:0px">Enter the ifconfig command in the terminal to view the network node configuration as follows, and you can see that the USB network card configuration is complete:

< class="p" style="border:0px">

< class="p" style="border:0px">

< class="p" style="border:0px">Ping the 1808 Compute Stick network 192.168.180.8, the following networks can be connected:

< class="p" style="border:0px">

< class="p" style="border:0px">

< class="p" style="border:0px">Use ssh to log in to the 1808 computing stick. The default username and password are both toybrick. The following is a successful login:

< class="p" style="border:0px">

< class="p" style="border:0px">

2. Network sharing configuration

< class="p" style="border:0px"> Run ifconfig, you can see the host network cards such as eth0 and wlan0, which we use to access the external network. enx10dcb69f022c is a USB network card (RK1808 artificial intelligence computing stick virtual network card). The network card names of different systems may be different, so please refer to the actual network card name.

< class="p" style="border:0px">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 here.

< class="p" style="border:0px">Execute the following command on the command line, where enx10dcb69f022c needs to be changed to the actual value of the user's local area. Normally, it only needs to be set once. If the network card name is changed when the device is plugged in or the user manually deletes the network card, it needs to be reset.

< class="p" style="border:0px">1. sudo nmcli connection add con-name toybrick type ethernet ifname enx10dcb69f022c autoconnect yes ip4 192.168.180.1/24

< class="p" style="border:0px">Configure the NAT function and execute the following command. eno1 needs to be changed to the actual value of the user's local computer. It will become invalid when the computer is shut down, so it needs to be reset every time the computer is restarted.

< class="p" style="border:0px">1. sudo sysctl -w net.ipv4.ip_forward=1

< class="p" style="border:0px">sudo iptable -F

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

Note: Please refer to the actual port of your development board for networking, for example: eth0

The following are some explanations of the iptables command:

iptables --help

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

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

--append -A chain Append to chain

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

MASQUERAD , address masquerade, is a special case of SNAT, which can realize automatic SNAT

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

DNAT is the abbreviation of destination network address translation. A typical application is that there is a web server placed in the intranet and configured with an intranet IP. There is a firewall in the front end and configured with a public IP. Visitors on the Internet use the public IP to visit the website. When visiting, the client sends a data packet. In the header of this data packet, the destination address is the public IP of the firewall. The firewall will rewrite the header of this data packet once, rewrite the destination address to the intranet IP of the web server, and then send this data packet to the web server in the intranet. In this way, the data packet penetrates the firewall and changes from a public IP to a visit to the intranet address, which is DNAT, target-based network address translation.

This post is from ARM Technology

Latest reply

If you have time, remember to modify it. The code can be used as code, otherwise there are too many tags and it will make you dizzy! indeed   Details Published on 2022-8-6 18:07
 

6788

Posts

2

Resources
2
 

Do I need to write programs in the neural compute stick?

This post is from ARM Technology
 
 
 

6841

Posts

11

Resources
3
 
If you have time, remember to modify it. The code can be used as code, otherwise there are too many tags and it will make you dizzy!
This post is from ARM Technology
 
 
 

68

Posts

0

Resources
4
 
If you have time, remember to modify it. The code can be used as code, otherwise there are too many tags and it will make you dizzy!

indeed

This post is from ARM Technology
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list