This post was last edited by crimsonsnow on 2024-7-7 12:56
Everyone has said before that the biggest feature of this board is that it is very small and mini. Compared with the smallest system board of the most classic series STM32C8T6, it is like this.
It can be seen that excluding the network cable interface, it is almost the same size as the smallest system board of the STM32 MCU chip, which is a circle smaller than it. Except for the 0402 capacitors used for decoupling, all other components are 0201 specifications. This size reduction should be very impressive.
Then the disadvantage is also very obvious, that is, heat dissipation. Every time the board has a problem, I am afraid that it may be accidentally burned, but in fact, it proves that the chip is still very durable, and it is basically my own problem. First of all, remember that the board model we use is luckfox Pico PRO. You can see on the wiki that there are certain operational differences between mini and plus/pro/max. Mini has castrated certain functions. They do not have their own SPI NAND FLASH and need to be burned with an SD card, but you don’t have to worry about this problem for this use. Another difference is the direction of the camera insertion. The camera plug part is affixed with a blue plastic film as an indicator. For the PRO model, the blue must face the direction of the network cable interface. The mini is the opposite, so I was a little confused when I saw the wiki picture at first. Later, I saw the picture of the pro below. Their board layout is also different. This is introduced in the CSI camera section of the wiki.
In short, when you read the wiki tutorial, you must pay more attention to the conditions, environment and model. I don't think I need to elaborate on these. For example, the first problem I encountered was that all the operations of the wiki were in the Ubuntu 22.04 version environment by default. If it is another environment, you have to use docker. It is not impossible to use it, but my personal experience has proved that direct operation is not compatible. You must use docker or you must use the 22.04 version.
The Xinghu board is sold on TB, and the designated agent is Weixue Electronics. The Weixue flagship store is their official store. I think it is helpful to look at the TB product details interface when you are out of ideas. For example, I found out that the magnet-like thing that comes with it has its own battery, but it is powered by USB here, so it is not used much.
Then prepare the development board according to the official wiki. I have to mention some obstacles on my way here, mainly the cable problem. There is a fake Type-A to Type-C cable. It only has charging function and cannot be used as a data cable. I checked at the time and found that there are 11 sets of cables that are normally used as data cables, but there are only 5 sets of charging cables. However, people generally don’t disassemble the type C port to see, but now most mobile phones have C ports, so you can distinguish them by connecting the phone to see if the computer shows that a new device is connected. It is more troublesome to distinguish the fake cable with the micro port, after all, mobile phones now don’t have a micro port, and STM’s boards still insist on using the micro port (I don’t know why they insist on using the micro port and refuse to give a data cable, so I complain). In short, the fake cable is generally lighter than the data cable, and the quality is not good. I encountered two fake Type-C cables in a row, and I almost thought it was a problem with the board. When I switched to the third cable, I finally found out that it was a fake cable, but the problem was with the USB port... Because I changed a test computer to rule out the computer problem, I didn't expect that the USB port of that computer had a problem and couldn't recognize the device, as shown in the picture below. But the device was displayed. I almost missed the problem again, so the control variable method can only change one variable
Then follow the specific preparation steps according to the wiki. First download the RK driver assistant. I won't post the download address here, because the external link will fail to recognize when it is transferred to the wiki repository? Or just visit it directly in the wiki interface. After downloading the driver, install it and restart. Generally, there will be no problem with the driver.
Then start preparing to burn the image. First, download the burning tool and burn the SPI NAND Flash image. Connect the board to the computer and enter the boot mode. The operation is to press the boot button and then plug the USB into the computer to power on. You must press the boot button to power on. You can release it after powering on, and then enter the boot mode and you can burn.
Select RV1106.
Select MaskRom device in the USB device column. Click "Search Path" and navigate to the directory of the firmware library downloaded before, and reload the env file. Many items will appear in the list, then check all of them. Then click "Download". Wait for completion.
The main peripheral used in this handwriting image recognition is this official camera. You can follow the tutorial on the wiki to configure the camera. The image received by this camera is pushed to the video software through the network. The officially recommended video software is VLC media player. First, insert the camera and automatically recognize it to generate a file rkipc.ini.
To view this file, you need to log in via SSH. The account you use depends on which image you burned before. I chose the buildroot version.
账号:root
密码:luckfox
IP:172.32.0.93
Use the command in the command line
ifconfig
You can check the IP address of the device. The official default IP address of the board is 172.32.0.93. We may use this IP address frequently in the future. If your network connection is not good, you may need to log in more frequently to confirm.
The firewall and anti-virus software must be turned off before logging in, otherwise you can only close the terminal and start again, otherwise it will show that the connection failed. This is a problem I personally encountered, and I don't know if it is a common problem. I will list them online for now.
This board needs to set up a virtual network port. According to the wiki, first make sure to turn off the firewall.
Settings -> Advanced Network Settings -> Change Adapter Options, Network Card Remote NDIS based Internet Sharing Device, mine is the same as the one on the wiki. Double-click Internet Protocol Version (TCP/IPv4), and set the IPV4 address to 172.32.0.100. That's it.
Then log in using the password at the computer terminal.
ssh root@172.32.0.93
You can see that there was a problem when I logged in for the first time. It said that the IP could not be recognized. I encountered this problem several times, but I am not sure what caused it. It may be a bad connection (but this is not a wireless login), or it may be the problem of the above firewall. I searched for an article in CSDN saying that similar problems seem to require clearing the IP login record, but it is useless to log in again in the same terminal window immediately after clearing it. As a result, restarting the terminal solved it. Yes, it is so magical. So, um, if you encounter a problem, just restart it boldly! Then the problem encountered in the picture is not the same as that prompt, but you can also see that his system immediately prompts you to press yes, and you will successfully log in after the operation. So, the problem is not very big.
After logging in, use the command in the terminal to view all the files in the board
ls /
The wiki also provides a remote login software MobaXterm. The interface is pretty good, but I basically logged in with PowerShell, so I won't go into details.
The camera file just mentioned can be seen under the userdata folder
Then you can use network streaming to see if the camera is working properly. Open VLC media player software, go to Media -> Open Network Streaming, and enter the default IP address: rtsp://172.32.0.93/live/0.
Click Play.
The camera is working normally.
Then there is an optimization operation, which is to reduce its cache time. This can be done because the default cache time is relatively long and the camera sluggishness will be more serious.
All the above preparations have been done. The next step is to deploy the model based on the second station. In the second station, we have already transferred the RKNN model. I would like to thank all the big guys who have done the deployment before. I have read all the big guys' articles many times. I don't know how to @ people. Anyway, thank all the big guys.
Well, I first configured the development environment according to the instructions of knv and downloaded the official SDK. In short, for this part, make sure to use Ubuntu 22.04 and follow the official tutorial from beginning to end. If there is a problem, it must be the wrong version. If the version is wrong, you can only use the following docker.
https://wiki.luckfox.com/zh/Luckfox-Pico/Luckfox-Pico-SDK/
This main compilation process is very, very long, about three hours per compilation. The following individual compilations are not particularly long, but it seems that two of them take several minutes.
Then it is best not to disconnect from the Internet when compiling. Maybe it is because I use a virtual machine. If something happens, I can only say that recompiling for several hours is really a lot of work.
Then I used the routine deployment
git clone https://github.com/luckfox-eng29/luckfox_pico_rtsp_opencv
export LUCKFOX_SDK_PATH=<Your Luckfox-pico Sdk Path>
mkdir build
cd build
cmake ..
make && make install
If there is a problem, it must be the wrong version
At first, I was confused whether there was something wrong with the SDK path. The SDK path is actually the folder of luckfox-pico that I just downloaded. Then I kept changing it. Later, knv told me that it was the wrong version. I must pay attention that this process is configured under version 22.04. I sent a lot of private messages at that time and disturbed many bosses. I apologize to them!
After entering the above instructions, compile it yourself. In fact, these instructions are also the official instructions in the routine readme
Then a folder will generate a bunch of files, luckfox_rtsp_opencv_demo/luckfox_rtsp_opencv and lib directory
You can use this file transfer operation to transfer it to the board through SSH.
Then log in to the terminal through ssh, enter the folder and run it. When you see the pile of files under the folder in the board, you can run it.
RkLunch-stop.sh
./luckfox_rtsp_opencv
This is also the code in the readme. Just enter and run it.
Before running, be sure to close the rkipc program and execute
RkLunch-stop.sh
Open the streaming video software to receive the picture
Maybe it’s because I used a completely unoptimized routine, so the effect is still a bit problematic. First of all, it is very sensitive to the light and shadow of the picture. When the light is not very good, the recognition effect is also quite touching.
The camera can also twist the front lens to focus. When the focus is not right, it can recognize other messy things in the picture, and the effect will be more touching.
Here it is recognized that the charging line
I always feel that my post is a reward for recognition failure.
Fortunately, it was successfully identified later.
The routine can only recognize one at a time. When they are in the same frame, it will choose the clearer one to recognize. However, it is also possible that 2 is upside down and not at a normal angle, so it does not prioritize recognition.
The angle does not affect the recognition effect
It encountered Waterloo when recognizing 4. First, it would rather recognize the seam next to it than recognize the number.
This is 5
This is 8
It's not 4
It may also be that the board has been running for a long time and has become hot. The computing power required to run the whole program is actually quite high. My old computer is already working hard.
8. There were also recognition errors at the beginning
But then it got better
But the number 4 has never been recognized. Is it possible that the number 4 I wrote is really not standard?