IoT device setup: easy until it’s not

Internet-connected devices are increasingly supplied without a USB tethering option. While I presume this cuts down on manufacturing complexity and improves form factor, the wifi setup user experience is often terrible.

I recently acquired a FitBit Aria scale which has the completely undocumented quirk of only being able to connect to 802.11b wifi. My router defaults to n. I had to dig through the router settings and enable dual-band. There is absolutely no way a muggle would ever figure this out.

To compound the issue, their activation API was suffering a bug that returned a cryptic JSON error when using a Mac or iOS Safari to register the scales. I have no Wintel, so I finally got it working using iOS Chrome.

Googling revealed loads of posts by angry consumers who had returned the product as defective. I wonder how much this poor design choice cost FitBit’s bottom line? Omitting a USB setup option might have seemed clever but it backfired badly – perhaps it would have been fine if their wifi onboarding experience wasn’t so flawed.

And after enabling dual-band support on my router my Kindle Paperwhite would no longer connect to the wifi network. I had to manually enable WPS discovery mode on the router to pair it again. Oy!

byobu and tmux plugin manager (tpm)

It seems that byobu triggers a known bug with tpm which then fails to load any plugins. Fortunately there is a simple fix, in byobu’s .tmux.conf change your plugin formatting like so:

set -g @tpm_plugins ' \
 tmux-plugins/tpm \
 nhdaly/tmux-better-mouse-mode \
 tmux-plugins/tmux-resurrect \

If using the XDG directory convention, this line is also needed in .tmux.conf:

set-environment -g TMUX_PLUGIN_MANAGER_PATH "~/.config/byobu/plugins/"


neovim: macos tmux and netrw/vinegar clipboard errors

So it looks like MacOS Sierra broke pbcopy/pbpaste for tmux. This manifests as clipboard errors when using netrw/vinegar in neovim under tmux. (Dunno why netrw is writing to the clipboard but anyways).

The solution is to use Homebrew to reinstall a patched version of reattach-to-user-namespace:

brew uninstall reattach-to-user-namespace
brew install reattach-to-user-namespace --with-wrap-pbcopy-and-pbpaste

Although this was annoying, it did lead to running brew cleanup which reclaimed 3.8GB of disk space. Jinkies!

vim: render plantuml

When using the plugin plantuml-syntax, add the following one-liner in .vimrc to render a PNG in the current directory when ‹leader›e is pressed:

autocmd FileType plantuml nnoremap  e :!java -jar ~/bin/plantuml.jar -o %:p:h %

This assumes Linux and that plantuml.jar lives in ~/bin. If working from a Dropbox directory, the image can then easily be viewed in a web browser.