2015-03-03

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!

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.

Subscribe via RSS or on iTunes. Published Mondays.

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.

Subscribe via RSS or on iTunes. Published Thursdays.

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

Share our website http://marchisforamakers.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.

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?

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.

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.

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.

32 gig Micro SD Card

Edimax Wi-Fi USB Adapter (amazing!)

Microsoft Arc Wireless Keyboard although any USB Keyboard will work

Microsoft USB Wireless Mouse although, again, any USB mouse will work

A 2.1A (You need at least 1A) USB Adapter - I've also had luck with Samsung phone USB power

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.

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



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.

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.

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

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

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

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.

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

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.

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.



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.

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

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.

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.

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. ;)

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

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.

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

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

Make a HelloGo.go, compile and run.

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

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.)

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

Related Links

Raspberry Pi at Amazon

Many Raspberry Pi projects - How can you not love a tiny computer?

Top 10 Raspberry Pi Myths and Truths

The new Raspberry Pi 2 will run Windows 10 and run Universal Apps

© 2015 Scott Hanselman. All rights reserved.

Show more