Connecting Master HC-05 to PyBluez Slave Ubuntu Server

Hello,
Please see https://arduino.stackexchange.com/questions/53677/connect-hc-05-client-to-pybluez-server-ubuntu for more info.

I have a PyBluez Ubuntu server waiting for a connection from a Bluetooth device.

I am running this list of AT commands from my HC-05 serial terminal (connected through Arduino) but cannot seem to make a connection with my server.

AT+INIT
--OK
AT+CMODE=1
--OK
AT+ROLE=1
--OK
AT+IAC?
-- +IAC:9e8b33
AT+INQM?
-- +INQM:1,1,48
AT+INQ
-- +INQ:A088:69:7016DC,C010C,7FFF
AT+INQC
-- OK
AT+FSAD=A088,69,7016DC
-- OK
AT+LINK=A088,69,7016DC
-- FAIL
-- +INQ:A088:69:7016DC,C010C,7FFF
-- OK

Has anyone done a project similar to this with any success?

I have done a project where the HC-05 is the server (slave) and the Ubuntu PyBluez connects as a client and sends messages, but for this project I think it makes more sense conceptually to have the Ubuntu PC as a data-crunching server that the Arduino calls to as a master through the HC-05 chip.

The source code for my PyBluez server is on the StackExchange page. I feel like this should be fairly elementary yet I have been struggling with it for the better part of a week.

jackfrye:
I think it makes more sense conceptually to have the Ubuntu PC as a data-crunching server that the Arduino calls to as a master through the HC-05 chip.

I think the matter of master or slave is merely a matter of which end establishes the connection. You have already made the connection.

This is the code that I have for establishing the connection from the host PC. This is verified and will work to establish the connection

from bluetooth import *

server_address = "00:14:03:06:10:8D"
port = 1

sock = BluetoothSocket(RFCOMM)
sock.connect((server_address, port))

take_in = True
while take_in:
message = raw_input()
sock.send(message)

if "0" in message:
take_in = False

sock.close()

The question I would have here is how to receive messages from the Arduino over HC-05 Bluetooth connection. The hope would be that the Ubuntu PC would take data from sensors and process it then send a response back to the Arduino. This program takes input from the keyboard until the user enters "0" on the Ubuntu PC and sends it to the Arduino, which has a program to print the received message to its own console. If we have any PyBluez experts in the forum, the question is: how can I send, stall, and wait to receive response from Arduino?