Jump to content

Bluetooth


Jay

Recommended Posts

Hallo,

 

ich versuche eine Bluetooth Verbindung zwischen dem Red Brick und einem Android Smartphone herzustellen. Sobal Android aber einen RFCOMM Socket aufbauen möchte friert das System auf dem Red Brick ein. Ich habe es auf dem Brick mit NodeJS (Noble) und Python (PyBluez) probiert. Aber selbst mit bluetoothctl kommt es zum freeze.

 

Hat jemand Erfahrung mit Bluetooth auf dem Red Brick und kann mir weiterhelfen?

 

Ich benutze den Asus Adapter USB-BT400.

Hier ein Auszug aus der syslog kurz vor dem crash:

11086 Mar 14 13:52:38 red-brick dbus[349]: [system] Activating via systemd: service name='org.bluez' unit='dbus-org.bluez.service'
11087 Mar 14 13:52:38 red-brick bluetoothd[1724]: Bluetooth daemon 5.23
11088 Mar 14 13:52:38 red-brick dbus[349]: [system] Successfully activated service 'org.bluez'
11089 Mar 14 13:52:38 red-brick bluetoothd[1724]: Starting SDP server
11090 Mar 14 13:52:38 red-brick kernel: [  300.232581] Bluetooth: Core ver 2.16
11091 Mar 14 13:52:38 red-brick kernel: [  300.235025] NET: Registered protocol family 31
11092 Mar 14 13:52:38 red-brick kernel: [  300.235316] Bluetooth: HCI device and connection manager initialized
11093 Mar 14 13:52:38 red-brick kernel: [  300.235334] Bluetooth: HCI socket layer initialized
11094 Mar 14 13:52:38 red-brick kernel: [  300.235343] Bluetooth: L2CAP socket layer initialized
11095 Mar 14 13:52:38 red-brick kernel: [  300.235379] Bluetooth: SCO socket layer initialized
11096 Mar 14 13:52:38 red-brick kernel: [  300.268624] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
11097 Mar 14 13:52:38 red-brick kernel: [  300.268643] Bluetooth: BNEP filters: protocol multicast
11098 Mar 14 13:52:38 red-brick bluetoothd[1724]: Failed to open RFKILL control device
11099 Mar 14 13:52:38 red-brick bluetoothd[1724]: Bluetooth management interface 1.0 initialized
11100 Mar 14 13:52:38 red-brick dbus[349]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
11101 Mar 14 13:52:38 red-brick systemd-hostnamed[1731]: Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!
11102 Mar 14 13:52:38 red-brick dbus[349]: [system] Successfully activated service 'org.freedesktop.hostname1'
11103 Mar 14 13:52:51 red-brick kernel: [  313.283288] usb 2-1.1: new full-speed USB device number 6 using sw-ohci
11104 Mar 14 13:52:51 red-brick kernel: [  313.492168] usbcore: registered new interface driver btusb
11105 Mar 14 13:52:51 red-brick bluetoothd[1724]: Sap driver initialization failed.
11106 Mar 14 13:52:51 red-brick bluetoothd[1724]: sap-server: Operation not permitted (1)
11107 Mar 14 13:53:01 red-brick CRON[1765]: (root) CMD (/sbin/fake-hwclock save)
11108 Mar 14 13:54:01 red-brick CRON[1847]: (root) CMD (/sbin/fake-hwclock save)
11109 Mar 14 13:55:01 red-brick CRON[1920]: (root) CMD (/sbin/fake-hwclock save)
11110 Mar 14 13:56:01 red-brick CRON[1982]: (root) CMD (/sbin/fake-hwclock save)
11111 Mar 14 13:57:01 red-brick CRON[2044]: (root) CMD (/sbin/fake-hwclock save)
11112 Mar 14 13:57:38 red-brick kernel: [  600.637360] Bluetooth: Wrong link type (-71)
11113 Mar 14 13:58:01 red-brick CRON[2106]: (root) CMD (/sbin/fake-hwclock save)
11114 Mar 14 13:58:05 red-brick kernel: [  627.056537] Bluetooth: Wrong link type (-71)
11115 Mar 14 13:58:07 red-brick syslog-ng[351]: syslog-ng starting up; version='3.5.6'
11116 Mar 14 13:58:01 red-brick systemd-modules-load[69]: Module 'fuse' is builtin
11117 Mar 14 13:58:01 red-brick systemd-modules-load[69]: Inserted module 'mali'
11118 Mar 14 13:58:01 red-brick systemd-modules-load[69]: Inserted module 'red_brick_uid'
11119 Mar 14 13:58:01 red-brick systemd-modules-load[69]: Inserted module 'g_red_brick'
11120 Mar 14 13:58:01 red-brick fake-hwclock[64]: Mon Mar 14 12:58:01 UTC 2016
11121 Mar 14 13:58:01 red-brick systemd-fsck[62]: RED-Brick-Linux: clean, 213586/458752 files, 1116411/1832448 blocks
11122 Mar 14 13:58:01 red-brick hdparm[93]: Setting parameters of disc: (none).
11123 Mar 14 13:58:03 red-brick keyboard-setup[94]: Setting preliminary keymap...done.
11124 Mar 14 13:58:03 red-brick kbd[191]: Setting console screen modes.
11125 Mar 14 13:58:03 red-brick kbd[191]: setterm: $TERM is not defined.

 

Android Code:

protected void onStart() {
[...]
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(MAC);
mConnectThread = new ConnectThread(device);
mConnectThread.start();
}

public synchronized void connected(BluetoothSocket socket, BluetoothDevice  device) {
// Start the thread to manage the connection and perform transmissions
mConnectedThread = new ConnectedThread(socket);
mConnectedThread.start();
}

private class ConnectThread extends Thread {
private final BluetoothSocket mmSocket;
private final BluetoothDevice mmDevice;

public ConnectThread(BluetoothDevice device) {
	// Use a temporary object that is later assigned to mmSocket,
	// because mmSocket is final
	BluetoothSocket tmp = null;
	mmDevice = device;

	// Get a BluetoothSocket to connect with the given BluetoothDevice
	try {
		// MY_UUID is the app's UUID string,  also used by the server code
		tmp = device.createRfcommSocketToServiceRecord(mUUID);
	} catch (IOException e) { }
	mmSocket = tmp;
}
}

 

Edit:

Mittlerweile konnte ich herausfinden, dass das Problem auftritt, wenn der Bluetooth-Daemon (bluetoothd) mit dem Parameter -C gestartet wird (compatibility Modus).

Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...