Raspberry Pi 3b+ running the. Net Core Project

Source: Internet
Author: User
Tags dotnet gettext

Recently, I bought a Raspberry Pi 3b+, ready to put a. Net core crawler on it and run it.

Buy before thought Raspberry Pi because it is new this year, leading to drive and system what is not very perfect, led to go a lot of detours, early know to buy Raspberry Pi 3 without so much toss

First bought and then installed the Raspberry Pi official system, ran down the database emmm

On the left is the Raspberry Pi on the database additions and deletions of the time, in milliseconds, the right is the desktop above the speed of running, it can be said that the performance is quite unsatisfactory (which is a considerable amount of consumption is created on the database)

Then of course I can not tolerate, so I am ready to change a familiar Ubuntu system test will not be a system cause this situation

After the change to Ubuntu, because it is Raspberry Pi 3b+, did not find the corresponding based on the ARM32 architecture compiled, only to find a big God based on Arm64 compiled, so encountered a lot of problems.

The following is the text

First download and deploy the Ubuntu 18.04 system based on linux-arm64 (aarch64) from Https://github.com/chainsx/ubuntu64-rpi

After inserting the TF card into the Raspberry Pi, it is important to note that the system is not working on the Raspberry Pi 3b+, so you still need to use the HDMI cable and keyboard to operate and display

Log in root and enter

sudo chainsx-tools

A configuration tool that goes into the compiler of the system, where you can choose to connect and automatically configure WiFi (I don't know why, I can't connect to 5G WiFi, maybe it's a driver problem)

Connected to the WiFi, you can unplug the HDMI and keyboard, directly using the desktop remote SSH connection in the past operation, and each time the power-on automatically connected, this is very good

Okay, next, configure the. Net Core Environment

Because on the ARM architecture, it seems that there is no. Net Core SDK, but, fortunately, runtime can be installed

However, I do not know if the runtime is necessary, put it, there is no loss

wget https://dotnetcli.blob.core.windows.net/dotnet/runtime/master/ dotnet-runtime-latest-linux-arm64.tar.gzsudo mkdir-p/opt/dotnet && sudo tar zxf Dotnet-runtime-latest-linux-arm64.tar.gz-c/opt/-s/opt/dotnet/dotnet/usr/local/bin

Then we install the necessary dependent projects

Enter the following command

sudo apt update && sudo apt upgrade sudo apt-get install Curl Libunwind8 gettext Apt-transport-httpssudo dpkg--ad D-architecture armhfsudo apt-get updatesudo apt-get install libc6:armhfsudo apt-get install Libunwind8:armhfsudo apt-get Install LIBUNWIND8:ARMHF GETTEXT:ARMHF

Tell me what it's all doing.

First, install the necessary dependent libraries, which you can see in the HTTPS://GITHUB.COM/DOTNET/CORE/BLOB/MASTER/SAMPLES/RASPBERRYPIINSTRUCTIONS.MD

For some reason, the currently released version of. Net Core can only be compiled into Arm32 (ARMHF) instead of arm64 (AARCH64), and the Raspberry Pi 3b+ I use can only install the arm64 architecture of Ubuntu system ( Raspberry Pi 3 has the arm32 architecture of Ubuntu can be installed, so the use of Raspberry Pi 3 instead can be a lot easier),

So the first step is to turn on 32-bit support first.

You will then need to install a binary dependent library that can be used for 32 bits to function properly

Okay, let's just have the system level deployed, and here's the project-level thing.

First of all

Run cmd and then CD to the project directory

then enter the command

dotnet Publish-r Linux-arm

Description:-r means running the platform, which can be win-arm, Linux-arm,linux-arm64,win-x86, win-x64, and so on, depending on what your. Net Core SDK supports

You might ask, why don't you just post it as linux-arm64, and I want to do it, and I can actually install the preview version of the SDK (https://github.com/dotnet/core/blob/master/release-notes/ DOWNLOAD-ARCHIVES/2.1.0-PREVIEW2-DOWNLOAD.MD)

But I do not know for what reason, I still can not run on the Raspberry Pi ubuntu above normal operation, have time to try again, now still nothing

And then, let's go.

The Bin\debug\netcoreapp2.0\linux-arm file is generated in the project directory, and the contents of the Publish folder under the Linux-arm folder are copied to the Raspberry Pi.

Just send it over with FTP.

Then ssh to the Raspberry Pi, CD to the project directory that you just copied authorization 755 or 777

777 ./Project Name

After all this, we can finally run the. Net core project.

Input

./Project Name

After

On the Raspberry Pi successfully run the project I created, the same database additions and deletions, the use of time almost as long as the original half of all, can be said to be quite satisfied.

Raspberry Pi 3b+ running the. Net Core Project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.