全体表示

[ リスト | 詳細 ]

記事検索
検索

全7ページ

[1] [2] [3] [4] [5] [6] [7]

[ 次のページ ]

Amazon Dashセール

通常価格500円のDashが100円セール中なので6個買ってみました。
初回購入で500円引きっていうのは変わらないので実質-400円で無線ボタンが買えてしまいます。

イメージ 1


Node-REDに登録
ぶっちゃけアレクサに話しかけるより物理ボタンを押したほうが早くて確実ですよね・・・
イメージ 2

この記事に

開く コメント(0)

うーん

ネタがないなー

最近echo spotが発売されましたが、echo showが後に控えていたり
Fireタブレットがshowのように使えるようになるみたいなので一旦様子見です

この記事に

開く コメント(0)

監視カメラのフロー3

つづき 


[{"id":"3cfb4649.fffeca","type":"tab","label":"フロー 3","disabled":false,"info":""},{"id":"8b9e5d9e.06704","type":"PCA9685 out","z":"3cfb4649.fffeca","name":"PWM Output 8 (上下)","pca9685":"cfb36482.7d24d8","channel":"8","payload":"","unit":"microseconds","onStep":"0","x":660,"y":40,"wires":[]},{"id":"d7cefb0b.dc33e8","type":"inject","z":"3cfb4649.fffeca","name":"","topic":"","payload":"sum","payloadType":"global","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":470,"y":40,"wires":[["8b9e5d9e.06704"]]},{"id":"8382afea.8745b","type":"PCA9685 out","z":"3cfb4649.fffeca","name":"PWM Output 11 (左右)","pca9685":"cfb36482.7d24d8","channel":"11","payload":"","unit":"microseconds","onStep":"0","x":660,"y":80,"wires":[]},{"id":"b97a4ff3.3b0b4","type":"inject","z":"3cfb4649.fffeca","name":"","topic":"","payload":"sumr","payloadType":"global","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":470,"y":80,"wires":[["8382afea.8745b"]]},{"id":"c0419aee.84b448","type":"ui_slider","z":"3cfb4649.fffeca","name":"左右","label":"Pan","group":"1f5f5736.d806c9","order":2,"width":0,"height":0,"passthru":true,"topic":"","min":"1000","max":"2500","step":"10","x":70,"y":80,"wires":[["93fe7f97.974d","ff108161.106a5"]]},{"id":"633c155.cb33eec","type":"ui_slider","z":"3cfb4649.fffeca","name":"上下","label":"Tilt","group":"1f5f5736.d806c9","order":3,"width":"1","height":"4","passthru":true,"topic":"","min":"1500","max":"2500","step":"10","x":70,"y":40,"wires":[["1509bca4.0d3ca3","ff108161.106a5"]]},{"id":"1509bca4.0d3ca3","type":"function","z":"3cfb4649.fffeca","name":"global変数へ","func":"var s = global.get(\"sum\")||0;\ns = msg.payload;\ns = -s+4000;\nglobal.set(\"sum\", s);\nmsg.s = s;\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":40,"wires":[[]]},{"id":"93fe7f97.974d","type":"function","z":"3cfb4649.fffeca","name":"global変数へ","func":"var r = global.get(\"sumr\")||0;\nr = msg.payload;\nr = -r+3500;\nglobal.set(\"sumr\", r);\n//msg.sumr = r;\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":80,"wires":[[]]},{"id":"9e6297b2.8ac588","type":"camerapi-takephoto","z":"3cfb4649.fffeca","filemode":"1","filename":"photo1.JPEG","filedefpath":"1","filepath":"","fileformat":"jpeg","resolution":"1","rotation":"180","fliph":"0","flipv":"0","brightness":"55","contrast":"0","sharpness":"0","imageeffect":"none","name":"","x":830,"y":180,"wires":[[]]},{"id":"863fb7bf.883f18","type":"inject","z":"3cfb4649.fffeca","name":"","topic":"","payload":"switch","payloadType":"global","repeat":"3","crontab":"","once":false,"onceDelay":0.1,"x":460,"y":440,"wires":[["acce1e5d.f737d"]]},{"id":"b351be60.b3e9c","type":"ui_template","z":"3cfb4649.fffeca","group":"78c71499.18b6fc","name":"","order":1,"width":"6","height":"5","format":"<script>\nvar value = \"1\";\n// or overwrite value in your callback function ...\nthis.scope.action = function() { return value; }\n\nfunction updateF() {\n  var source = '/photo1.JPEG',\n  timestamp = (new Date()).getTime(),\n  newUrl = source + '?_=' + timestamp;\n  document.getElementById(\"photo\").src = newUrl;\n  setTimeout(\"updateF()\",10000);\n}\n</script>\n\n\n<div style=\"margin-bottom:1px;\">\n <img src=\"/photo1.JPEG\" id=\"photo\" width=\"100%\" height=\"100%\" onload=\"updateF(this)\" >\n</div>\n\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":620,"y":140,"wires":[["9e6297b2.8ac588"]]},{"id":"a88d788e.7cd418","type":"ui_switch","z":"3cfb4649.fffeca","name":"","label":"CS","group":"1f5f5736.d806c9","order":4,"width":"3","height":"1","passthru":true,"decouple":"false","topic":"","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":430,"y":600,"wires":[["d1877a43.2e9328"]]},{"id":"d1877a43.2e9328","type":"function","z":"3cfb4649.fffeca","name":"global変数へ","func":"var sw = global.get(\"switch\")||0;\nsw = msg.payload;\nglobal.set(\"switch\", sw);\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":600,"wires":[[]]},{"id":"acce1e5d.f737d","type":"switch","z":"3cfb4649.fffeca","name":"","property":"switch","propertyType":"global","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":610,"y":440,"wires":[["9e6297b2.8ac588"],[]]},{"id":"c8b6c5bc.d7b558","type":"ui_button","z":"3cfb4649.fffeca","name":"","group":"1f5f5736.d806c9","order":5,"width":"2","height":"1","passthru":false,"label":"Reset","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":70,"y":280,"wires":[["87e9481a.a05a58","f2b92fd6.57c76","7820d64f.ce7fa8","ff108161.106a5","1844b8cd.bbb227","538a5d1.d57daa4","32c85af7.812236","e04cf110.cec84"]]},{"id":"144dc334.c7fb7d","type":"function","z":"3cfb4649.fffeca","name":"上下サーボOFF","func":"var zero = 0\nglobal.set(\"sum\", zero);\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":260,"wires":[[]]},{"id":"de30046c.3e7008","type":"function","z":"3cfb4649.fffeca","name":"左右サーボOFF","func":"var zero = 0\nglobal.set(\"sumr\", zero);\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":300,"wires":[[]]},{"id":"f2b92fd6.57c76","type":"function","z":"3cfb4649.fffeca","name":"左右リセット","func":"var zero = 1700;\nglobal.set(\"sumr\", zero);\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":380,"wires":[[]]},{"id":"87e9481a.a05a58","type":"function","z":"3cfb4649.fffeca","name":"上下リセット","func":"var zero = 2200\nglobal.set(\"sum\", zero);\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":340,"wires":[[]]},{"id":"7820d64f.ce7fa8","type":"delay","z":"3cfb4649.fffeca","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":320,"y":280,"wires":[["144dc334.c7fb7d","de30046c.3e7008"]]},{"id":"ff108161.106a5","type":"delay","z":"3cfb4649.fffeca","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":320,"y":180,"wires":[["9e6297b2.8ac588"]]},{"id":"20b61555.a533aa","type":"ui_button","z":"3cfb4649.fffeca","name":"","group":"1f5f5736.d806c9","order":5,"width":"3","height":"2","passthru":false,"label":"Take a photo","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":90,"y":180,"wires":[["ff108161.106a5","c026960a.d98918"]]},{"id":"f9e90e4a.ecf66","type":"ui_button","z":"3cfb4649.fffeca","name":"","group":"1f5f5736.d806c9","order":0,"width":"2","height":"1","passthru":false,"label":"Shut down","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":450,"y":520,"wires":[["4176618c.ceb7e"]]},{"id":"4176618c.ceb7e","type":"exec","z":"3cfb4649.fffeca","command":"sudo poweroff #","append":"","useSpawn":"","name":"turn off Pi","x":620,"y":520,"wires":[[],[],[]]},{"id":"c026960a.d98918","type":"camerapi-takephoto","z":"3cfb4649.fffeca","filemode":"1","filename":"photo2.JPEG","filedefpath":"1","filepath":"","fileformat":"jpeg","resolution":"4","rotation":"180","fliph":"0","flipv":"0","brightness":"55","contrast":"0","sharpness":"0","imageeffect":"none","name":"","x":370,"y":220,"wires":[[]]},{"id":"85734dbc.c1fa6","type":"ui_switch","z":"3cfb4649.fffeca","name":"","label":"Light","group":"1f5f5736.d806c9","order":4,"width":"3","height":"1","passthru":true,"decouple":"false","topic":"","style":"","onvalue":"100","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":70,"y":580,"wires":[["192e0e84.d261d1","13bc7f17.69a701","53a384fe.cde1fc","7eed1134.785dd"]]},{"id":"192e0e84.d261d1","type":"PCA9685 out","z":"3cfb4649.fffeca","name":"LED L","pca9685":"cfb36482.7d24d8","channel":"0","payload":"","unit":"percent","onStep":"0","x":260,"y":580,"wires":[]},{"id":"13bc7f17.69a701","type":"PCA9685 out","z":"3cfb4649.fffeca","name":"LED R","pca9685":"cfb36482.7d24d8","channel":"2","payload":"","unit":"percent","onStep":"0","x":260,"y":620,"wires":[]},{"id":"1844b8cd.bbb227","type":"PCA9685 out","z":"3cfb4649.fffeca","name":"LED L","pca9685":"cfb36482.7d24d8","channel":"0","payload":"0","unit":"percent","onStep":"0","x":260,"y":380,"wires":[]},{"id":"538a5d1.d57daa4","type":"PCA9685 out","z":"3cfb4649.fffeca","name":"LED R","pca9685":"cfb36482.7d24d8","channel":"2","payload":"0","unit":"percent","onStep":"0","x":260,"y":420,"wires":[]},{"id":"53a384fe.cde1fc","type":"PCA9685 out","z":"3cfb4649.fffeca","name":"LED L","pca9685":"cfb36482.7d24d8","channel":"5","payload":"","unit":"percent","onStep":"0","x":260,"y":660,"wires":[]},{"id":"7eed1134.785dd","type":"PCA9685 out","z":"3cfb4649.fffeca","name":"LED R","pca9685":"cfb36482.7d24d8","channel":"7","payload":"","unit":"percent","onStep":"0","x":260,"y":700,"wires":[]},{"id":"32c85af7.812236","type":"PCA9685 out","z":"3cfb4649.fffeca","name":"LED L","pca9685":"cfb36482.7d24d8","channel":"5","payload":"","unit":"percent","onStep":"0","x":260,"y":460,"wires":[]},{"id":"e04cf110.cec84","type":"PCA9685 out","z":"3cfb4649.fffeca","name":"LED R","pca9685":"cfb36482.7d24d8","channel":"7","payload":"","unit":"percent","onStep":"0","x":260,"y":500,"wires":[]},{"id":"cfb36482.7d24d8","type":"PCA9685","z":"","deviceNumber":"1","address":"64","frequency":"50"},{"id":"1f5f5736.d806c9","type":"ui_group","z":"","name":"Group 2","tab":"3ac7a147.94ad0e","order":2,"disp":false,"width":"6","collapse":false},{"id":"78c71499.18b6fc","type":"ui_group","z":"","name":"Dashboard","tab":"3ac7a147.94ad0e","order":1,"disp":false,"width":"6","collapse":false},{"id":"3ac7a147.94ad0e","type":"ui_tab","z":"","name":"HOME","icon":"dashboard","order":1}]

この記事に

開く コメント(0)

監視カメラのフロー2

続き

「http://ラズパイのアドレス:1880/ui 」をブラウザで開けばカメラを操作出来ます。
※サーボの調整していないので変な方向を向いてしまうと思います。
 まだカメラスタンドには組み込まないほうがいいです
イメージ 1


パンとチルトのスライダーを動かせばサーボが動きます。(動かした1秒後に写真を一回撮ります。)
CSはCoutinuous Shootingで連写です。 数秒ごとに画像が更新されます。
※写真はPhoto1.jpegという名前で毎回上書きされています。
TAKE A PHOTOボタンを押すとPhoto2.jpegという別名で写真が保存されます。


おまけ
このフローで肝となるのは </>templateノード です。
撮影した画像は毎回Photo1.jpegという名前で保存されるので画像の内容が変わっても
ブラウザの省通信機能により更新ボタンを押すまでは画像を再読み込みしてくれません。
そこで画像のファイル名をPhoto1+現在の時刻.jpegに書き換えることで別の画像だとブラウザに認識させ
更新ボタンを押さなくても自動で再読み込みさせることが出来ます。

この記事に

開く コメント(0)

監視カメラのフロー

リクエストがあったのでフローを載せておきます (監視カメラのフロー③に貼ってあります)

実験用なので改良の余地ありです
イメージ 8


必要なノード
・node-red-contrib-camerapi(Piカメラ制御ノード)
・node-red-contrib-pca9685(サーボモーター制御基板PCA9685ノード)
 (2本の信号線だけで16台のサーボモーターを制御出来るのがPCA9685のメリットですが、
 今回は2台しか制御 しないのでわざわざこれを使う意味はあまりないです。 
 GPIOノードでPWM信号を出力すればサーボは制御できます)
・node-red-dashboard(ブラウザにカメラの画像を貼ったり、カメラスタンドの制御ボタンを設置するノード)

各種設定
・カメラで撮った画像をブラウザから見えるようにするため写真フォルダの場所をnode-redの設定ファイルに登録します。
ターミナルで「sudo nano ~/.node-red/settings.js」と打って設定ファイルを開きます。

//httpStatic; '○○' と書いてある場所を探して「//」を消します。
下記のようにカメラで撮影した写真を保存しておくフォルダを記述します。

※ラズビアン日本語版には「ピクチャー」フォルダはありますが、「Pictures」フォルダは無いので
 このように書いた場合は「Pictures」フォルダを作成しておいてください
イメージ 2


・ラズパイカメラ、PCA9685はシリアル通信を使うので設定で有効にしておきます。
イメージ 1

・PCA9685の配線はこんな感じです。
イメージ 3
イメージ 4

繋いだら
「sudo i2cdetect -y 1」でPCA9685のポート番号を調べます。
イメージ 5

十六進数で「40」がポート番号です。 十進数に直すと「64」となります。
(何も数字が出なかったらシリアル通信の設定が出来ていないか、配線が間違っています 「i2c ラズパイ」でググってみてください)

PCA9685ノードの設定画面でこの64を入力します
イメージ 6

サーボの配線ですが、サンプルフローでは、上下首振りのサーボをPCA9685の8番ピン、左右首振りのサーボを11番ピンにしています。


・カメラノードで写真の保存場所を指定してください 最初の設定で写真フォルダをhome/pi/Picturesにした場合はデフォルトファイルパスをYesにしておけばOK 別の場所を指定した場合はそのパスを入力してください
イメージ 7

・以上で一応動くようになるはず・・・ 動かなかったらコメントください 

この記事に

開く コメント(0)

全7ページ

[1] [2] [3] [4] [5] [6] [7]

[ 次のページ ]


.


みんなの更新記事