Setting Up iOS Bluetooth PacketLogger in Xcode

iOS has two ways to see Bluetooth packets. One involves capturing a log file by triggering sysdiagnose and the other allows for live capture – you can see the announcement in “What’s New in Core Bluetooth” from WWDC 2019, especially “how to debug your Core Bluetooth communication with the improvements to PacketLogger” https://developer.apple.com/videos/play/wwdc2019/901

Either way (logged or live), you’ll first need to install a “logging profile” on your iOS device before you can proceed. To do so, navigate to https://developer.apple.com/bug-reporting/profiles-and-logs/ and scroll down to “Bluetooth for iOS.” Click on the Instructions link and log in with your Developer account if needed. Follow the instructions to install the logging profile to your iPhone. Note that the profile will expire after three days.

When installed properly, it will appear under Settings > General > VPN & Device Management, e.g.:

Tapping on the profile reveals additional details:

Connect your iPhone to your MacBook if you haven’t already.

Next, you’ll need to set up live logging with Xcode.

Live logging is provided by PacketLogger, which is not bundled with Xcode by default. To get PacketLogger, navigate to https://developer.apple.com/download/all/?q=for%20Xcode and search for the “Additional Tools” download link for your version of Xcode (e.g. 12.5), and download and open the dmg file. To get a specific tool to appear under Xcode > Open Developer Tool, copy it into /Applications/Xcode.app/Contents/Applications. Don’t copy or create any folders there – Xcode won’t be able to open those from the menu. You’ll want to copy the individual tools you want to appear on the menu one at a time.If you had Xcode open, you’ll need to restart it to see the tool(s) you’ve added.

You can then access PacketLogger from the Xcode menu, ala:

And then you’re in! Live logging kicks off automatically:

Happy Bluetooth Debugging!

Logitech Circle View Doorbell – Mixed Bag So Far

We replaced our indoor-camera-pointing-outdoors and conventional doorbell with a Logitech Circle View Doorbell. We chose it based on its tight HomeKit integration including the promise of HomeKit Secure Video (just in case package thieves rear their ugly heads again here.)

The unboxing and hardware installation were a snap. Their online manual / installation guide took me step by step through the process and the kit had everything I needed (well, except a super small screwdriver), including little labels for the wire jumpers that needed to be connected to our existing standard chimes. Here’s what the indoor chime unit looked like at the end – nice and clean – the little box on top is the Logitech controller:

And here’s what the outdoor unit looks like – also a nice and clean install:

But with the hardware settled, things started to go off the rails when dealing with the software – starting with when I attempted to add the accessory to our Home – I got this:

Some searching revealed I wasn’t the only one with this problem. I didn’t keep close track at this point, but one of these two things I did got me past that. It was either 1) unplugging the HomePod in the kitchen so that the living room Apple TV could be the “Connected” Home Hub (in the Home app > Home icon > Home Settings > Home Hubs & Bridges or 2) doing a hard reset of the Doorbell (apply external USB power while holding down the doorbell button and keep holding it for 15 seconds)

After doing that I was able to add the Doorbell and get video just as a delivery arrived

We even briefly enjoyed seeing a picture-in-picture image of someone who rang the bell appear on our television, thanks to the Apple TV integration. (Unfortunately I did not get a picture of that.)

But then back in the weeds again. That picture-in-picture feature hasn’t worked since then, and HomeKit Secure Video won’t set up. We are stuck with “This camera is not set to record.” And one of the HomePods has taken over the Home Hub role again (there are no controls given to set which device acts as the Connected Home Hub – you get what you get)

Apparently the next thing to try is turning off our two WiFi connected HomePods and an upstairs WiFi connected AppleTV to avoid them being the “Connected” Home Hub. Or, set up a new 2.4 GHz WiFi for the devices (our Comcast access point doesn’t allow turning off the 5 GHz radio unfortunately, and it shares the same SSID and password as the 2.4 GHz network, which apparently can cause problems.) I don’t really feel like doing that just yet, so I’m going to do some more searching.

So, stay tuned, – it’s another untidy tale of integrating a new wireless device into a system.

Expanded mmWave Support for iPhone 13 5G

Apple’s September 14th event introduced the new iPhone 13 and what caught my attention was a brief mention by Tim Cook of “new bands and antennas” for the iPhone 12 successor. Looking more closely at the specs shows that the iPhone 13 adds support for 26 GHz mmWave (n258), which builds on the 28 GHz and 39 GHz support (n261 and n260, respectively) my iPhone 12 Pro Max has.

I spent a lot of time characterizing mmWave performance during my LMDS days at Wavtrace, and I can tell you that rain and foliage are not kind to the higher frequencies, so the inclusion of 26 GHz in the new phones should make mmWave 5G more likely to work well especially as Seattle turns toward the rainy season.

Ah, Wavtrace. Good times that ultimately weren’t meant to be as LMDS never got a foothold.

I’m going to have to write a post about my experiences in mmWave work there. Will do so soon.

Returning to the Apple event, I was also happy to hear that the 13 would have extended battery life. Always a good thing for wireless/mobile devices 🙂

Net net: Nice to see the band getting use finally.

PunchThrough’s Ultimate Bluetooth Guide for iOS

I just came across this wonderfully detailed guide to iOS CoreBluetooth written by Gretchen Walker of PunchThrough. It goes into the details any iOS developer should try to keep in mind when integrating with Bluetooth devices. It is very much worth bookmarking and referring back to.

I also heartily recommend their wonderful iOS app for debugging your Bluetooth peripherals and the environment they’re operating in. I use it frequently.

iPhone, iPad and Apple Watch Radio Subsystems (Index)

This post serves as a brief summary of the technical specifications of the many radios in the Phone, iPad and the Apple Watch and as index for easier deeper exploration into each. Most of these are very broad categories (for example, there are many types of Bluetooth with differing data rates) and I’ll be linking each of these to more detailed breakdowns. 

Sorted by Range (Shortest to Longest)

NFC (Near Field Communication)

  • Availability: iPhone, Apple Watch
  • Range: 0.1 m
  • Frequency: 13.5 MHz
  • Data Rate: 0.4 Mbps
  • Docs: Core NFC

Bluetooth

UWB (Ultra Wide Band)

  • Availability: iPhone 11 or 12, Apple Watch Series 6
  • Range: 50 m
  • Frequency: 3.1 – 10.6 GHz
  • Data Rate: 100 Mbps
  • Docs: Nearby Interaction

WiFi

  • Availability: iPhone, iPad and Apple Watch
  • Range: 125 m
  • Frequency: 2.4 GHz and 5 GHz
  • Data Rate: Up to 866 Mbps

Cellular: 5G

  • Availability: iPhone, iPads (if equipped)
  • Range: 300 m
  • Frequency: 30 GHz – 300 GHz
  • Data Rate: 70 – 400 Mbps or faster

Cellular: 4G, LTE

  • Availability: iPhone, iPads (if equipped), Apple Watch (if equipped)
  • Range: 15 km
  • Frequency: 700 MHz, 1700 – 2100 MHz, 1900 MHz, 2500 – 2700 MHz
  • Data Rate: 10 – 50 Mbps or faster

GPS (Global Positioning System)

  • Availability: iPhone, iPad (if equipped) and Apple Watch
  • Range: 20 km
  • Frequency: 1575 MHz, 1227 MHz, 1176 MHz
  • Data Rate: 50 bps
  • Note: GLONASS and Galileo are also supported

My LiveWire is Due for Its 1K Service

It’s an electric motorcycle… but it still needs an oil change 🙂

The spiral bevel gear primary drive (that rotates the motor output through 90 degrees to the belt drive) gets a special gear oil replacement after the first 1000 miles. Here’s a cool video of what my LiveWire, “ELVIRA” will be getting done next week:

ELVIRA” – see what I did there? 🙂