Hi,
I am new to Python and non-web programming. I am using pySerial in OSX 10.5.2 (Python 2.5) to access a bluetooth module that is mapped to a device file.
I can access the device with screen /dev/tty.BTdevice 115200 and I correctly get a stream of 3 digit numbers (data from a sensor). I wrote a Python script to read the numbers and print them.
My problem comes when I have a bug in my program or I don't close the serial object in the interactive mode, the terminal window freezes. If I press ctrl-C, it displays ^C and same with ctrl-D. A kill -9 <PID> doesn't do anything so it seems like a zombie process. I can close the terminal window, but the Python process gets a PPID of 1 and is still not able to be killed. If I ignore it and try screen /dev/tty.BTdevice 115200, screen freezes immediately (ctrl-A,ctrl-\ has no effect to exit the screen program). It seems the zombie process is holding the device file. The only fix I've found is to restart the computer. This is a drag for development.
Any thoughts? is it an OSX problem? I haven't been able to find much about problems with developing python with bluetooth/pyserial in OSX.
Any help is greatly appreciated!
thanks,
Jeff
I am new to Python and non-web programming. I am using pySerial in OSX 10.5.2 (Python 2.5) to access a bluetooth module that is mapped to a device file.
I can access the device with screen /dev/tty.BTdevice 115200 and I correctly get a stream of 3 digit numbers (data from a sensor). I wrote a Python script to read the numbers and print them.
My problem comes when I have a bug in my program or I don't close the serial object in the interactive mode, the terminal window freezes. If I press ctrl-C, it displays ^C and same with ctrl-D. A kill -9 <PID> doesn't do anything so it seems like a zombie process. I can close the terminal window, but the Python process gets a PPID of 1 and is still not able to be killed. If I ignore it and try screen /dev/tty.BTdevice 115200, screen freezes immediately (ctrl-A,ctrl-\ has no effect to exit the screen program). It seems the zombie process is holding the device file. The only fix I've found is to restart the computer. This is a drag for development.
Any thoughts? is it an OSX problem? I haven't been able to find much about problems with developing python with bluetooth/pyserial in OSX.
Any help is greatly appreciated!
thanks,
Jeff
Comment