Closed jlbribeiro closed 9 years ago
Great catch. This bug came about from several changes I recently added to better handle reconnects to cameras due to network connectivity issues.
Also, I'm really happy that you find mjpeg-camera
useful. It's always delightful to hear that these modules are being used.
The camera.getScreenshot example code doesn't seem to be working correctly. It correctly saves a frame into the
camera-screenshot.jpg
file, but it "hangs" until the following error is thrown:Since the
Camera.prototype.stop
method is setting the connection tonull
after aborting it, it seems to me that two consecutivestop
calls would cause the error, most likely caused by thecamera.getScreenshot
call followed by thekeepalive
timer call.My use case allows me to "fix" the
stop
call by checking if the connection isnull
before aborting, but this doesn't seem to be the proper fix (or at least not enough to fix it), since the same example code will hang forever (i.e., no error is thrown but the program never quits).Thank you for
mjpeg-camera
by the way, I was looking for a module capable of grabbing a single MJPEG frame and this was exactly it.