It just prints "None" twice a second, LOL. Still no data printed when sending from phone. I know the data is going from the phone to the RPi though - loading one of my other previous scripts does print the data on the screen (the one with all the open/close ropey code in it that would eventually hang up somewhere).
How is the while 1 loop getting the "msg" data from within the comm_mon thread? If I were to guess, the data for "print msg" is coming from the first line of code rather than from within the comm_mon thread function.
- Code: Select all
msg = None
conn = serial.Serial("/dev/rfcomm0", baudrate=9600)
global conn, msg
msg = conn.readline().strip("\n")
t = threading.Thread(target=comm_mon)