Remote-Controlled 360-Degree RICOH THETA Camera With MESH Blocks

938

10

0

Published

Introduction: Remote-Controlled 360-Degree RICOH THETA Camera With MESH Blocks

About: MESH is the easiest way to plug a project into the Internet of Things (IoT). With out-of-the-box connectivity, MESH wireless sensors can connect any project to other hardware devices and the internet instant...

Create a simple wireless button to control a 360-Degree RICOH THETA camera using MESH blocks.

Step 1: Materials

Here's what you'll need to build your own 360 camera stick with a remote trigger.

  1. (x1) RICOH THETA (360-Degree Camera)
  2. (x1) MESH button
  3. (x1) Camera extension arm
  4. Velcro tape
  5. (x1) iPhone (or Android phone compatible with MESH app) with MESH app

As always, you can get MESH IoT blocks on Amazon at 10% off with discount code MAKERS00 as a thank you for checking out our Instructable and get more information about MESH IoT blocks at meshprj.com.

Step 2: Add a Remote Control to Camera Extension Arm

Use velcro tape to attach a MESH Button to the camera extension arm. Once MESH button is attached it, we will guide you through how to connect MESH Button to use it as a remote control for the RICOH THETA 360-degree camera.

Step 3: Create a Remote Control Recipe in the MESH App

You'll use visual programming in the MESH app to create a recipe that connects MESH Button and RICOH THETA.

Overview:

  1. Drag a Button tag and Speaker tag onto the canvas in the MESH app.
  2. Create a custom tag for RICOH THETA using MESH SDK. (See below for details)

Step 4: Launch MESH SDK to Connect MESH and RICOH THETA

You'll use the MESH SDK to connect MESH to RICOH THETA

  1. To get started, visit http://meshprj.com/sdk and click "start using the MESH SDK"
  2. MESH SDK reference and support can be found here: https://meshprj.com/sdk/doc/

Step 5: Create a New Tag for RICOH THETA in the MESH SDK

Once you've created an account for MESH SDK, you can then create a new custom tag RICOH THETA in the MESH app.

  1. In the MESH SDK, tap "Create New Tag" to create new custom tag
  2. Tap "New Function"

Step 6: Import Code to Create RICOH THETA Custom Tag

3. Import the following js into MESH SDK:

{"formatVersion":"1.0","tagData":{"name":"Take 360 photo","icon":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAI3klEQVR4Xu1cV4gWMRCes3exV9QTRBFEBFEUew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EMAGCBAAwHF9iU1etWrWEXqhHjx707NkzEU/lSItwGCoE2x8lEIE/uBikLt69exeg9B9VngEBZkBgdAUKMAFMQPifKpBJxgkMXiUqPAN4BvAMME+lpIyCEqUKlPiZBEbYBRFReno6tW/fPmysHfZxs8J8PR0KSTkD0PEgZ7yqmFq9ejWlpqZazCUtAbg1gdsTUYrbzbekJcB+dyhsIryuqictAQAcd/TtLxjDIsLr2mFSE2B/KBEW+Lh2jrukbpLUBAAQfOEkLS0tLOw1u4meICU9AQAILyjxkjIM0W/cedlmAv4i4/aCPqOEuN2GtttkAkyI4LEEHk1kVMx3g/xsMQE2hLBLxtsvHD3KCF7VjB8/XrgoE+AB1Z07dwgPNZ48eeILJo4u8QJn5MiRvrrsggJDRNpz0nPnzmlk4EsreJyBx3k1atSghg0ben6aQKQqngEiKIWowwSECK6IaSZABKUQdZiAEMEVMc0EiKAUog4TECK4IqaZABGUQtRhAkIEV8Q0E+CDEo4ucTM6keCzY7IfemUCfAgQObzH5wbq1asnMuAdOkwAEyA1cBIW8rsbGqRGngFB0PqrywR4gxbJxzqYACZAeN7yIsyLsPBgEVZkF/QfuSB8+03/eopXt/A90pIlSwoPELMiuyAp2NQVYgLUYSlliQmQgk1dISZAHZZSlpgAKdjUFWIC1GEpZYkJkIJNXSEmQB2WUpaYACnY1BViAtRhKWWJCZCCTV0hJkAdllKWmAAp2NQVYgLUYSlliQmQgk1dISZAHZZSlpgAKdjUFWIC1GEpZSlqAn4DHHf3qiUrqzcAAAAASUVORK5CYII=","description":"This software tag enables mesh to control Ricoh Theta S camera, such as taking pictures ","functions":[{"id":"function_0","name":"TakePicture","connector":{"inputs":[{"label":""}],"outputs":[{"label":""}]},"properties":[],"extension":{"initialize":"return {\n\truntimeValues : { sessionId: \"\" }\n}","receive":"","execute":"//Theta Endpoint URL(Default: 192.168.1.1)\nvar endPointURL = \"http://192.168.1.1\"\n\nvar startSessionJSONData = {\n\tname: \"camera.startSession\"\n} \n\najax( {\n\turl : endPointURL + \"/osc/commands/execute\",\n\ttype : \"post\",\n\tdata : JSON.stringify( startSessionJSONData),\n\tcontentType: \"application/json\",\n\tdataType: \"json\",\n\ttimeout : 5000,\n\tsuccess : function (contents) {\n\t\truntimeValues.sessionId = contents.results.sessionId;\n\t\tlog(\"Theta session started: \" + runtimeValues.sessionId);\n\t\tcheckCaptureMode(endPointURL);\n\t\ttakeThetaPicture(endPointURL);\n\t\tcloseThetaSession(endPointURL);\n\t\tcallbackSuccess( {\n\t\t\t\t\tresultType : \"continue\",     \n\t\t\t\t\truntimeValues : runtimeValues\n\t\t});\n\t},\n\terror : function (XMLHttpRequest, textStatus, errorThrown) {\n\t\tlog(XMLHttpRequest + \" | \" + textStatus + \" | \" + errorThrown);\t\t\n\t\tcallbackSuccess({\n\t\t\tresultType: \"continue\"\n\t\t});\n\t}\n});\n\nfunction checkCaptureMode(endPointURL) {\n\tvar getOptionsJSONData = {\n\t\tname: \"camera.getOptions\",\n\t\tparameters: {\n\t\t\tsessionId: runtimeValues.sessionId,\n\t\t\toptionNames: [\"captureMode\"]\n\t\t}\n\t} \n\t\n\tajax( {\n\t\turl : endPointURL + \"/osc/commands/execute\",\n\t\ttype : \"post\",\n\t\tdata : JSON.stringify( getOptionsJSONData),\n\t\tcontentType: \"application/json\",\n\t\tdataType: \"json\",\n\t\ttimeout : 5000,\n\t\tsuccess : function (contents) {\n\t\t\tlog(\"CaptureMode: \" + JSON.stringify(contents.results.options.captureMode));\n\t\t\tif(contents.results.options.captureMode != \"image\"){\n\t\t\t\tlog(\"Please change capture mode to take photo\");\n\t\t\t\tcallbackSuccess({\n\t\t\t\t\tresultType: \"stop\"\n\t\t\t\t});\n\t\t\t};\t\n\t\t\tcallbackSuccess( {\n\t\t\t\t\tresultType : \"continue\"\n\t\t\t});\n\t\t},\n\t\terror : function (XMLHttpRequest, textStatus, errorThrown) {\n\t\t\tlog(\"Error:\" + textStatus + \" \" + errorThrown);\t\t\n\t\t\tcallbackSuccess({\n\t\t\t\tresultType: \"continue\"\n\t\t\t});\n\t\t}\n\t} );\n}\n\nfunction takeThetaPicture(endPointURL) {\n\tvar takePictureJSONData = {\n\t\tname: \"camera.takePicture\",\n\t\tparameters: {\n\t\t\tsessionId: runtimeValues.sessionId\n\t\t}\n\t} \n\n\tajax( {\n\t\turl : endPointURL + \"/osc/commands/execute\",\n\t\ttype : \"post\",\n\t\tdata : JSON.stringify( takePictureJSONData),\n\t\tcontentType: \"application/json\",\n\t\tdataType: \"json\",\n\t\ttimeout : 5000,\n\t\tsuccess : function (contents) {\n\t\t\t\tlog(\"Took picture\");\n\t\t},\n\t\terror : function (XMLHttpRequest, textStatus, errorThrown) {\n\t\t\tlog(\"Error:\" + textStatus + \" \" + errorThrown);\t\t\n\t\t\tcallbackSuccess({\n\t\t\t\tresultType: \"continue\"\n\t\t\t});\n\t\t}\n\t} );\n}\n\nfunction closeThetaSession(endPointURL) {\n\tvar closeSessionJSONData = {\n\t\tname: \"camera.closeSession\",\n\t\tparameters: {\n\t\t\tsessionId: runtimeValues.sessionId\n\t\t}\n\t} \n\n\tajax( {\n\t\turl : endPointURL + \"/osc/commands/execute\",\n\t\ttype : \"post\",\n\t\tdata : JSON.stringify( closeSessionJSONData),\n\t\tcontentType: \"application/json\",\n\t\tdataType: \"json\",\n\t\ttimeout : 5000,\n\t\tsuccess : function (contents) {\n\t\t\tlog(\"Theta session closed: \" + runtimeValues.sessionId);\n\t\t\t},\n\t\terror : function (XMLHttpRequest, textStatus, errorThrown) {\n\t\t\tlog(\"Error:\" + textStatus + \" \" + errorThrown);\t\t\n\t\t\tcallbackSuccess({\n\t\t\t\tresultType: \"continue\"\n\t\t\t});\n\t\t}\n\t} );\n}\n\nreturn {\n\tresultType : \"continue\"\n};","result":""}}]}}

This instructable referred the following.

Original code is written by handa on Qiita in Japan.
http://qiita.com/handa/items/6118a7e5e1bd58d1cc03 (Japanese)

Step 7: Sign Into MESH SDK on MESH App

Revisit the MESH app and sign into the the MESH SDK to access the new custom RICOH THETA tag that you created.

Step 8: Add the New RICOH THETA Tag to the Recipe.

Select the Custom Tag (ROCHO THETA Tag) That You Created

  1. Tap the "+" icon in the Custom section on the dashboard to add a custom tag.
  2. Select the RICOH THETA custom tag from the list. (The new tag will be added to the Custom section of the dashboard).
  3. Drag-and-drop RICOH THETA tag into the recipe on the canvas and connect the Button tag to the RICOH THETA tag and Speaker tag.

Test, run, and enjoy!

Step 9: Test, Run, and Enjoy!

Share

    Recommendations

    • Woodworking Contest

      Woodworking Contest
    • Make it Move Contest

      Make it Move Contest
    • Casting Contest

      Casting Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    All steps are well described. I got tripped up at two location. Hope this can help other too.

    Step 6: Import Code to Create RICOH THETA Custom Tag.

    It is a 4-baby steps process.

    1. Make sure you press the green "import" button.

    2. Cut the code from instructable and paste it the white empty space below the green menu items. It's okay. the code is run on one line.

    3. Press the green "Load JSON" button.

    4. When you press the green "Back to Edit" button. Everything will be all filled out. The theta image, the description, the code, etc.

    Step 8: Add the New RICOH THETA Tag to the Recipe.

    Before baby step 1


    1. Tap the "+" icon in the Custom section on the dashboard to add a custom tag.

    You need to charge the MESH tag. It went faster when it is charge directly from the outlet than off of the computer USB port.

    You need to pair your MESH tag with the phone. Stupid me. I couldn't figure out how to turn the Mesh tag on....it wasn't obvious to me to turn it on by pressing the green silicone portion of the tag until a white light glows. I keep on pressing or press and hold the black button....

    Step 9. Test, Run, and Enjoy!

    The Mesh button can control the Mesh App (sounds icon and theta icon) but it is not interacting with the actual theta SC camera. I feel like there is another step to connect the Mesh app to the camera. I hope someone can answer my question. Thanks.

    mesh instructable load SDK.JPG

    1 Questions

    0

    Hi There, Thanks for the instructable post. I'm following along and get it all working to step 9. The remote can control the mesh app sound and theta icon on the droid phone. Is there one more step for the mesh app to communicate with the theta SC camera. Please help. Thank you.

    0

    Never mind. I got it. The MESH button is not paired with the Theta SC camera directly. The MESH button control the MESH App, which control the Theta S App which control the Theta Camera. I get it.

    Basically, You have to turn on your Theta S App, pair it with your Theta SC camera the same way you would otherwise. And when you press the MESH button, the Theta SC camera will shutter.

    Cool, except my original intention was to ditch the smart phone and use just the light weight button to control the theta SC directly. May be that's the next instructable challenge. How to use the MESH button to control Theta SC camera directly.

    Still very cool. Thanks for the instructable post and Qiita for writing the code.

    Comments