PiCam異常時の現象

2017年9月4日 - 未分類

RaspberryPiに付けることができるカメラモジュール、通称、PiCamは、時々、トラブルを起こします。画像を撮影できなくなるのです。最初は、原因が分からず、RaspberryPiが故障したのだろうかと考えていました。色々、実験をして、少し分かってきたことがありますので、メモ代わりに残しておきます。

PiCamトラブル時のエラー

その1 ソフトウエアの問題

$ raspistill -n -o test.jpg mmal: mmal_vc_component_enable: failed to enable component: ENOSPC mmal: camera component couldn’t be enabled mmal: main: Failed to create camera component mmal: Failed to run camera app. Please check for firmware updates

Stretchの場合

$ raspistill -o test.jpg mmal: Cannot read camera info, keeping the defaults for OV5647 mmal: mmal_vc_component_create: failed to create component ‘vc.ril.camera’ (1:ENOMEM) mmal: mmal_component_create_core: could not create component ‘vc.ril.camera’ (1) mmal: Failed to create camera component mmal: main: Failed to create camera component mmal: Camera is not detected. Please check carefully the camera module is installed correctly

$ vcgencmd get_camera supported=1 detected=1

で、ちゃんと検出できていますがエラーです。raspi-updateやapt-get upgradeでは治りません。このエラーは、OSの問題です。新しくOSをインストールしなおすと治ります。恐らく、mmal関係のライブラリーのコンフリクト問題だろうと思われますが、具体的にどれがコンフリクトしているのかは分かっていません。

同様の現象の報告があります。

カメラカメラモジュールの撮影エラーについて
ラズパイ2でカメラモジュールを使いたいので

この現象は、他のプロセスがPiCamを使っている場合にも発生することが分かりました。
$ raspistill -o test.jpg
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

実は、 mjpeg-streamerが動作していました。カメラの取り合いがあった訳です。

$ vcgencmd get_camera
supported=1 detected=1
で正常に動作しているのに、camera component couldn't be enabledというエラーが出たときには、他にカメラを使っているプロセスが無いかどうかチェックしましょう。

 

その2 接続の問題

$ raspistill -o test.jpg mmal: Cannot read camera info, keeping the defaults for OV5647 mmal: mmal_vc_component_create: failed to create component ‘vc.ril.camera’ (1:ENOMEM) mmal: mmal_component_create_core: could not create component ‘vc.ril.camera’ (1) mmal: Failed to create camera component mmal: main: Failed to create camera component mmal: Camera is not detected. Please check carefully the camera module is installed correctly

$ vcgencmd get_camera supported=1 detected=0

これは、PiCamを接続せずに、raspistillを実行した場合にでるエラーと同じです。フラットケーブルに問題があります。フラットケーブルは折れ曲がると、断線が起こるようで、信号が通じなくなって起こる現象です。フラットケーブルを交換すれば治ります。フラットケーブルに問題がなくても、接触が悪かった場合にもこのエラーが出ます。カメラモジュール故障の場合にも、このエラーがでると思われます。

同様の現象の報告があります。

RaspberryPI へカメラ接続

その3 ハードウエアの問題

$ raspistill -o test.jpg mmal: No data received from sensor. Check all connections, including the Sunny one on the camera board

このままの状態で固まります。

$ vcgencmd get_camera supported=1 detected=1

カメラモジュールは検出されているのですが、カメラからの信号がでていない、または、受信できないという現象です。RaspberryPiかカメラモジュールのハードウエアの問題です。PiCamインターフェースに問題が生じていると思われます。こうなったらカメラモジュールか、RaspberryPiかのどちらかを交換するしかありません。

同様の問題の報告があります。

Raspberry Pi 用 赤外線カメラモジュール Pi NoIR

		
		
Translate »