I am using a python script to access my NoIr Pi camera module via the "picamera" package. Yesterday everything was working fine.
Today everything is still working fine, however whenever I close my python scrpit, the red LED stays on, and it appears that the pi is still trying to use the camera.
When run my script again, it is unable to access the camera due to lack of resources (I.e the previous closed script still has access to the camera)
After a quick reboot I can run my script again, but its getting a little tedious having to reboot every time I make a change when trying to debug my script.
Update - Code as requested
fwidth = (351) // 32 * 32 fheight = (255) // 16 * 16 with picamera.PiCamera() as camera: with picamera.array.PiYUVArray(camera) as stream: stream = open('image.data', 'w+b') camera.resolution = (320, 240) time.sleep(2) fcntl.fcntl(comm, fcntl.F_SETFL, os.O_NONBLOCK) while True: camera.capture(stream, format='yuv', use_video_port = True) stream.seek(0) image = np.fromfile(stream, dtype=np.uint8, count=fwidth*fheight).reshape((fheight, fwidth))