0

I am struggling with how to receive data on a RPi 3 (Model B Plus Rev 1.3) from a bluetooth connected 'sender' device (a BT-enabled scale).

When I pair and connect the 'sender' device by bluetooth I get the message 'serial interface on WT11i-A is now available through /dev/rfcomm1'

And indeed the 'sender' device seems to be connected ok: enter image description here

The RPi also seems to be sending/receiving data somehow: enter image description here

When I press the button on the sender device which sends data the 'B/s' values next to the data activity icons in the right bottom corner go up to values like 200-500 B/s.

Under local services it is indicated that the data is supposed to land in downloads: enter image description here and under 'Receiving Files (Object Push)' the 'Accept files from trusted devices' option is checked.

RFCOMM shows: enter image description here

I have also tried running the following Python code:

import bluetooth

#00:07:80:E0:A4:FC host = "" port = 1105 server = bluetooth.BluetoothSocket(bluetooth.RFCOMM) print('Bluetooth Socket Created')

try: server.bind((host, port)) print("Bluetooth Binding Completed") except: print("Bluetooth Binding Failed")

server.listen(1105)

try: client, address = server.accept() print("Connected to: ", address) print("Client: ", client) except Exception as e: print (str(e))

try: while True: data = client.recv(1) print(data) client.send(data) except: client.close() server.close()

The code hangs and after ctrl-c I get the following message: enter image description here I have googled: "/usr/lib/python2.7/dist-packages/bluetooth/bluez.py", line 167, in accept client, addr = self._sock.accept () but find nothing that I am able to comprehend.

Also: on my Android phone I am using the Serial Bluetooth app ( https://play.google.com/store/apps/deta ... e_CH&gl=US ) and it works fine, meaning the sender device is sending the data to the phone as required.

I see however no data in 'downloads' nor under 'tmp' and I am quite lost at this point

Suggestions/assistance is greatly appreciated.

1 Answers1

0

After a long journey the conclusion is: dont connect using RFCOMM. Instead I got the solution working very easily with bluedot ( https://bluedot.readthedocs.io/en/latest/btcommapi.html#bluetoothclient ).

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. – Community Dec 17 '21 at 18:23