5 ms·
Okay so I'm implementing a device which connects to Wifi, and I'm using BLE to hand off Wifi creds from a phone app to the device. This is based on the esp32 ch
by bschwindHN 9y ago
Okay so I'm implementing a device which connects to Wifi, and I'm using BLE to hand off Wifi creds from a phone app to the device. This is based on the esp32 chip. They actually have something similar to what I described that they call "blufi" but it's poorly documented and seems difficult to use:
http://esp-idf.readthedocs.io/en/latest/api-reference/bluetooth/esp_blufi.html http://esp-idf.readthedocs.io/en/latest/api-reference/blueto...
Right now I'm just using the "just works" pairing as you've described. A QR code might be a good addition to that, though the product then needs a unique sticker for each device which is kinda lame. Without the QR code, the threat model is basically someone eavesdropping on the connection and discovering the Wifi credentials when the user first sets up the device. Not the worst but still not great...
- StavrosK 9y agoWhy use BLE instead of wifi? That's what most devices do (especially with the ESP8266, which doesn't support BLE).
- bschwindHN 9y agoThat's a good question, actually. As far as I'm aware, it's not particularly well supported to programmatically connect to another access point, but that may have changed recently. But that aside, using BLE seems like a better user experience. There's no changing of the user's currently connected access point, and it _might_ be faster, though I haven't tested. If I can make the setup over Wifi completely transparent to the user then that would be acceptable for me. I actually don't own any ESP8266-based devices, maybe I should buy one and see how it is.
- StavrosK 9y agoI don't think the ESP8266 wifi story is different from the ESP32, but it might be. You do have to connect to another access point, yes, but if you have an Android app, the app can handle that itself. I think the iOS UX is a bit worse, though, so BLE might be worth it there. A lot of firmware for the ESP8266 has been using the access point method, and it's worked great all the times I've tried it.
- bschwindHN 9y agoYeah the Wifi story is pretty much the same between the two chips. I agree about Android, I don't think I'd have much problem configuring it there, but my first focus is on iOS. There seems to be some better support for that in iOS 11 though: https://developer.apple.com/library/content/qa/qa1942/_index.html https://developer.apple.com/library/content/qa/qa1942/_index... So that might be a good option in the near future!
- StavrosK 9y agoAh, great, because when I last looked at an iOS device, the user had to switch between the WiFi network manually, which was a hassle.
- danesparza 9y agoI would think power consumption would come into play, considering the safe is most likely not constantly connected to power. BLE is an order of magnitude more efficient with power than Wifi is: https://www.digikey.com/en/articles/techzone/2011/aug/comparing-low-power-wireless-technologies https://www.digikey.com/en/articles/techzone/2011/aug/compar...
- StavrosK 9y agoI was talking about the grandparent comment, not the article.