This video is about MECHA's Raw Interface, which is similar to MECHA's User Interface in that it allows you to control MECHA. In addition, the Raw Interface also allows third-party appplications to control MECHA.
First of all, in order to access the Raw Interface, you need to connect to MECHA's Wi-Fi network using your phone or computer.
After that, go to the /config page and make sure the Enable RAW Interface checkbox is checked. Then click the Apply button.
On page /i of the Raw Interface, the data is outputted in xml format.
"m0" is the controller type. Its value can be either 1 (for C1 Controller), or 2 (for C2 Controller). We are using a C2 Controller, so "m0" is 2.
"m1" is the MECHA ID.
"m2", the firmware version.
"m3", the battery level.
Initially, the value of "m4" is 0, and it becomes 1 when the power button is pressed during the execution of commands.
"r1" is the number of full steps per revolution for rotator 1 (lower rotator).
"r2", number of full steps per revolution for rotator 2 (upper rotator).
"d1" is the yaw.
"d2", tilt, or pitch.
"d3" is the position (in degrees) along axis 3.
"d4", position along axis 4.
If axes (or rotators) 3 and 4 do not exist, d3 and d4 are zero.
"i1" is a feature in development, at the moment.
On page /ij of the Raw Interface, the same data is outputted in JSON format. So access either page /i or /ij, depending on the data format you need.
You can control MECHA using the Raw Interface, without any application, but with commands based on some parameters added to the url, as pairs of a key and a value, separated by an equal sign. The ampersand separates each key/value pair, but sometimes the value is not necessary, as we will see later. We recommend reading the Raw Interface chapter in the user guide to see all the available parameters and how to use them.
The simplest command, perhaps, is to display a text on the C2's OLED. Let's copy this example and paste it into the address bar of our browser.
Notice that the first parameter added to our url is "text", its value is "HELLO", and it is preceded by a question mark. This url is a command that should display the text "HELLO" on C2's OLED. Press the Enter key, or tap Access, to send the command.
You can access the C2's web interface, which mirrors the real controller.
The text can have size, position and background. If not specified, default values are used, as in our example.
By default, the battery symbol is also displayed in the upper left corner of the OLED. Add the "nb" parameter to the url to hide it. It has no value.
Let's review the other parameters. Some of them you should already know from the MECHA's User Interface, such as the following Rotator-specific parameters:
number of microsteps per step,
and number of full steps per revolution.
Parameters to be used in rotation commands:
relative degrees - rotation from the current position,
absolute degrees - rotation from the origin,
and the current position to be used by MECHA to compute the origin.
Parameters to be used in commands Related to Signals:
duration of the auto-focus signal,
and duration of the shutter button signal.
Other parameters are:
"synch", which can be used to ignore commands while moving.
"nx", to shorten the command execution time, if the xml - JSON output is not needed.
"pause" can be used to specify no action.
"beep" tells MECHA to produce a certain number of beeps.
"beep=2" means 2 beep sounds. So this command will display the text "HELLO" and produce two beeps.
The Raw Interface can be locked by pressing the controller's power button during the execution of commands. You can unlock it with the "okgo" parameter, which has no value.
Examples are often easier to understand than text explanations, so let's have a look at some usage examples on the /i-example page. This page is similar to a third-party application that uses the Raw Interface. Here you can make some settings, then send and execute commands by clicking some buttons, which may be easier than passing parameters via url. For example, click the BEEP button without changing any settings. Notice that our beep command is written to the console, but not executed, because the Auto Execute checkbox is not checked. We need to click the EXECUTE button to execute the command. We should now hear a beep sound.
Note that all commands added to the console are executed when the execute button is clicked. Therefore, you should clear the console when the current commands are no longer needed.
With Auto Refresh checked, the virtual OLED on this page and the real OLED are synchronized.
Simulation Only checked means that no movement will be executed, which is useful for learning purposes. We will uncheck this checkbox and then send a command to execute a panorama.
But, first, let's see if the current position of the upper rail is correctly set.
You should know that 0 means horizontal position (level), 90 means camera is facing up (parked), as for shooting the sky, and -90, camera is facing down (raised), as for shooting a road. If this value, whatever it is, corresponds to reality, it means that the position of the upper rail is set correctly. Otherwise, specify the actual pitch, in degrees, in the Pitch field, then click the SET button. Our upper rail is in the parked position at the moment, so the pitch value is 90. The other settings do not matter when making this setting by clicking the SET button. Click the EXECUTE button to execute this command and note the tilt, or pitch, is 90 now.
MECHA now knows what position the upper rail is in and, therefore, it will execute any movement correctly, including absolute positioning. Check the Absolute checkbox and specify the pitch value (zero, in our case, for Level position), then click the MOVE button, to send this command, then EXECUTE, to execute it.
The upper rail is in the Level position, and now we can click the 28 mm Spherical button, to send a command for a three-row panorama: 12 positions per row, plus zenith and nadir shots, using the Focus, Shutter, and Pause values in the fields above.
As you can see in the console, this command consists of a large number of commands.
MECHA will execute all the commands in the order they are listed in the console. In these commands, you may recognize many of the parameters we have talked about earlier.
Let's click the EXECUTE button.
To use the Raw Interface, you only need a MECHA controller, either C1 or C2. Actually, we recommend that you do some testing before using a complete set-up consisting of panoramic head, camera and tripod.
To display a text on the OLED, click on the TEXT button, then you can edit the command in the console if needed, then execute the command with the EXECUTE button.
We also recommend that you read the notes at the bottom of this page, for more details, and create your own examples.