First day flights

First day flight path

Goals and considerations

The main goal for the fist day of flying is to get to the state of Alaska.

Originally, we had considered starting from the Seattle area, and Boeing Field, in particular. The reason for this was two-fold. On the one hand, we could shave almost two hours off the first day of flying, and on the other, we have friends in that area that we'd love to spend time with.

Ultimately, I had a work obligation that will be longer than expected, and I won't be able to come come until a day later than expected. Also, Katie and Emma had considered coming with me on that trip. Had that been the case, we'd have flown up to Seattle, left the plane there, and flown to the work trip from SEA.

Anyway, as it happens, we're flying all the way to Alaska from Corvallis (CVO) in one day. This is just-under 5 hours of flying, which is less than we've done in the past. For example, the flight from Chandler, AZ to Corvallis is six-and-a-half hours. Emma was a champ during this flight, but the last hour was hard on her. Given that this day of flight will be more than an hour shorter than that was, I'm confident that she'll be more than capable of this one as well.

The plan

We've decided that we can do this trip in one day, with one stop for fuel and lunch.

It's a bit annoying that we'll have to clear customs twice in one day, once in Canada, and once in Alaska, but that's part of the fun, isn't it? 😆

I've read a few other trip reports, and it seemed like Port Hardy, on the northern-most part of Victoria island is a popular stopping point. As it happens, it's a very convenient stopping point for us, as well. Almost perfectly splitting the journey.


View Larger Map

Once we've filled our bellies and our plane, we'll continue on to Ketchikan. This is a relatively short 2 hour flight, and should be a nice way to end the day.

Port Hardy has a cafe on the field, and it looks like a good option. However, it appears that it's cash-only, and doesn't have an ATM, so we'll need to figure out how to get some Canadian currency before flying up.

There is 100LL fuel reported on the field, according to the Canadian Flight Supplement, but, as mentioned in the FAA Flying to Alaska document, it's wise to call ahead and check on fuel status prior to departure.

First leg

Between Corvallis and Port Hardy we can get almost all the way there on V495, but switching to V165 at Newberg (UBG) is a bit of a short-cut, and I'm planning on re-joining V495 at DIGGN, which is near the North East corner of the Olympic Peninsula. From there, we'll track V440 to Port Hardy. The highest MEA along this route is 9,600' near the mid-point of Victoria island, and I'm flight planning for cruise at 10,000'.

First leg of the trip, from KCVO to CYZT

Second leg

From Port Hardy to Ketchikan is a short enough, and remote enough, flight that there's no real point to worrying about airways, so we filed point-to-point. The path is from YJQ, PR, ANN, and finally PAKT. The highest MEA on this trip is 7000', and I'll fly it at 10,000'.

Second leg of the trip, from CYZT to PAKT

Risk & Reward

As with any activity, and especially with flying, risk is present. One must decide what their risk tolerance is, the inherent risk of their activity, circumstantial risk, and strategies for the mitigation of risk. For this trip, the most salient risks specific to this trip are:

Weather

Weather

The weather in Alaska and Northwest Canada is notorious for its treacherousness. There are two concerns in particular. One is coastal fog, the other is icing.

To mitigate these risks, we've designed our trip with flexibility in mind. This is a particular challenge for Katie, who normally plans our trips down to the hour. We have only three major activities scheduled, and they're in the middle of our trip. This will give us the freedom to skip a day of flying if the weather isn't cooperating.

Furthermore, Will is an instrument-rated pilot, and we will be filing and flying the trip under instrument flight rules.

Finally, our plane is equipped with a non-hazard icing protection system (using TKS fluid). This is not a system that you can rely upon (legally, or practically), but if we end up in icing it will buy us some time to turn around and get out.

Terrain

Cloudy mountains

This is high country. Denali is a stupidly tall mountain (around 20,000'). A lot of the mountains out here are huge. One problem this poses is that the weather and the terrain may push us to fly higher than is safe given the "thinness" of the atmosphere at altitude. Another problem is the potential for lack of situational awareness while in instrument meteorological conditions (IMC) and finding some terrain by surprise.

For the first problem, we mitigate it by choosing routes by looking at the highest MEA of the journey for each leg. In our case, the highest MEA is 11,300'. Will is a fit, relatively young, non-smoker. We routinely fly at ten, eleven, sometimes twelve thousand feet without supplemental oxygen. We have a pulse oximeter onboard, and check our SpO2 frequently on these flights. We make sure that it's at least 90%.

Regarding the unexpected encounter with terrain, the mitigation here is to use the technological tools at our disposal, including the aircraft's multi-function display (MFD), the terrain awareness and warning system (TAWS), and backup from the Foreflight synthetic vision system. Also, we will be avoiding IMC wherever possible, and my personal minimums for the ceilings at the destinations will be much higher than charted.

Facilities

Ketchikan and Juneau are not accessible by road. Take a minute, and let that sink in. The implication of this is that these very small towns (by normal standards) need to get everything shipped in via air or boat.

Simple things like aviation fuel may be difficult to come by. The FAA advises that you call ahead to each port that you intend to receive services from, prior to departure, to make sure that they can actually provide them to you. The biggest worry is fuel. We intend to bring a few quarts of oil with us, and a few spare spark plugs.

Additionally, many Alaskan airports don't have precision instrument approaches. I suspect that this is due to the nearby terrain, in many cases. For at least Ketchikan and Juneau, these airports are nestled in deep canyons. It's hard to have a miles-long straight shot to a runway, to say nothing about a missed approach procedure in this case.

Instrument approach to Juneau

For the instrument pilots reading, check out the approach for Juneau shown above, notice how different many things are relative to the lower-48, even the mountainous west. First of all, the missed approach point (MAP) and minimum descent altitude (MDA) are relatively far away from the airport and higher than normal. Also, if you reach MOLRE, and don't see the airport, you had better be turning without delay!

Mechanical

While our plane is in excellent condition, and there are no known issues, anything could happen. We're flying over a lot of desolate land, and the endpoints may have limited mechanical service available.

There's really no mitigation available other than to address anything that comes up as soon as its detected, especially if there are services available on the field. This even applies if it means that we may miss an appointment or booking because of it. It will be tempting to defer issues if it's inconvenient to have them addressed.

Procedural

Things are different in Canada. Things are even different in Alaska. These procedural differences are at best annoying, but at worst could lead to loss of separation with other aircraft.

The mitigation strategy for this risk is to read up on the procedures, and try to understand them as best as possible. I've got the Canadian Airman's Information Manual, and I've been reading through it.

Risk Tolerance

Phew, that's a lot of risk!

Or is it?

Ultimately, we decided that the risks are fully outweighed by rewards. We planned 4 days in Juneau, that gives us a bank of days that we can use to stay safe in the case of weather. On the way home, we don't have any appointments, Will has two days of PTO to spare, and we're taking the safer interior route.

Route Overview

Route overview of the trip

For our trip, we spent a lot of time considering what exact paths we wanted to take, and where we wanted to stop. Originally, we were thinking about going up and back along the coast, stopping in Ketchikan, Juneau, and Anchorage. Eventually, we decided to skip Anchorage and also have the flight back go through the interior of Canada, along the Alcan Highway. Generally, the interior route is thought to be a little safer, as there are more landing options and a highway to land on. Also, there's less of a chance of poor weather on the highway route.

Cities, Sites, and Activities

Ketchikan

Funicular

We don't have a lot planned for Ketchikan, it's mostly a stop and sleep, but we're planning on making the most of it. The Airport in Ketchikan is actually on an island across the water from Ketchikan proper so our first task will be to get across the water. We're hoping to hire a water taxi which will be a bit of a fun little excursion right off the bat. Our accommodations for the night will be at Cape Fox Lodge, and we're planning on riding the Funicular to get there. Totem Poles and Creek Street seem to be the main attractions here, and luckily our hotel has some pretty cool totems. Creek Street is right at the base of the Funicular!

Juneau

Mendenhall Glacier with Helicopter

Juneau is both a fun destination (and the Capitol of Alaska), and a bit of buffer in the schedule. We'll be staying at the gorgeous historic Jorgenson House Bed & Breakfast in downtown Juneau. We're planning on doing two tours of the Mendenhall Glacier, one is a canoe tour on Mendenhall Lake that goes near the face of the glacier and the other is a helicopter tour that lands on top of the glacier AND lands at a summer sled dog training camp. We expect the sled tour will be the highlight of the trip for our 5 year old as she'll get some mushing training and puppy snuggles.

Talkeetna

K2 Flying image

Talkeetna is the other true destination. While we're there, we're going to get a commercial tour of Denali from K2 Aviation.

Whitehorse

Whitehorse

Our trip home, for a variety of reasons, will go along the interior of Canada. Our first stop over for the night will be in Whitehorse, the capitol city of the Yukon. We're staying at the Coast High Country Inn, and we're going to try to visit the Yukon Wildlife Preserve

Prince George

Mr. PG

Prince George is another night stop-over, like Ketchikan. Unlike Ketchikan, though, our hotel in Prince George has a killer indoor pool with a waterslide. This will likely be Emma's second-favorite thing about the whole trip. We're staying at the Pomeroy Inn and Suites.

Papers, please

via GIPHY

Regulatory prep

Canada is, of course, a different country. And, it inconveniently lies between the "lower 48" and Alaska. This post is less narrative, and more of a checklist and brain-dump for what I'll need for ADIZ crossings, and clearing customs in both countries.

Useful Links and resources

Documentation and regulations

  • [x] Pilot Certificate
  • [x] Medical
  • [x] Passports
  • [x] Airworthiness certificate
  • [x] Registration
  • [x] Operating limitations
  • [x] Weight and Balance
  • [x] Radio Station License
  • [x] Restricted Radio Telephone operator Permit
  • [x] Public Liability Insurance (See Insurance)

CBP Decal and fee

(e)Fee for arrival of a private vessel or private aircraft -

(1)Fee. Except as provided in paragraph (e)(3) of this section, the master or other person in charge of a private vessel or private aircraft must, upon first arrival in any calendar year, proceed to CBP and tender the sum of $27.50, as adjusted in accordance with the terms of paragraph (k) of this section, to cover services provided in connection with all arrivals of that vessel or aircraft during that calendar year. Either a properly completed CBP Form 339V (Annual User Fee Decal Request - Vessels) or CBP Form 339A (Annual User Fee Decal Request - Aircraft), must accompany the payment. Upon payment of the annual fee, a decal will be issued to be permanently affixed by adhesive to the vessel or aircraft, in accordance with accompanying instructions, as evidence that the fee has been paid. Except in the case of private aircraft, and aircraft landing at user fee airports authorized under 19 U.S.C. 58b, all overtime charges provided for in this part remain payable notwithstanding payment of the fee specified in this paragraph.

(2)Prepayment. A private vessel or private aircraft owner or operator may, at any time during the calendar year, prepay the $27.50 annual fee specified in paragraph (e)(1) of this section, as adjusted in accordance with the terms of paragraph (k) of this section. Prepayment must be made in accordance with the procedures and payment methods set forth in this paragraph and paragraph (i) of this section. The decal request and prepayment by credit card or ACH debit may be made via the Internet through the “Travel” link at the CBP Web site located at http://www.cbp.gov. Alternatively, prepayment may be sent by mail with credit card information, check, or money order made payable to U.S. Customs and Border Protection, along with a properly completed CBP Form 339V (Annual User Fee Decal Request - Vessels) or CBP Form 339A (Annual User Fee Decal Request - Aircraft), to the following address: U.S. Customs and Border Protection, Attn: DTOPS Program Administrator, 6650 Telecom Drive, Suite 100, Indianapolis, IN 46278.

Aircraft

  • [x] ELT (121.5 still OK)
  • [x] Mode C

eAPIS and Flight plans

Use an ICAO flight plan (I already do this anyway)

Provide CANPASS more than 2, but less than 48 hours notice of entry

Provide US CBP more than 1, but less than 24 hours notice of entry

ATC Fees

Canada charges $17.85 for ATC services per quarter.

Insurance

Canada requires liability insurance as documented in the Canadian Aviation Regulations section 606.02(1).

Liability Insurance 606.02 (1) This section applies to every owner of an aircraft, other than a remotely piloted aircraft, that is registered in Canada or registered under the laws of a foreign state and operated in Canada, if the owner is not required to subscribe to liability insurance in respect of the aircraft under section 7 of the Air Transportation Regulations.

(2) Doesn't apply?

(3) Doesn't apply?

(4) Doesn't apply?

(5) Doesn't apply?

(6) Doesn't apply?

(7) Doesn't apply?

(8) No aircraft owner not referred to in paragraph (2)(a), (b) or (c) shall operate an aircraft unless, in respect of every incident related to the operation of the aircraft, the owner has subscribed for liability insurance covering risks of public liability in an amount that is not less than

(a) $100,000, where the maximum permissible take-off weight of the aircraft is 1 043 kg (2,300 pounds) or less;

(b) $500,000, where the maximum permissible take-off weight of the aircraft is greater than 1 043 kg (2,300 pounds) but not greater than 2 268 kg (5,000 pounds);

(c) $1,000,000, where the maximum permissible take-off weight of the aircraft is greater than 2 268 kg (5,000 pounds) but not greater than 5 670 kg (12,500 pounds);

(d) $2,000,000, where the maximum permissible take-off weight of the aircraft is greater than 5 670 kg (12,500 pounds) but not greater than 34 020 kg (75,000 pounds); and

(e) $3,000,000, where the maximum permissible take-off weight of the aircraft is greater than 34 020 kg (75,000 pounds).

(9) Subject to subsection (10), no owner or operator of an aircraft shall operate the aircraft unless there is carried on board the aircraft proof that liability insurance is subscribed for in accordance with this section.

(10) Doesn't apply.

Let's get the GEAR

via GIPHY

Background

We're flying ourselves to Alaska. This is the first in a series of posts about our planning, preparing, flying, and touring the great state of Alaska. We're jumping right in with packing...

We've never been light packers. This is more true for Katie than Will, but when we travel we tend to take all the things. We have one of those rolling suitcase sets that includes a giant case (good luck keeping it less than 50 pounds) and a carry-on. We'd easily fill the large one, and the carry-on. Then we'd each have backpacks for under our seats, and Emma would have her own trunki

Trunki Suitcase

Because we're flying ourselves, and flying into small municipal airports, our usual overpacking wasn't going to work. For one thing, the baggage compartment of the Cirrus is not that large.

Cirrus Cabin

The big suitcase does fit (but only just). Finally, and most importantly, the indignity of showing up in small Alaskan towns dragging around a rolling suitcase it just too much to bear.

Suitcase in mud

Travel Backpacks

So, Katie did a ton of research. She came across the Pack Hacker blog and geeked out. We kinda settled on getting a travel backpack each. I had a backpacking backpack before, but the travel ones are more optimized for motorized travel, and less for hiking under your own power. I'll share the short-list of options she came up with:

Katie's:

Will's:

Emma:

Osprey FarPoint 55REI RuckPack 40Osprey HydraJet 15

Of course, no amount of planning and research is too much to just throw it all out and get something else when you actually get to the store. So, I got the Osprey Farpoint 55, and Katie got the REI Ruckpack 40. I'm hoping that I can get away with carrying-on my pack on my commercial flights for work, which I take about once-a-month. It's a few inches too-long for Alaska Airlines, but I'm hoping that they let me get away with it. The main selling point for me is that it has a zip-off day pack, and I intend to use that for my under-seat stuff (Laptop, headphones, and iPad). We did end up getting Emma the Osprey Jet, but it ended up being the HydraJet. The HydraJet is just what REI had in stock, and turns out she loves the water bladder.

Capsule Wardrobe

Packs are only one piece of the puzzle, though. To pack lighter, you have to pack less. So, another thing Katie came across in her research is the travel capsule wardrobe. The idea behind the capsule wardrobe is a collection of a small number of essential items that don't go out of fashion, can be mixed-and-matched, and travel well. So, for travel, we chose mostly black and grey clothes made of merino wool. Merino Wool is naturally odor resistant. This is a pretty big deal for us, because we're pretty obsessively clean, and do not like re-wearing dirty clothes. I think it's going to be a bit of an adjustment, but that's how we're packing, so we'll have to deal.

Compression bags

Another way we're trying to maximize packing space is via compression bags. These are very thin nylon (like parachute fabric) bags with zippers that compress-down the contents.

Will's things unpackedWill's things baggedWill's things packed

Initial testing with Will's pack turned out pretty well

Complications

One of the biggest complications we're facing for this trip is that Will has to travel to Mass. for most of the week prior to our departure. He arrives home late on August first, and we leave for Alaska on the second. To stay safe, we're going to sleep-in and take it kinda easy on the first day. What that means is that he has to pack for both trips prior to departing to Mass. Luckily he has just enough underwear! 😆

Conclusions

This is all we're taking ... those three packs ... for 12 days. This is unprecedented for us. Of course, the lie in that statement is that the airplane survival pack (with camp stove, water, tent, sleeping bag, etc.) life vests, boots, airplane emergency pack (oil, tools, windshield cleaner, etc.) will be coming along for the ride as well. I'll update you with the eventual weights of everything, and a weight and balance report.

SwiftVision Supplemental Materials

Swift Vision

Recently, I posted a "short" video about the CM5 lights and transcribing their states automatically in Swift. Here is a link to the github repository. I've just committed an update that includes and enables "Mode 5″ of the LED panel, in addition to the "Mode7″ that I had before.

For fun, here's a new histogram of the mode 5 video, which I captured on aniPad.

histogram

Also, the timeline for mode 5 (really more a function of the lighting and ipad)

timeline

What I'm sure iskunk and Mark are really after is the transcribed animation steps: Mode 5

Netboot Debian Sid on Nvidia TX1

This is a follow-on to my last post and to the excellent instructions at the nvidia forums. The purpose to writing it again here is to mostly keep a recipe for myself and others. It may be possible to replace the rootfs from Linux 4 Tegra using this method, and I'm going to try that.

Pre-requisites:
  • X86-64 machine running Ubuntu 14.04
  • Micro USB cable
  • Nvidia TX1
  • 16+ GB SD Card (may be optional)
  • 3.3 volt TTL-level usb serial port installed on ttyS0
Background and Considerations

The general theory of operation is to use the Debian netboot/netinstall initrd image. This image is enough to begin the install process using internet-sourced packages. There is no netboot server required in this case. The last post used the Jessie distro's initrd, and I'm going to try the Sid one this time. As I said, no net boot server is required. So, to get the initrd onto the device, we'll put it in the boot directory of the factory mmc image. Then, we can modify the boot configuration file to boot using the initrd. Once it has booted into the installer, we should be able replace the contents on the mmc rootfs.

Steps on the x86_64 machine

  • Login and download and install the L4T package.
  • Download the ARM64 Sid net install initrd.
  • Unpack, apply_binaries.sh, and repack the initrd following these instructions.
  • Open a serial terminal for the TX1′s serial port and reboot the TX1
  • At the uBoot prompt of the TX1 enter UMS mode
  • Mount the TX1 rootfs, and copy the new initrd into /boot
  • Edit the /boot/extlinux/extlinux.conf to add the reference to the new initrd.
  • Backup the entire /boot directory from the TX1.
  • Reboot the TX1 and allow u-boot to run the autoboot
  • In the next boot menu (extlinux) choose your new netboot option
Steps on the TX1
  • Choose your locale settings
  • Select the network interface that looks most like eth0 and configure
  • Follow the instructions normally until you get to partitioning
  • DO NOT CHOOSE GUIDED PARTITIONING
  • Select Manual partitioning
  • select the APP partition (of mmc0 or mmc1, mmc0 is on-board)
  • Use as Ext4
  • Format
  • Mount as root
  • "Done setting up this partition"
  • Finish and write to disk
  • Accept that no swap space is used.
  • Wait for the installation to finish (mine hung making install log)
  • Reboot
Back on the x86-64 machine:
  • In the serial terminal, re-start UMS mode
  • Re-mount the root file system
  • Re-run the apply-binaries.sh, but on the mounted TX1 root filesystem this time
  • Copy the /boot/extlinux folder from your backup of boot into the new /boot
  • Unmount and reboot

64-bit userspace on Nvidia TX1

I've been having trouble getting a 64-bit userspace up on the Nvidia TX1 (Linux4Tegra uses 32-bit), so I thought I'd share my progress and steps.

See the end of this post for a comment about how I actually got this working. These instructions don 't work as they are, but I'm leaving them here for posterity.

To begin with, I use Debian (or Ubuntu, or whatever) for most of my work, so that's what this guide will be based on. Also, you'll need to have another drive to use with your TX1. Linux4Tegra (L4T) will be installed on the on-board MMC device, and we'll be installing Debian Sid on the other drive.

You'll need to copy the extensive partition scheme that Nvidia builds on theMMC (there's something like 8-9 partitions) onto your target drive. I do this by dd'ing the entire MMC onto the target

sudo dd if=/dev/mmcblk0 of=/dev/mmcblk1 bs=4096

Then we need to mount the root filesystem on the target device somewhere

sudo mkdir /mnt/rootfs
sudo mkfs.ext3 /dev/mmcblk1p1
sudo mount /dev/mmcblk1p1 /mnt/rootfs

Debootstrap will do the work of making the new (very minimal) root filesystem.It's very important to include the -arch flag, otherwise the bootstrap process will generate a rootfs using armhf, and we'll be stuck with a 32-bit userspace again.

sudo apt-get install debootstrap
sudo debootstrap -arch=arm64 sid /mnt/rootfs http://debian.osuosl.org/debian  `

As I said the rootfs will be VERY minimal, so we need to install tons of important stuff, including locales, keyboard maps, ssh server, etc… But, before we do that we have to chroot into the new rootfs:

sudo mount -o rbind /dev rootfs/dev
sudo mount -t proc none rootfs/proc
sudo mount -o bind /sys rootfs/sys
sudo chroot rootfs /bin/bash
source /etc/profile
apt-get update
apt-get install
ssh openssh-server
make gcc libncurses5-dev bc locales
dpkg-reconfigure locales

Then, we need to add information about the network interface to/etc/network/interfaces:

auto lo
iface lo inet loopback`

allow-hotplug eth0
iface eth0 inet dhcp`

The current linux-upstream kernel has support (though apparently, rudimentary)for the TX1. This should obviate the need for the binaries supplied with L4T.So, let's clone the kernel repo and build one.

cd /usr/src
git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.gitlinux-next
cd linux-next
cp /proc/config.gz ./
gunzip config.gz
cp config .config
make oldconfig (press enter until it's done)
make menuconfig
  (in General Setup, select "open by fhandle syscalls")
  (in Drivers->General, delete all the extra firmware names listed)
make
cp build

Next, we have to copy the entry that selects the boot mode in /boot/extlinux/extlinux.conf and edit it to select our new rootfs. We'll leave the old one there so we can swift back and forth. This is especially helpful if something breaks.

LABEL debian
MENU LABEL debian kernel
LINUX /boot/Image-next
FDT /boot/tegra210-p2371-2180.dtb
APPEND fbcon=map:0 console=tty0 console=ttyS0,115200n8 tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=${lp0_vec} nvdumper_reserved=${nvdumper_reserved} core_edp_mv=1125 core_edp_ma=4000 gpt root=/dev/mmcblk1p1 rw rootwait

The last thing to do in the chroot is to set the root password to something, and allow (for now, change it later!!) root login over ssh:

passwd
vi /etc/ssh/sshd_config

PermitRootLogin yes

Now, we need to really dive into to some somewhat painful work. We have to setup a serial console onto the board, and have another computer (specifically a x86-64 machine running Ubuntu 14.04) to run the L4T apply_binaries.sh tool.First, the serial port connection is explained at elinux. Then, you need open a serial terminal to the board with 115200 baud. Once that's done, reboot the board, and prevent u-boot from auto booting. In the uboot console, enable the USB Mass Storage mode:

Tegra210 (P2371-2180) # ums 0 mmc 1 UMS: disk start sector: 0x0, count: 0x39f0000

Then, with the usb cable connected from the TX1 to your x86-64 box runapply_binaries.sh:

sudo mount /dev/sdg1 /mnt/rootfs/
sudo LDK_ROOTFS_DIR=/mnt/rootfs ./apply_binaries.sh
sudo umount /mnt/rootfs

The problem I've been having is that the USB keyboard that I have doesn't work on the console. It's obviously a HUGE bummer to not be able to login to a machine using the console. 😡

I ended up following these instructions to net-install debian arm64 on my SD card. The limitation here is that most of the things that makes this an Nvidia device (GPU, CUDA, etc) don't work. For my needs, I only want a Arm64 to work on a Swift port, soI don't care.

References:

Getting started with Swift and Raspi V.2

While progress with Swift on ARM has been very encouraging, there have been a few reports of people having trouble with it. This post is intended to be a step-by-step, starting with a brand-new Raspberry Pi version 2 and a freshly-made Raspian image (note that other distributions might work, I've only verified raspian).

Setup the raspberry pi

I expect that you can ssh to your raspberry pi (hereto referred to as raspi),and that you've run the raspi-config utility.

First, you need to expand the range of debian repositories in order to access the required prerequisites. To do that, edit /etc/apt/sources.list:

sudo nano /etc/apt/sources.list

and uncomment the last line in the file, which should look like this:

deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

Then, you'll need to update your repositories.

sudo apt-get update

Install prerequisite software

Once that's complete, install clang

sudo apt-get install clang

Option 1: install from tarball

A tar of the swift installation (usually more up to date) is available from my website. You can install this in either your system root, or from another directory. I do all of my testing with it installed in the system root, and therefore things are more likely to work. However, you're putting your system at more risk by doing that. Keep in mind, though, that you're playing around with alpha-level software on your <$100 computer… YOLO.

cd /
sudo wget http://housedillon.com/other/swift-armv7.tar.gz
sudo tar -xzpf swift-armv7.tar.gz
rm swift-armv7.tar.gz    

Option 2: install with Joe Bell's repo

Joe @iachievedit did a fantastic job creating a debian repository for the swift compiler and tools, and he's hosting it in an amazon aws instance. Taking this route has some huge advantages. First among them is that they're only updated when things are stable-ish. The version hosted at my website can change frequently, and it might even be completely broken!

Rejoice!

Now, assuming that everything went according to plan, you should be able to compile programs written in swift. Also, you should be able to use glibc andFoundation.

pi@raspberrypi:~ $ cat hello.swift
import Glibc
import Foundation
let now = NSDate()
print("Hello world at \(now)")
pi@raspberrypi:~ $ swiftc hello.swift
pi@raspberrypi:~ $ ./hello
Hello world at 2016-01-09 05:36:31 +0000
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.1.13-v7+ #826 SMP PREEMPT Fri Nov 13 20:19:03 GMT 2015 armv7l GNU/Linux    

Not so fast

Ok, so there are some caveats. For one, it seems like the REPL is kinda broken on the Raspi v.2. Joe noticed this, too. I'm not sure what the root cause is for this one. It works on the original raspberry pi (armv6), and it works on the Beaglebone Black and Nvidia Tegra (armv7).

Also, things are very alpha-level, so expect the unexpected.

Swift available for Beaglebone/RasPi

I was able to succeed in building Swift and Foundation for Ubuntu on ARMv7.This includes the Beagle Bone/Board, the Raspberry Pi, Tegra TK1, Cubox, and so much more…

This is more-or-less alpha-level at this point, but you should be able to compile and run basic swift programs that use the standard library, Glibc, orFoundation. Keep in mind that, even for x86_64, Foundation is far from complete.

To install, you can either un-tar in your root directory (which will install into /usr) or, create a new directory in /opt (for example /opt/apple, or/opt/swift) and update your paths. If you choose to install into /usr you're running a much greater risk to your system, and you had better be willing tore-install if from scratch!! :)

Once it's installed, give swiftc a try:

wdillon@arm:~$ cat hello.swift
print("Hello world!")
wdillon@arm:~$ swiftc hello.swift]
wdillon@arm:~$ ./hello
Hello world!
wdillon@arm:~$ uname -a
Linux arm 4.1.12-ti-r29 #1 SMP PREEMPT Tue Nov 10 00:38:08 UTC 2015 armv7l armv7l armv7l GNU/Linux
wdillon@arm:~$    

You can download the file here.

If you want to contribute to the effort, there are still a few tests that fail in stdlib that could be addressed, the swift package manager still doesn't work, lldb doesn't work, Foundation isn't finished, and it would probably be pretty great to have swift wrappers for GPIO pins and peripherals (such asSPI, I2C, etc.)