Bluetooth connection - Raspberry Pi 3 B + with ios devices

Asked

Viewed 175 times

1

What is the procedure to enable Bluetooth from Raspberry Pi 3 B+ to send and receive data via bluetooth with Ios?

I developed an application, where through bluetooth (Bluez, Pybluez and bluetoothctl) Raspberry receives the network information and configures. For Android devices this worked perfectly. But when testing with Apple devices (Ios) bluetooth even on, it is not even detected. Someone would point out to me the procedure to enable the Raspberry pi 3 B+ to communicate with Ios?

Bluetooth is started, through shell script, as follows in the way:

bt-adapter --set Powered 1
bt-adapter --set DiscoverableTimeout 0
bt-adapter --set Discoverable 1
bt-adapter --set PairableTimeout 0
bt-adapter --set Pairable 1

The python script, responsible for handling the connection is as follows:

if __name__ == "__main__":
    server_sock = bluetooth.BluetoothSocket( bluetooth.RFCOMM  )
    server_sock.bind(('', bluetooth.PORT_ANY))
    server_sock.listen(1)
    port = server_sock.getsockname()[1]
    bluetooth.advertise_service( server_sock, 'Rasp WiFi Configurator', 
                service_id = uuid, service_classes = [uuid, bluetooth.SERIAL_PORT_CLASS], 
                profiles = [bluetooth.SERIAL_PORT_PROFILE])
    print('[INFO] Aguardando conexao bluetooth')
    client_sock, client_info = server_sock.accept()
    print('[INFO] Conexao aceita de {}'.format(client_info))
    client_sock.send(json.dumps(net_info))
    bl_man = threading.Thread(target = bluetooth_manager, args = (server_sock, client_sock,))
    bl_man.start()
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.