Joseph,
I find the following two lines in your MATLAB code confusing.
echotcpip('on',prt)
t = tcpip('localhost',prt,'Timeout',2); % open port on 4012
It seems to me that you are starting an echo server in MATLAB and then creating a connection to the echo server. The bytes available is always zero because you are reading from the echo server, and the echo server will only send data in response to a message.
You aren't connecting to Python. I'm assuming that the bridge.py script is the process that you are expecting to read from. But, I'm not sure what the script is doing, and I'm not sure how you are expecting to setup the connection.
You should think more about the network roles of the components. It seems to me that the bridge.py script should be the server and MATLAB the client. In this case, you should remove the echotcpip call and launch the Python script before attempting to connect from MATLAB (call to tcpip ).
To create a socket server in Python, you must perform the sequence socket(), bind(), listen(), accept(). See the example in the socket documentation.
