Post by impactoz on Aug 22, 2019 22:09:54 GMT -8
Hmm... whats happened… How do I fix it... and more importantly how to prevent it...
So the system has been running well for over a week... It had a scheduled reboot yesterday....
Today experienced something not seen as yet... Throughout the day, I have checked Weather Underground - its updating all okay... This afternoon I checked WeatherSTEM and it had not updated since 8:30 this morning... WTF - Updating one, still running, and not updating the other...
I immediately thought of the Camera - as the same file has all the definitions for taking a picture and updating Weatherstem, and basically it never takes a picture for anything other than sending to weatherstem...
Checking my log file - I am finding the following;
httmmal: mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC
mmal: mmal_port_enable: failed to enable connected port (vc.null_sink:in:0(OPQV))0x6a514f60 (ENOSPC)
mmal: mmal_connection_enable: output port couldn't be enabled
ERROR:apscheduler.executors.default:Job "takeSkyPicture (trigger: interval[0:10:00], next run at: 2019-08-23 15:54:27 AEST)" raised an exception
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "/home/pi/SDL_Pi_SkyWeather/SkyCamera.py", line 36, in takeSkyPicture
camera = picamera.PiCamera()
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 433, in __init__
self._init_preview()
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 513, in _init_preview
self, self._camera.outputs[self.CAMERA_PREVIEW_PORT])
File "/usr/lib/python2.7/dist-packages/picamera/renderers.py", line 558, in __init__
self.renderer.inputs[0].connect(source).enable()
File "/usr/lib/python2.7/dist-packages/picamera/mmalobj.py", line 2212, in enable
prefix="Failed to enable connection")
File "/usr/lib/python2.7/dist-packages/picamera/exc.py", line 184, in mmal_check
raise PiCameraMMALError(status, prefix)
PiCameraMMALError: Failed to enable connection: Out of resources
and confirmed by looking at the last picture in static folder - it was last taken at 8:30am this morning...
Luckily as the camera is only used for wetherstem, it still runs, updates weather underground and is logging to the database...
I have done a reboot...
After the reboot - the camera has successfully taken a picture - verified in static folder... and weatherstem now updates....
So what caused out of resources error... is it only related to the camera.... is it trapable and resources refreshed, or does a reboot ? Or how to obtain more resources....
So the system has been running well for over a week... It had a scheduled reboot yesterday....
Today experienced something not seen as yet... Throughout the day, I have checked Weather Underground - its updating all okay... This afternoon I checked WeatherSTEM and it had not updated since 8:30 this morning... WTF - Updating one, still running, and not updating the other...
I immediately thought of the Camera - as the same file has all the definitions for taking a picture and updating Weatherstem, and basically it never takes a picture for anything other than sending to weatherstem...
Checking my log file - I am finding the following;
httmmal: mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC
mmal: mmal_port_enable: failed to enable connected port (vc.null_sink:in:0(OPQV))0x6a514f60 (ENOSPC)
mmal: mmal_connection_enable: output port couldn't be enabled
ERROR:apscheduler.executors.default:Job "takeSkyPicture (trigger: interval[0:10:00], next run at: 2019-08-23 15:54:27 AEST)" raised an exception
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "/home/pi/SDL_Pi_SkyWeather/SkyCamera.py", line 36, in takeSkyPicture
camera = picamera.PiCamera()
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 433, in __init__
self._init_preview()
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 513, in _init_preview
self, self._camera.outputs[self.CAMERA_PREVIEW_PORT])
File "/usr/lib/python2.7/dist-packages/picamera/renderers.py", line 558, in __init__
self.renderer.inputs[0].connect(source).enable()
File "/usr/lib/python2.7/dist-packages/picamera/mmalobj.py", line 2212, in enable
prefix="Failed to enable connection")
File "/usr/lib/python2.7/dist-packages/picamera/exc.py", line 184, in mmal_check
raise PiCameraMMALError(status, prefix)
PiCameraMMALError: Failed to enable connection: Out of resources
and confirmed by looking at the last picture in static folder - it was last taken at 8:30am this morning...
Luckily as the camera is only used for wetherstem, it still runs, updates weather underground and is logging to the database...
I have done a reboot...
After the reboot - the camera has successfully taken a picture - verified in static folder... and weatherstem now updates....
So what caused out of resources error... is it only related to the camera.... is it trapable and resources refreshed, or does a reboot ? Or how to obtain more resources....