0

I am trying to set up an IoT device using a Raspberry Pi 3A+. I want the Pi to connect to WiFi, so for this I set up an access point on which the WiFi credentials can be sent. The issue is finding this access point, as iOS does not allow scanning for available WiFi networks (bear in mind, this needs to work with multiple devices, so I cannot use a predetermined SSID).

I have tried to solve this using Bluetooth a Bluetooth server that has the name of the access point's SSID. While this works fine for Android, iOS devices are never able to detect the server. For setting up the Bluetooth server, I use the following:

$ sudo bluetoothctl
[bluetoothctl]# serial-alias <ACCESS POINT SSID>
[bluetoothctl]# menu scan
[bluetoothctl]# transport le
[bluetoothctl]# back
[bluetoothctl]# discoverable on

In /etc/bluetooth/main.conf I have set DiscoverableTimeout = 900 and ControllerMode = le.

I hope someone can help me figure out how to setup the Bluetooth server properly. It only needs to be detectable and nothing more.

2
  • Thanks, that looks very promising. I will try it out.
    – asgerius
    Jul 28 at 9:34
  • @ukBaz: Perhaps consider making your comment(s) an answer?
    – Seamus
    Jul 29 at 20:07
0

There is an example of setting up a BlueZ GATT server at:

https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-gatt-server

You will also need to create an advertisement so that it can be discovered. There is an example advertisement in the BlueZ tree at:

https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-advertisement

The documentation for the various APIs are at:

https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.