raspberry pi3_如何在Raspberry Pi 2上运行ASP.NET 5 Beta 3或GoLang

raspberry pi3

raspberry pi3

Hanselman's Desk of Hardware

Hanselminutes and CodeNewbie are teaming up to produce two new podcast episodes a week for the month of March, featuring incredible makers in the hardware space. There will be new content every weekday in March, so bookmark http://www.marchisformakers.com and join us!

HanselminutesCodeNewbie合作,每周三月制作两个新的播客节目,其中包括硬件领域令人难以置信的制作人。 三月的每个工作日都会有新内容,因此,对http://www.marchisformakers.com加入书签,并加入我们吧!

  • CodeNewbie is the most supportive community of programmers and people learning to code. Tune in every week for stories about people on their coding journey.

    CodeNewbie是程序员和学习代码的人的最支持社区。 每周收看有关编码之旅中人们的故事的信息。

    CodeNewbie is the most supportive community of programmers and people learning to code. Tune in every week for stories about people on their coding journey.

    CodeNewbie是程序员和学习代码的人的最支持社区。 每周收看有关编码之旅中人们的故事的信息。

  • Hanselminutes: Fresh Air for Developers is a weekly talk show that brings interesting people together to talk about the web, culture, education, technology and more.

    Hanselminutes :《面向开发人员的新鲜空气》是每周一次的脱口秀节目,汇集了有趣的人们来讨论网络,文化,教育,技术等等。

    Hanselminutes: Fresh Air for Developers is a weekly talk show that brings interesting people together to talk about the web, culture, education, technology and more.

    Hanselminutes :《面向开发人员的新鲜空气》是每周一次的脱口秀节目,汇集了有趣的人们来讨论网络,文化,教育,技术等等。

Our hashtag for this event is #MarchIsForMakers and YOU, Dear Reader, can help us out by being our Street Team.

该活动的标签是#MarchIsForMakers ,亲爱的读者,您可以通过成为我们的街道团队来帮助我们。

Share our website http://marchisformakers.com!

分享我们的网站http://marchisformakers.com

...with friends, kids, teachers, family, anyone you think my be benefit from learning about hardware and today's maker culture.

...与朋友,孩子,老师,家人以及任何您认为我将从硬件和当今创客文化中受益的人一起受益。

This is just Day 1! At the end of March we'll have as many as 10 great podcasts, amazing guests, Live Google Hangouts, blog posts, Twitter Chats on Wednesdays, and a huge collection of links and projects for you to explore.

这只是第一天! 3月底,我们将提供多达10个出色的播客,令人赞叹的嘉宾,实时Google环聊,博客文章,星期三的Twitter聊天,以及供您探索的大量链接和项目。

如何在Raspberry Pi 2上运行ASP.NET Beta 3 (How to run ASP.NET Beta 3 running on a Raspberry Pi 2)

I love Raspberry Pi, the tiny $35 computer. I've gone through 6 at least count. Have they died? Not at all! They've been gifted forward. Right now I've got one running my 3D Printer, one running as a media center, and a Raspberry Pi 2 that my kids are using as their primary computer. There's so many Raspberry Pi projects - How can you not love a tiny computer?

我喜欢树莓派(Raspberry Pi),这是一台35美元的微型计算机。 我至少经历了6次。 他们死了吗? 一点也不! 他们已经天才。 现在,我有一台正在运行3D打印机的计算机,一台正在作为媒体中心运行的计算机和一台Raspberry Pi 2,我的孩子正在将它们用作主计算机。 有很多Raspberry Pi项目-您怎么不爱一台小型计算机?

This actually a dual tutorial/how-to. I've been so impressed with the Raspberry Pi 2 I've wanted to see how far one can take it. It's still a modest little machine, but it's definitely twice as fast or more in single-tasking and perhaps 6x faster in multitasking in my experience than the previous Raspberry Pi.

这实际上是一个双重教程/方法。 Raspberry Pi 2给我留下了深刻的印象,我想看看它能走多远。 它仍然是一台普通的小型机器,但根据我的经验,它绝对比以前的Raspberry Pi快两倍或更多,而在多任务中快六倍。

基本的Raspberry Pi设置 (Basic Raspberry Pi set up)

I use the Raspbian Operating System image for my Raspberry Pi 2. It's a Debian Wheezy image for techies, that's a Unix for non-techies.

我在Raspberry Pi 2中使用Raspbian操作系统映像。对于技术人员,这是Debian Wheezy映像;对于非技术人员,这是Unix。

I use this hardware (these are Amazon links) that I put together myself, although you can get a kit that includes memory, power, wifi, cables, case, etc.

我使用的是我自己组装的硬件(这些是Amazon链接),尽管您可以获得包含内存,电源,wifi,电缆,保护套等套件

You can get the disk image and follow the setup instructions here. I also added TightVNC so I could remote into my Raspberry Pi from my desktop. This also allowed me to run it "headless" without a monitor, but it's up to you.

您可以获取磁盘映像并按照此处的设置说明进行操作。 我还添加了TightVNC,以便可以从桌面远程访问Raspberry Pi 。 这也使我可以在没有监视器的情况下“无头”运行它,但这取决于您。

You can see me VNC'ed into my Raspberry Pi 2 here. Of course, you can always connect it to your monitor or TV.

您可以在此处看到VNC已加入我的Raspberry Pi 2。 当然,您始终可以将其连接到显示器或电视。

I wanted to see how hard it would be to run .NET on this Raspberry Pi. Depending on how deep you want to go, it's not hard at all.

我想看看在此Raspberry Pi上运行.NET有多困难。 取决于您想走的深度,一点都不难。

在Raspberry Pi 2上运行ASP.NET (Running ASP.NET on a Raspberry Pi 2)

NOTE/DISCLAIMER: This is a point in time. It's a beta/daily build of an early thing. I'm sure this will get down to a few simple lines in the future, so don't panic thinking that ASP.NET on Linux will suck. It's early.

注意/免责声明:这是一个时间点。 这是早期测试版/每日版本。 我敢肯定,将来这会简化为几行,所以不要惊慌地认为Linux上的ASP.NET会很烂。 现在还早。

Frist, you can get an old (3 years old) version of the open source Mono runtime with the stable standard repositories

首先,您可以使用稳定的标准存储库获得旧版本(3岁)的开源Mono运行时版本

sudo apt-get mono-complete

And this will get you version 3.2.8. You can do basic stuff. Make a HelloWorld.cs and run it with

这将为您提供3.2.8版本。 您可以做一些基本的事情。 制作一个HelloWorld.cs并运行

gmsc HelloWorld.cs
mono HelloWorld.exe

Debian likes to be very stable, I'm told, so if you want to get a very NEW version of Mono like version 3.10 (that's "Three Point Ten") and as such, run things like ASP.NET 5, you'll need to do a little more work.

有人告诉我Debian喜欢非常稳定,因此,如果您想获得像3.10版本那样的Mono版本,那么就运行ASP.NET 5这样的事情吧。需要做更多的工作。

UPDATE and IMPORTANT NOTE: There's two options here. Build Mono from source, or use a custom repository from the Mono folks.

更新和重要说明:这里有两个选项。 从源代码构建Mono,或者使用Mono的自定义存储库。

选项1:从Mono项目的存储库中安装Mono (Option 1: Install Mono from The Mono Project's repositories)

The Mono Project has their own repository for Debian distributions like Raspbian Wheezy. If you've put on an early mono, you'll want to sudo apt-get remove mono-complete first to tidy up.

Mono Project有自己的Debian发行版(如Raspbian Wheezy)存储库。 如果您使用了早期的Mono,则需要先sudo apt-get remove mono-complete来整理。

Per their instructions from the Mono site, you'll then

根据Mono网站上指示,您将

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF 
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update && apt-get upgrade
sudo apt-get install mono-complete

And you should be all set!

而且你应该准备好了!

选项2:从源代码构建Mono(慢速和高级,价值可疑) (Option 2: Build Mono from Source (slow and advanced and of questionable value))

You could git clone the Mono repository and build it. I found this process slow, so I downloaded the source from an archive instead, then unzipped it into a folder.

您可以git克隆Mono仓库并构建它。 我发现此过程很慢,因此我从档案库下载了源文件,然后将其解压缩到文件夹中。

mkdir ~/monosource
cd ~/monosource
wget http://download.mono-project.com/sources/mono/mono-3.10.0.tar.bz2
tar -xjvf mono-3.10.0.tar.bz2

Then here's a bunch of prerequisites I needed, plus htop because I like it.

然后,这是我需要的一些先决条件,再加上htop,因为我喜欢它。

sudo apt-get install build-essential autoconf automake binutils libtool libglib2.0-dev libxrender-dev libfontconfig1-dev libpng12-dev libgif-dev libjpeg8-dev libtiff5-dev libexif-dev gettext libcairo2-dev htop 

Then start the build. This too an hour or so, and is dependent on the speed of your Pi AND the speed of your SD card. It should be a Class 10 if possible.

然后开始构建。 这大约一个小时左右,取决于Pi的速度和SD卡的速度。 如果可能的话,应该是10级。

./configure --prefix=/usr/local; sudo SKIP_AOT=true make; sudo SKIP_AOT=true make install;

Note this is three lines in one. Do a sudo reboot when you're done. If you can run mono -V and see version 3.10.0 then you're in a good place.

注意这是三行合一。 完成后执行sudo重新启动。 如果您可以运行mono -V并查看版本3.10.0,那么您的位置很好。

添加ASP.NET 5 (Adding ASP.NET 5)

You can add ASP.NET 5 at this point by downloading the samples directly from Github and running the "kvminstall.sh" to setup the ASP.NET runtime manager.

现在,您可以通过直接从Github下载示例并运行“ kvminstall.sh”来设置ASP.NET运行时管理器来添加ASP.NET 5。

mkdir ~/sources/aspnet5 
cd ~/sources/aspnet5
git clone git://github.com/aspnet/home.git
sh ~/sources/aspnet5/kvminstall.sh
source ~/.k/kvm/kvm.sh
kvm upgrade

Then per this GitHub issue you need to tell your system about the SSL certs for NuGet to restore correctly.

然后,根据此GitHub问题,您需要告诉系统有关NuGet的SSL证书,以使其正确还原。

CERTMGR=/usr/local/bin/certmgr
sudo $CERTMGR -ssl -m https://go.microsoft.com
sudo $CERTMGR -ssl -m https://nugetgallery.blob.core.windows.net
sudo $CERTMGR -ssl -m https://nuget.org

mozroots --import --machine --sync

Then go to one of the samples like ~/sources/aspnet5/home/samples/HelloMvc and run "kpm restore." Note this uses about 400 megs of RAM for a minutes so you'll want a newer Raspberry Pi.

然后转到〜/ sources / aspnet5 / home / samples / HelloMvc之类的示例之一,然后运行“ kpm restore” 。 请注意,这需要大约一分钟400兆的RAM,因此您需要更新的Raspberry Pi。

Running kpm restore on Raspberry Pi

NOTE: Make sure the sample version in project.json match your local runtime version. I needed to update version strings to beta3 to match what "kvm list" said. I'm sure this will get fixed soon.

注意:确保project.json中的样本版本与您的本地运行时版本匹配。 我需要将版本字符串更新为beta3以匹配“ kvm list”中的内容。 我相信这很快解决

The "Kestrel" web server uses libuv, an HTTP library. Here is how to build libuv. I found this on Punit Ganshani's blog, which I'm actually wishing I'd found earlier in this blog post. ;)

“ Kestrel” Web服务器使用libuv(HTTP库)。 这是如何构建libuv。 我在Punit Ganshani的博客中找到了这个,实际上我希望我能在此博客文章的前面找到它。 ;)

sudo apt-get install gyp
wget http://dist.libuv.org/dist/v1.0.0-rc1/libuv-v1.0.0-rc1.tar.gz
tar -xvf libuv-v1.0.0-rc1.tar.gz
cd libuv-v1.0.0-rc1/
./gyp_uv.py -f make -Duv_library=shared_library
make -C out
sudo cp out/Debug/lib.target/libuv.so /usr/lib/libuv.so.1.0.0-rc1
sudo ln -s libuv.so.1.0.0-rc1 /usr/lib/libuv.so.1 Then run

Then run "k kestrel" and hit the port mentioned in the project.json.

然后运行“ k kestrel”并点击project.json中提到的端口。

ASP.NET 5 Beta 3 on a Raspberry Pi 2

如何在Raspberry Pi 2上运行Go (How to run Go on a Raspberry Pi 2)

I wanted to Go running as well. Go has fewer dependencies but no official ARM builds. The Raspberry Pi 2 is an ARMv5. However, a very kind gentleman named Dave Cheney has been building and hosting his own unofficial ARM tarballs for Go. You take the instructions from the GoLang site and his links and you're all set on your Raspberry Pi or Pi 2.

我也想跑步。 Go具有较少的依赖关系,但没有正式的ARM版本。 Raspberry Pi 2是ARMv5。 但是,一个名叫戴夫·切尼( Dave Cheney)的善良绅士一直在为Go构建和托管自己的非官方ARM tarball 。 您从GoLang网站及其链接获取说明,并且都已设置在Raspberry Pi或Pi 2上。

Here's what I did for a Raspberry Pi 2.

这是我为Raspberry Pi 2做的。

wget http://dave.cheney.net/paste/go1.4.2.linux-arm~multiarch-armv7-1.tar.gz
sudo tar -C /usr/local -xzf go1.4.2.linux-arm~multiarch-armv7-1.tar.gz

Then, add it to your path, or .profile, or whatever.

然后,将其添加到您的路径或.profile中。

export PATH=$PATH:/usr/local/go/bin

Make a HelloGo.go, compile and run.

制作一个HelloGo.go,进行编译并运行。

Go on a Raspberry Pi

Personally, I'd love to see "dotnet" be as easy to get running on Linux as Go.

就个人而言,我很想看到“ dotnet”像Go一样容易在Linux上运行。

package main

import "fmt"

func main() {
fmt.Println("Hello Go on Raspberry Pi 2")
}

The Raspberry Pi is just a little joy. It's a lot of fun and has a lot of potential. Definitely pick up some for the kids (yourself.)

Raspberry Pi只是有点乐趣。 这很有趣,而且潜力很大。 一定要为孩子们​​(自己)买一些。

Don't forget, visit http://marchisformakers.com, tell your friends and tweet us at #MarchIsForMakers!

别忘了,访问http://marchisformakers.com ,告诉您的朋友,并在#MarchIsForMakers上鸣叫我们!

相关链接 (Related Links)

翻译自: https://www.hanselman.com/blog/how-to-run-aspnet-5-beta-3-or-golang-on-a-raspberry-pi-2

raspberry pi3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值