We try taking advantage of the most popular gadgets of the moment, to create a project based on Linino.
The goal of the project is to control a robotic arm on which we installed the GoPro camera and run some commands: start / stop recording video, taking photos, localize the camera (the cam starts to beep).
You will need:
NB Linino with Node.js and the Ideino development environment on-board
(For installing Node.Js and Ideino on the Yun, please refer to this guide: http://wiki.linino.org/doku.php?id=wiki:nodejscript).
The master piece of this project is the mips-gopro library for node.js (https://www.npmjs.org/package/mips-gopro). We had recompiled the Jaakko Manninen’s gopro lib (https://github.com/kschzt/gopro) for MIPS architecture and extend its functionality: now we had almost all of the gopro functionality.
Let’s start with the javascript code!
Now that we have everything you need, we can go to the Ideino worspace page via web browser (http://linino.local:2424) (after the root login) and create new project called “GoPro”, in which we will write our code to manage GoPro and robotic arm:
Before start coding, we need to install the mips-gopro module. To do so, open the package.json file inside the drone project you have just created, and add the dependence of the mips-gopro module. Your file should look like this:
you can also write other information like the name and description of the project. Save the package.json file, press the right mouse button on it and click Install. Ideino will run the npm command and will install the mips-gopro module inside the project directory.
Now create a new file and name it gopro_demo.js :
Create the html page (gopro_demo.html) in the html folder, to interact with the hardware:
Now that the code is ready to run, you need to put the application in autorun mode, this means that the application will run automatically at the next startup/reboot of Linino. Right mouse click on gopro_demo.js and click “Autorun”.
Now you just have to configure our board, making it connect to the GoPro WiFi Hotspot. To do that, please connect to the luci administration panel of your Arduino Yun via web browser. Wait a few minutes for the WiFi reconfiguration, the system will restart and your Node.Js file will autorun.
Now you are all set! Command your GoPro from Web!
Comments