Flic for Mac?

Hi,

Today we are trying something new. We have since the very first release of Flic received a lot of requests from you about using Flic on other devices than their smartphones. While we have had a beta version of a Linux SDK up for a while, Mac support is something we have always wanted to do.

Unfortunately we do not have the development recourses in order to expand our main application to multiple platforms. This has been bothering us since we know that we, and our customers, are missing out on potentially good use cases. It was due to this that we asked ourself a few days ago wether or not we could add Mac support within just a few days of work. The answer to that question turned out to be “Yes, if we cut the application down to an absolute bare minimum and let our users create the actions on their own”.

So, today we are taking our first small step towards Flic compatibility on Mac OSX with an application that we call HaxWithFlic. This application is very simple and in fact, on its own, does not do much at all. The only thing the app will let you do is to use Flic to trigger scripts on your computer. That’s it, no fancy UI, no user log in, no actions.

This application is available for download on GitHub along with a few sample scripts that we have added to get you going. We kindly ask you to submit your comments/suggestions/issues on GitHub rather than sending in support mails so that we can better keep track of it. You are also welcome to discuss it here on the forum as well. Please note that the application is in an Alpha stage and its functionality in upcoming versions may change without notice. While we do realize that this type of application is not for everyone, we still hope that it will be useful to as many of you as possible. Also, this should work perfectly fine with any Flic button, regardless of the batch it originates from.

Thanks,
Anton @ the Flic team


HaxWithFlic Requirements and Instructions

This app requires OSX 10.10 or above operating systems running on a machine that supports Bluetooth Low Energy. A Bluetooth Low Energy compatible USB dongle can in some cases work as well. Once installed, this application will allow you to connect one Flic button to your Mac computer and then select which scripts that you wish to execute on click, double click, hold, up and down.

Important notice:

Since this application will blindly execute the scripts that you tell it to execute, it is very important that you make sure that you know what these scripts do. You need to verify, or have verified by someone who you trust, that the code being executed is not malicious in any way. We will not take responsibility for any harm that you may cause to your machine.

Supported script files

The following files are supported:

  • Automator workflows (.workflow)
  • All other files that are executable (chmod +x a_script.py) and contains a shebang on its first line (#!/some/path)

Some examples of supported files:

  • AppleScript – .scpt, .AppleScript#!/usr/bin/osascript
  • Shell Script – .sh#!/bin/sh
  • Ruby Script – .rb#!/usr/bin/env ruby
  • Python Script – .py#!/usr/bin/env python

This can of course vary a bit depending on how your Mac is configured.

Installation

  1. Download the repository by pressing the “Download ZIP” button.
  2. Mount the dmg file and drag and drop the HaxWithFlic.app to your applications folder.
  3. When launching the application from the applications folder the first time it will ask you if you want to open a file that was downloaded from the internet. Press open.
  4. Press on the flic icon in the menu bar and start using the application. For example, press scan if you want to add a new Flic.

Configuration

  1. Press “Configure scripts..”.
  2. Add search paths to the scripts you want to launch.

Please note that some actions (like window resizing) requires that you add HackWithFlic to the accessibility list under the privacy settings of your mac. By default the app plays audio notifications on button presses, but these can be turned off by unchecking the “Play audio” option. If you are using the button for tasks that require very low latency then you can lower the latency by checking the “Low latency mode” option, but remember that this will decrease the battery life of your Flic significantly. The low latency mode reduces the latency down to 45ms from the normal 280ms. Notice, however, that these are worst case times and that the expected time is about half of that. The button down event always arrives before any other event, so it can be used for time critical applications.

Zapier makes Flic control over 500 web apps – a walkthrough

Did you know Flic can control over 500 apps using Zapier?

Flic is live on Zapier since a while ago and is used by heaps of Flicers every day. Chances are, if you thought about anything you want to do with Flic that is not yet available in the Flic App, you can do it with Zapier.

Say, for example, that you want to click a Flic in your car every time you see something interesting on your roadtrip. You need to save the time and position of each click into a Google spreadsheet.

Here is a walkthrough of how to set that up.

Set up your Flic

alt text

alt text

alt text

alt text

alt text

Set up Zapier for Flic

Now, head to Zapier and create an account. Once logged in, time to make a Zap!

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

https://i.imgur.com/DSwfGIG.png?1

alt text

Set up your Zapier Action

Now your Flic is connected to Zapier! Time to decide what will actually happen when you click that Flic. Feel free to explore the Zapbook for over 500 different apps and endless possibilities.

Every time Flic ic clicked, Flic provides Zapier with four data points you can use in your Zaps:

  • Clicked At -Date and time of the click
  • Click Type – Click, double click or hold.
  • Longitude – optional GPS coordinate
  • Latitude – optional GPS coordinate

The longitude and latitude data is provided if you select “Send location data” in the Flic App.

To finish off my example of populating a Google spreadsheet, here is how to continue:

Select Google Sheets as an Action App
alt text

alt text

Go and create a new spreadsheet in Google Drive. I named mine “Flic Presses” and added three column headers: Pressed At, Longitude and Latitude.

Select your spreadsheet and add the Flic data to each of the columns:
alt text

That’s it! Make sure to turn your Zap ON in the top of the last screen:
https://i.imgur.com/ntu9Upl.png?1

Thanks for reading and if you find something fun, make sure to share your creativity in the Flic User stories section.

Joacim

The First Batch – A lesson learnt about hardware and early assumptions.

This Blog post was covered in The Verge Apr 19, 2016 [link]

The very first batch of Flic we created cannot be firmware updated. Unfortunately, this means that they are not future proof and cannot be used with much of the new functionality we are providing. That sucks.

The First Batch is the most important batch

Shortcut Labs is the first company we (ok, most of us) ever ran and Flic is our first product. We are a young startup with young employees and management, without any real experience in creating connected hardware products. Even though Flic is “just a button”, creating it has been far more challenging than we could have imagined.

The crowdfunding campaign we ran for Flic became one of the most successful in the Nordics. Thousands of people supported us just the first days of the campaign, believing in the idea and believing in us to make it happen. They put their real money at stake, at high risk.

These are the people that believe in technology, who are proud to support startups and that tell their friends about it. They spread the word and people listen when they talk. They are the seeds in grass root financing.

Yet these people, the early adopters, are the ones that we and many other crowdfunding projects manage to disappoint, over and over again. This is because they are the ones who suffer most from delays and because they are the ones that will receive the first batch.

Component cost googling

When trying to launch a hardware product for the first time, you need to do early cost estimates. It starts with component cost and an estimation of the price of each component. In the later stages of the design cycle you can quote factories about volume prices and delivery times for all the finalized components required to get a far more accurate cost estimate. But way before that you may do as we did, google component costs. Try to avoid that and more importantly: don’t trust it.

We calculated the maximum acceptable cost for manufacturing Flic, knowing that we had to stay under that figure to make a viable business out of the product. We googled component prices and got a basic understanding.

Memory, as it turned out, is one of the most expensive components in our design as the component size needed to be minimal to fit our very compact PCB.

From googling we quickly understood that doubling the memory capacity doubles the price.

We knew the memory size was needed for the firmware and some space for optimizations. With that memory space, we could update all the most important parameters such as connection time intervals and power saving algorithms, while still leaving some space available for the Flic buttons to remember which phones they are allowed to connect to. But to update the entire firmware from scratch, we would need to double the memory space.

Our lead engineer was clear: if we don’t get the larger memory we can’t completely update the product.

But why would we ever need to completely refresh the firmware? The core functionality was well tested, bug-free and all optimization parameters could still be updated. The functionality is so simple, just send a single event to a known host when you get clicked! Plus, we did not anticipate, nor did we promise, that Flic would get more core functionality over time (integrations on the App side, e.g. Actions, we would still be able to update).
Doubling the memory would double that components price based on our Google research, which would add around $4 USD to the total retail price.

The technology was supposed to be future proof

Flic makes use of Bluetooth Low Energy, which is an integral part of Bluetooth 4.0. When the idea of Flic was first conceived in 2012, this technology practically only existed on paper. Two years later as we were finalizing the design, Bluetooth Low Energy was built into every new smartphone and tablet on the market.

Google Android 6.0 Marshmallow is the first OS to implement Bluetooth 4.1. Differences from Bluetooth 4.0 are minimal.

The Marshmallow release was perfectly timed with the First Batch being shipped out.

In BT 4.0 a few bits in the pairing setup were reserved for future use. These parameters were supposed to be ignored since they could end up being used in future protocol specifications. In the core Bluetooth stack implementation in the chip, a code licensed by a third party provider, these ignored bits were not parsed correctly.

They were not ignored, they were null.

While that ridiculously small difference made no impact before, it suddenly caused all pairing attempts between new Android devices and Flic to fail. We noticed this as our first batch was just sent out. We asked our backers to not upgrade to Android 6.0 until we worked out a solution.

We also asked if anyone knew someone on the Android team who could help us out. Just a couple of hours later, we were introduced to the right guy at Google (the power of our community!) who helped us out and patched Android for Flic, basically whitelisting the Bluetooth MAC range of that batch. In Android 6.0.1 and future revisions, that First Batch still works.

How could we not have noticed before, in beta versions of Android 6? Mysteriously, the MAC range used by the development boards from our chip provider was already whitelisted in Android. No one knows why.

A quick reaction

From our side, the patch to fix the error was simple and we immediately patched future versions of Flic from the factory. The First Batch was not malfunctioning thanks to our friends at Google. But we also came to think about something.

Did we ever really check the actual price of that double memory component that would allow us to update the firmware of new Flics?

Turns out a double memory size is not equal to double cost. Quite the opposite, the price difference is only marginal when quoted by professionals. We quickly bought tens of thousands of the bigger memory, sold our current stock of the smaller memory and wrote the code to be able to update Flic over the air. Just to be on the safe side, if anything like this would happen again.

Unchallenged early assumptions

The false assumption that double memory equals double price caused a lot of trouble, not only for us but for our most important customers. It was also, in retrospect, stupid of us to not believe that full software updates would be necessary when dealing with a brand new technology.

We had another unfortunate early assumption that today really affects that important Fist Batch. We “knew from the beginning” that we would not be able to start Siri on iOS with Flic. Apple did not allow that kind of functionality using the custom Bluetooth profile and App connection that we had to create to make Flic what it is.

Turns out they changed that a while ago and that Flic, with a firmware upgrade, could implement new Bluetooth profiles with a (very!) clever code switching algorithm that our brilliant engineers invented. As of our Flic App 2.0 release earlier this week, Siri and many new functionalities that we assumed would be impossible are now possible.

But not if your Flic is from the First Batch with the smaller memory chip.

Thank you for reading, I hope you enjoyed a bit of insight to our challenges. If you are part of our First Batch, please find a kind offer for new Flics in your email inbox.

Joacim