Skip to content
This repository has been archived by the owner on Dec 8, 2019. It is now read-only.

Replace pairing over Wi-Fi hotspot with Bluetooth Low Energy #15

Merged
merged 17 commits into from
Apr 5, 2019
Merged

Replace pairing over Wi-Fi hotspot with Bluetooth Low Energy #15

merged 17 commits into from
Apr 5, 2019

Conversation

davidknezic
Copy link
Member

@davidknezic davidknezic commented Apr 1, 2019

The currently implemented Wi-Fi hotspot-based pairing mechanism is extremely unreliable. As it turns out, this is due to several reasons, one of the most important ones being that the Raspberry Pi Wi-Fi chip only supported the hotspot and normal Wi-Fi connection to be on the same channel. It also doesn't support Channel Switch Announcments (CSA). This leads to a very clumsy UX, also because iOS needs to prompt the user every time a Wi-Fi connection is made from an app on their behalf.

This is why this PR introduces BLE-based pairing.

It introduces a BLE service called Candy:

CA000000-75dd-4a0e-b688-66b7df342cc6

That service provides the following characteristics:

candyServiceUuid
networkAvailabilityStatus
ipAddress
wifiScanList
wifiSsidString
wifiPskString
wifiConnectSignal

Those characteristics allow an app to discover Candy Dispensers nearby, list the Wi-Fi networks they can reach, to instruct them to connect to a Wi-Fi and to get status information.

The GATT service can be tested though the LightBlue app.

LightBlue Candy Dispenser

@davidknezic davidknezic merged commit f71b800 into the-lightning-land:master Apr 5, 2019
@davidknezic davidknezic deleted the bluetooth branch April 5, 2019 01:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant