2

What is the procedure to enable Raspberry Pi 3 B+ for send and receive data with IoS Devices?

I developed an application, that enables the raspberry bluetooth to receive network configurations and configure itself (Using Bluez, Pybluez, and bluetoothctl). For Android devices, this works perfectly. But for Apple Devices (IoS) the raspberry Bluetooth can't even be detected. Someone can help me with the procedure to enable the Raspberry Pi 3 B + to communicate with the IoS?

The Bluetooth is started, through a shell script as follow:

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 ptyhon script, which is responsible to deal with the bluetooth connection and information reception, is demonstrate bellow:

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()

0 Answers0