質問編集履歴

5

情報を追加しました。

2018/07/26 10:26

投稿

1997hiroyatan
1997hiroyatan

スコア11

test CHANGED
File without changes
test CHANGED
File without changes

4

わかりやすいように編集しました

2018/07/26 10:26

投稿

1997hiroyatan
1997hiroyatan

スコア11

test CHANGED
@@ -1 +1 @@
1
- Raspberry PiHubotを設定てSlackとの接続設定 yo hubotエラーが出る
1
+ Raspberry Pi+ Hubot + Webカメラで撮影た画像がslackに送られてこない。
test CHANGED
@@ -1,69 +1,45 @@
1
- Raspberry Piにカメラを接続してSlackのHubot写真を送って欲しいという命令を出と写真を送って来てくれるシステムを構築中です。
1
+ Raspberry PiにHubotをインストールしてWebカメラの画像slack表示するシステムを構築中です。
2
2
 
3
3
 
4
4
 
5
- Raspberry PiにHubotの設定をするところで止まっいます。
5
+ 現状としてはslackとhubot接続が完了しおり、
6
6
 
7
7
 
8
8
 
9
- 下記のページを参考にして進めましたが
10
-
11
-
12
-
13
- [Raspberry PiでSlack Botことはじめ](https://qiita.com/tomkimra/items/be33bd27587d3c6eaca5)
9
+ slack上でbotにチャットでcameraと入力すると"今撮っているから待ってね"と表示されるのですが、その後に肝心な写真が送られてきません。
14
10
 
15
11
 
16
12
 
17
13
 
18
14
 
15
+ 以下coffee言語のプログラムになります。
16
+
19
- $yo hubot
17
+ ```script.coffee
18
+
19
+ module.exports = (robot) ->
20
+
21
+ robot.respond /camera/, (msg) ->
22
+
23
+ @exec = require('child_process').exec
24
+
25
+ command = "fswebcam /home/pi/mybot/scripts/sample.jpg;
26
+
27
+ curl -F file=@/home/pi/mybot/scripts/sample.jpg -F channels=CBVxxxx -F token=xxxxxx https://slack.com/api/files.upload"
28
+
29
+ #msg.send "Command: #{command}"
30
+
31
+ msg.send "今撮っているから待ってね"
32
+
33
+ @exec command, (error, stdout, stderr) ->
34
+
35
+ @msg.send error if error?
36
+
37
+ #msg.send stdout if stdout?
38
+
39
+ #@msg.send stderr if stderr?
40
+
41
+ ```
20
42
 
21
43
 
22
44
 
23
- の所でエラーが出てしまい、止まっています。
24
-
25
-
26
-
27
- エラー内容は以下になります。
28
-
29
-
30
-
31
- pi@aaaaaa:~/mybot $yo hubot
32
-
33
- internal/modules/cjs/loader.js:583
34
-
35
- throw err;
36
-
37
- ^
38
-
39
-
40
-
41
- Error: Cannot find module './boxes.json'
42
-
43
- at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
44
-
45
- at Function.Module._load (internal/modules/cjs/loader.js:507:25)
46
-
47
- at Module.require (internal/modules/cjs/loader.js:637:17)
48
-
49
- at require (internal/modules/cjs/helpers.js:20:18)
50
-
51
- at Object.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/yosay/node_modules/cli-boxes/index.js:2:18)
52
-
53
- at Module._compile (internal/modules/cjs/loader.js:689:30)
54
-
55
- at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
56
-
57
- at Module.load (internal/modules/cjs/loader.js:599:32)
58
-
59
- at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
60
-
61
- at Function.Module._load (internal/modules/cjs/loader.js:530:3)
62
-
63
-
64
-
65
-
66
-
67
- 以前はエラー出ず、ボットみたな表示が出きてたのですが、Slackとの接続うまくいかずやを数回していたら$yo hubotからエラーがでしま、お手上げ状態にってます
45
+ "今撮っているから待ってね"という返事帰ってくるのでプグラムは動いていると思いますが、画像送られてこな理由が分かりしたら教えていただけないでしょうか
68
-
69
- よろしくお願いします。

3

わかりやすいように編集しました

2018/07/26 09:28

投稿

1997hiroyatan
1997hiroyatan

スコア11

test CHANGED
File without changes
test CHANGED
@@ -64,8 +64,6 @@
64
64
 
65
65
 
66
66
 
67
- 以前はエラーが出てなかったのですが、Slackとの接続がうまくいかずやり直しを数回していたら$yo hubotからエラーがでてしまい、
67
+ 以前はエラーが出ず、ロボットみたいな表示が出きていたのですが、Slackとの接続がうまくいかずやり直しを数回していたら$yo hubotからエラーがでてしまい、お手上げ状態になっています。
68
-
69
- お手上げ状態です。
70
68
 
71
69
  よろしくお願いします。

2

わかりやすいように編集しました。

2018/07/25 03:30

投稿

1997hiroyatan
1997hiroyatan

スコア11

test CHANGED
File without changes
test CHANGED
@@ -27,6 +27,8 @@
27
27
  エラー内容は以下になります。
28
28
 
29
29
 
30
+
31
+ pi@aaaaaa:~/mybot $yo hubot
30
32
 
31
33
  internal/modules/cjs/loader.js:583
32
34
 

1

エラーの書き忘れだったため追記しました。

2018/07/25 03:28

投稿

1997hiroyatan
1997hiroyatan

スコア11

test CHANGED
@@ -1 +1 @@
1
- Raspberry PiにHubotを設定してSlackとの接続設定についての質問
1
+ Raspberry PiにHubotを設定してSlackとの接続設定 yo hubotエラーが出る
test CHANGED
@@ -25,3 +25,45 @@
25
25
 
26
26
 
27
27
  エラー内容は以下になります。
28
+
29
+
30
+
31
+ internal/modules/cjs/loader.js:583
32
+
33
+ throw err;
34
+
35
+ ^
36
+
37
+
38
+
39
+ Error: Cannot find module './boxes.json'
40
+
41
+ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
42
+
43
+ at Function.Module._load (internal/modules/cjs/loader.js:507:25)
44
+
45
+ at Module.require (internal/modules/cjs/loader.js:637:17)
46
+
47
+ at require (internal/modules/cjs/helpers.js:20:18)
48
+
49
+ at Object.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/yosay/node_modules/cli-boxes/index.js:2:18)
50
+
51
+ at Module._compile (internal/modules/cjs/loader.js:689:30)
52
+
53
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
54
+
55
+ at Module.load (internal/modules/cjs/loader.js:599:32)
56
+
57
+ at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
58
+
59
+ at Function.Module._load (internal/modules/cjs/loader.js:530:3)
60
+
61
+
62
+
63
+
64
+
65
+ 以前はエラーが出てなかったのですが、Slackとの接続がうまくいかずやり直しを数回していたら$yo hubotからエラーがでてしまい、
66
+
67
+ お手上げ状態です。
68
+
69
+ よろしくお願いします。