Environment: Ubuntu 14.04 running in vmplayer.
in PyBluez Example, rfcomm-server.py, Problem with running RFCOMM server on PORT_ANY
code chunk:
from bluetooth import *
erver_sock=BluetoothSocket( RFCOMM )
server_sock.bind(("",PORT_ANY))
server_sock.listen(1)
I always get _bluetooth.error: (98, 'Address already in use') in the bind operation.
This thread shows to disable pnat and it works. my questions are
In this case, how do I know which service is using the RFCOMM channel? is there command to list them?
sdptool browse local
doesn't show that channel 1 is in use.
- after disabling pnat in /etc/bluetooth/main.config, channel 1 seems released and I can run rfcomm-server.py without problem. However, even if I roll back by comment out the line "DisablePlugins = pnat" and restart bluetooth service again, channel 1 of RFCOMM is not occupied anymore!