yappy / DollsKit

yappy家の管理プログラム
MIT License
0 stars 3 forks source link

raspistill コマンドの exit code をチェックする #35

Closed yappy closed 5 years ago

yappy commented 7 years ago

失敗時にちゃんと0以外の終了コードが返るか自信が無かったのでスルーして次のサムネイル作成処理で FileNotFound させていたが、大丈夫そう。

6/03/2017 22:33:07 (13) [Info]: [camera] Start
16/03/2017 22:33:07 (13) [Info]: [camera] Take a picture: www/pics/20170316/20170316_2233.jpg
16/03/2017 22:33:13 (13) [Info]: [camera] Result: 0
16/03/2017 22:33:13 (13) [Info]: [camera] Completed successfully
18/03/2017 06:43:43 (1297) [Info]: [camera] Start
18/03/2017 06:43:43 (1297) [Info]: [camera] Take a picture: www/pics/20170318/20170318_0643.jpg
18/03/2017 06:43:43 (1297) [Info]: [camera] Result: 70
18/03/2017 06:43:43 (1297) [Error]: [camera] Exception
18/03/2017 06:43:43 (1297) [Error]: System.IO.FileNotFoundException: www/pics/20170318/20170318_0643.jpg
  at System.Drawing.Image.FromFile (System.String filename, System.Boolean useEmbeddedColorManagement) [0x0000b] in <b12c84cdc19942509f026394ae66ea32>:0
  at System.Drawing.Image.FromFile (System.String filename) [0x00000] in <b12c84cdc19942509f026394ae66ea32>:0
  at Shanghai.CameraTask.TakePictureTask (Shanghai.TaskServer server, System.String taskName) [0x0010a] in <1d501939197c40e3b547b716b076409b>:0
  at Shanghai.TaskServer+<RegisterTask>c__AnonStorey0.<>m__0 () [0x00073] in <1d501939197c40e3b547b716b076409b>:0

カメラが死んでるときの出力はこう。

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
yappy commented 5 years ago

写真機能は実装しなおすので close