Saturday, July 11, 2015

Helped out at the San Francisco Food Bank this afternoon

The Stanford Alumni association has a pretty large volunteer organization.  Today was a nice session up at the San Francisco Food Bank.  Stanford had a pretty good turn out and we had fun with food preparation.

Today, I was part of a crew packaging up bundles of snack food.  The food bank gets large pallets of food and our job is to re-package it into classroom sized portions.  Later I wound up sorting plums and nectarines.  A bit more work, and a lot more lifting.  Still the 2.5 hours went by fast.

I do recommend this to anyone looking for a great way to spend time with friends and family.  Food banks feed a lot more people than you might think (this one distributes 107,000 meals a day).  Here's a direct link to the volunteer calendar.  Pick a time and show up!


CoreMotion accelerometer working

I've updated the ttl project to include basic accelerometer output on the display.  It looks like this may be the only sensor on the Watch.  I need to dig a bit more to make sure (e.g. no gyros or magnetometer).

(And no, the simulator doesn't have this support -- so testing this would require plumbing in a synthetic data stream or some sort of unit test data source.  Still a pretty primitive ecosystem.)

Anyway, this is what the screen looks like for the ttl application (actual screen dump from the watch itself):


Other notes:
  • Debugging is exceptionally difficult.  The screen dump from above was from one of only two sessions that have actually worked on the real hardware.  The profile reset was only part of the problem.  Disabling "diagnostics to apple", iMessage, HeySiri, etc. all seem to help kick in one more session.  Perhaps the reliability of debugging is a function of the network between the watch and the phone.  Or still we're stuck in beta ware.
  • The iPhone5 may be part of the problem -- not the speediest machine out there.
  • You will notice that the above right columns are in SF font and are not constant width.  I do have an outstanding project to understand the best way to get constant width working for numbers as mentioned during the SF font overview.

I think I found the "Untrusted Developer" root cause!

Within a narrow window, I replaced the phone and upgraded to Xcode beta3.  This wound up having quite a few provisioning profiles associated with the phone known as "Greg's iPhone".  To fix:
  • Xcode
  • Devices menu
  • Select offending device
  • Right click Profiles
  • Delete all of the provisioning profiles
  • Then re-launch, re-install the applications
All the other attempts, like re-pairing phone, full restores, and so on masked the root cause, and worked typically one time.

Now back to CoreMotion library.  I've got accelerometer output working -- too bad it isn't supported on simulator.  Next up will be the CMDeviceMotion higher level data.

beta3 release of Xcode7, iOS9, WatchOS2 is out!

Seems turning off "Hello Siri" didn't help much with Watch battery life.  It is still around 7 or 8 hours when running beta2 of WatchOS.  beta3 was released, now battery burn issue is resolved!

Upgrade is quite a few long running steps (almost 6 hours):
  • Download new Xcode
  • Remove old Xcode (this seems to help with file collisions...)
  • Install new Xcode
  • Verify an app (e.g. ttl) still works in local simulator (takes a long time to boot initial images of iPhone6 and Watch in simulators)
  • Download iOS9 image
  • Turn off iMessage
  • Restore iPhone to this image (this is a LOT of steps and reboots to get apps and data back in there)
  • Re-pair watch
  • Download WatchOS2 beta3 profile
  • Send profile to email on iPhone
  • Click on that attachment from iPhone
  • Do the profile update, watch reboot cycle again
  • Now do the WatchOS upgrade to beta3
  • Turn iMessage back on
  • Retrust the developer on the phone/watch pair
  • Restart Xcode (to get Watch symbols loaded back into Xcode)
  • Resync the developer's profiles in Xcode (prefs->accounts->${user}->View Details->(resync)
  • At this point, attempt to launch the program to the real devices

Anyway, I am able to get the ttl application loaded to the Watch -- and this application demonstrates the controller running in the watch.  Now I have an application that can launch and run without the paired iPhone being in contact.  Next step: understanding sensor data.

Tuesday, July 7, 2015

Betaware: Upgrading to WatchOS 2 and iOS9

beta2 of the new WatchOS and iOS has been a bit unstable for me.  The upgrade of Xcode, iOS and WatchOS worked ok.  A few existing apps are crashing on both the phone and the watch.  But otherwise, the phone operation remains about the same.  Xcode 7 appears to reliably get applications out to the phone.

However, the WatchOS 2 upgrade isn't quite as robust.  Battery burn is high.  It may be the OS is set to some debug mode.  Or maybe there is some crash/loop program under the hood.  "Hello Siri" being on by default on the watch holds promise.  I've turned it off for now.  We'll see.

Debugging any application is a hit more miss effort.  Some folks have noticed a pattern where iPhone5 as the host may be part of the issue as it isn't as quick as newer phones.

The Swift2 porting seems straight forward.  I am trying to figure out how to get a pure standalone application running on the watch.  The goal is to demonstrate an application that continues to run in a controlled fashion when the phone is off or out of range.  I sort of have this working now (after the first launch of the application has completed while in range of the phone).

Sunday, July 5, 2015

Tried Flotation Therapy today!

I've been meaning to try flotation therapy for a while.  This is sometimes known as Sensory Deprivation, but I think flotation is more accurate.  Today was the day and I have to say, it met the hype!

Travelled up to Float Matrix in San Francisco today.  The appointment pretty much went to what is listed in their FAQ:

  • Watch the eating and drinking before the appointment
  • Arrive and take a deep exfoliating shower
  • The attendant guides you to your float pod -- you put in ear plugs
  • You get in and close the door and float on your back
  • An hour later they knock on the outside, you get out, take another shower and that's it
Anyway, the super dense Epsom Salt mix does several things:
  • Keeps you floating out of the water so your face is comfortably above water
  • Keeps your skin from getting wrinkles (salt balances)
  • Does a nice job of nourishing your skin (whatever epsom salts do)
  • Keeps the water fairly disinfected on its own
I liked it.  At the beginning, the ringing in my ears [even while in a basement, in an insulated box, with ear plugs in] was the major stimulus that remained.  Then a little vertigo; with no visual reference a slight tumbling sensation.  A very slight sensation. After a while, the vertigo and ringing subsided and I definitely felt my muscles relax -- lower back, neck, lower legs -- all sore from a hike yesterday.  And then a little later my mind did indeed calm down; stopped thinking about work and todo lists and the such and really started to enjoy to buoyancy, temperature, blackness, quiet, slow heartbeat.  The water density made it easy to float so could move arms a bit to stretch, legs, etc -- all without worrying about getting the liquid in eyes [it DOES sting I found out].

They have a nifty ventilation trick for the relatively humid air in the pod -- there is a high and low vent pipe to the outside that wind up allowing for a slight convection.  So when your head is at the far end of the pod, you get a soft flow of fresh air.  However, with the humidity, scentless epsom salts, temperature control, this was very comfortable -- no stuffed airways, no throat tickles.

Around the end I did almost doze off -- more like meditative state -- brain stopped, no motion, no sound, touch, etc.  This is the goal -- and probably why they have 90 minute sessions too.

I came out of the place nice and relaxed, joints feel good and so on.  I think I'll work to make this a regular visit.

Saturday, July 4, 2015

Build a countdown timer application

Well, here's another experiment just prior to flipping to WatchOS 2.  This application is a countdown timer that displays days/hours/minutes/seconds until a target time.

The application is mostly an exercise in date math, but it does highlight the limitations of the current OS -- that being that the application is pretty much just a remote display from the phone.  e.g. this application will not start, nor update if the paired phone is not connected.

Some other observations:

  • Not quite sure how to ensure that the UI is updated with the exact countdown time prior to display.  These two behaviors seem a bit asynchronous.  The willActivate() method seems to be called a bit late, or the display update is latent.  I'm not going to worry too much until I flip over to WatchOS 2.
  • I need to do some work with resource bundles, property pages, etc.  Basically to make this application look a bit more production ready. 
  • Same thing with OS and hardware combinations.  I don't have a good feel how general these applications are; UI layout, properties, supported features, etc.  Some learning to do here.
Code is here.