{"id":6509,"date":"2021-07-14T08:52:48","date_gmt":"2021-07-14T08:52:48","guid":{"rendered":"https:\/\/www.beaconzone.co.uk\/blog\/?p=6509"},"modified":"2021-07-14T08:52:49","modified_gmt":"2021-07-14T08:52:49","slug":"setting-up-wi-fi-via-bluetooth-le","status":"publish","type":"post","link":"https:\/\/www.beaconzone.co.uk\/blog\/setting-up-wi-fi-via-bluetooth-le\/","title":{"rendered":"Setting Up Wi-Fi via Bluetooth LE"},"content":{"rendered":"\n<p>Many gadgets and IoT devices need to connect to the Internet via WiFi. The problem is getting the WiFi credentials to the device when it isn&#8217;t connected yet. It\u2019s a \u2018chicken and egg\u2018 situation in that you need to connect to the device in order to set the WiFi settings but you can\u2019t connect because you aren\u2019t WiFi connected.<\/p>\n\n\n\n<p>The usual, but complex, way to solve this is for the device itself to initially act as a WiFi router in \u2018station mode\u2019 while the user on a phone, laptop or desktop connects and uses a web interface to set the WiFi settings and then reboot. After rebooting, it\u2019s not in station mode and instead connects to the assigned access point. The assigned local network DHCP IP address isn&#8217;t known to the user so they have to examine router settings or use some other contrived method to work out the URL to further administer the device.<\/p>\n\n\n\n<p>None of this is simple for most users so alternative mechanisms are preferable. We previously mentioned <a href=\"https:\/\/www.beaconzone.co.uk\/blog\/android-wifi-direct-via-bluetooth\/\">Android WiFi Direct via Bluetooth<\/a> and now there&#8217;s a new open standard, <a rel=\"noreferrer noopener\" href=\"https:\/\/www.improv-wifi.com\/\" target=\"_blank\">Improv<\/a>, for setting up Wi-Fi via Bluetooth LE.<\/p>\n\n\n\n<p>For Improv, the client (web or mobile) application sends the Wi-Fi credentials to the gadget via a defined Bluetooth LE Service (00467768-6228-2272-4663-277478268000). The device connects to the WiFi and returns a URL on the network that can be used to further administer the device.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/youtu.be\/AdCsX7Ni6Jc\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"338\" src=\"https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2021\/07\/improvbluetoothwifivideo.png\" alt=\"\" class=\"wp-image-6510\" srcset=\"https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2021\/07\/improvbluetoothwifivideo.png 598w, https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2021\/07\/improvbluetoothwifivideo-300x170.png 300w\" sizes=\"(max-width: 598px) 85vw, 598px\" \/><\/a><figcaption>How it works<\/figcaption><\/figure><\/div>\n\n\n\n<p>Under the hood, a Bluetooth Characteristic is used to send a RPC Command to set up the Wi-Fi settings. <\/p>\n\n\n\n<p>The <a href=\"https:\/\/www.improv-wifi.com\/code\/\" target=\"_blank\" rel=\"noreferrer noopener\">code area of the Improv site<\/a> has an SDK for JavaScript using Web Bluetooth and an SDK for Android. There&#8217;s also a device side <a href=\"https:\/\/www.esphome.io\/components\/esp32_improv.html\" target=\"_blank\" rel=\"noreferrer noopener\">library for ESP32 devices<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many gadgets and IoT devices need to connect to the Internet via WiFi. The problem is getting the WiFi credentials to the device when it isn&#8217;t connected yet. It\u2019s a \u2018chicken and egg\u2018 situation in that you need to connect to the device in order to set the WiFi settings but you can\u2019t connect because &hellip; <a href=\"https:\/\/www.beaconzone.co.uk\/blog\/setting-up-wi-fi-via-bluetooth-le\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Setting Up Wi-Fi via Bluetooth LE&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts\/6509"}],"collection":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=6509"}],"version-history":[{"count":5,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts\/6509\/revisions"}],"predecessor-version":[{"id":6517,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts\/6509\/revisions\/6517"}],"wp:attachment":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=6509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=6509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=6509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}