Needing to put your THETA through some repetitive API testing and curl isn’t flexible enough? Wouldn’t it be nice if there was a simple scripting tool to test a series of commands? Use it to isolate problems, set and quickly see different values easily, and lots more.
theta360.guide has building BASH scripts to automate testing. You can easily run a sequence of API commands just from your development machine, connected to a THETA, and get a great feel of how your THETA performs.
I’m working on a Windows 10 machine. For now, you need to have WSL2 installed. I’m running Ubuntu 20.04.
Go to:
SC2 Developers - Community Docs, Code Samples and Tutorial Videos
The registration and the command line tool are free. Binaries are available for Linux, Windows, Mac and Raspberry Pi. Or you can compile the code yourself!
Connect your development machine to your THETA over Wi-Fi.
There are two scripts currently. I expect this number to increase. If you want to take a look at the scripts, you can look here: webapi/script_examples at master · theta360developers/webapi · GitHub
I am using bash_sample2.sh
bash_sample2 performs the following commands
It does getOptions
- Then it sets exposureCompensation to -2.0
It downloads the picture
- Then it sets exposureCompensation to -1.0
It downloads the picture
- Then it sets exposureCompensation to 0.0
It downloads the picture
- Then it sets exposureCompensation to 1.0
It downloads the picture
- Then it sets exposureCompensation to 2.0
It downloads the picture
Here’s the output of testing it with a Z1 running firmware 1.60.1
Viewed in Windows Explorer:
The 5 images:
Command line output
jcasman@DESKTOP-MFMN3HS:/mnt/c/Users/jcasm/Development/webapi/script_examples$ ./bash_sample2.sh
{
"name": "camera.getOptions",
"results": {
"options": {
"_autoBracket": {
"_bracketNumber": 2,
"_bracketParameters": [
{
"aperture": 2.1,
"_colorTemperature": 5000,
"exposureCompensation": 0.0,
"exposureProgram": 1,
"iso": 400,
"shutterSpeed": 0.004,
"whiteBalance": "auto"
},
{
"aperture": 2.1,
"_colorTemperature": 5000,
"exposureCompensation": 0.0,
"exposureProgram": 1,
"iso": 400,
"shutterSpeed": 0.004,
"whiteBalance": "auto"
}
]
},
"captureMode": "image",
"_colorTemperature": 5000,
"dateTimeZone": "2021:02:10 09:49:31-08:00",
"exposureCompensation": 0.0,
"exposureDelay": 0,
"exposureProgram": 2,
"_filter": "off",
"offDelay": 64800,
"previewFormat": {
"framerate": 30,
"height": 512,
"width": 1024
},
"remainingSpace": 20551598080,
"shutterSpeed": 0,
"_shutterVolume": 100,
"sleepDelay": 65535
}
},
"state": "done"
}
The EV is now -2.0. Did it work? If so, take a moment to celebrate.
Test of taking picture and then checking to see if picture is ready for download
---
The status ID is 24
Elapsed time: 0 seconds. State: inProgress
Elapsed time: 1 seconds. State: inProgress
Elapsed time: 2 seconds. State: inProgress
Elapsed time: 3 seconds. State: done
picture ready for download at http://192.168.1.1/files/90014a68423861503e0302775cb7b500/100RICOH/R0010093.JPG
Writing file from the following URL
http://192.168.1.1/files/90014a68423861503e0302775cb7b500/100RICOH/R0010093.JPG
download complete
The EV is now -1.0. Did it work? If so, take a moment to celebrate.
Test of taking picture and then checking to see if picture is ready for download
---
The status ID is 25
Elapsed time: 0 seconds. State: inProgress
Elapsed time: 1 seconds. State: inProgress
Elapsed time: 2 seconds. State: inProgress
Elapsed time: 3 seconds. State: done
picture ready for download at http://192.168.1.1/files/90014a68423861503e0302775cb7b500/100RICOH/R0010094.JPG
Writing file from the following URL
http://192.168.1.1/files/90014a68423861503e0302775cb7b500/100RICOH/R0010094.JPG
download complete
The EV is now 0.0. Did it work? If so, take a moment to celebrate.
Test of taking picture and then checking to see if picture is ready for download
---
The status ID is 26
Elapsed time: 0 seconds. State: inProgress
Elapsed time: 1 seconds. State: inProgress
Elapsed time: 2 seconds. State: inProgress
Elapsed time: 3 seconds. State: done
picture ready for download at http://192.168.1.1/files/90014a68423861503e0302775cb7b500/100RICOH/R0010095.JPG
Writing file from the following URL
http://192.168.1.1/files/90014a68423861503e0302775cb7b500/100RICOH/R0010095.JPG
download complete
The EV is now 1.0. Did it work? If so, take a moment to celebrate.
Test of taking picture and then checking to see if picture is ready for download
---
The status ID is 27
Elapsed time: 0 seconds. State: inProgress
Elapsed time: 1 seconds. State: inProgress
Elapsed time: 2 seconds. State: inProgress
Elapsed time: 3 seconds. State: done
picture ready for download at http://192.168.1.1/files/90014a68423861503e0302775cb7b500/100RICOH/R0010096.JPG
Writing file from the following URL
http://192.168.1.1/files/90014a68423861503e0302775cb7b500/100RICOH/R0010096.JPG
download complete
The EV is now 2.0. Did it work? If so, take a moment to celebrate.
Test of taking picture and then checking to see if picture is ready for download
---
The status ID is 28
Elapsed time: 0 seconds. State: inProgress
Elapsed time: 1 seconds. State: inProgress
Elapsed time: 2 seconds. State: inProgress
Elapsed time: 3 seconds. State: done
picture ready for download at http://192.168.1.1/files/90014a68423861503e0302775cb7b500/100RICOH/R0010097.JPG
Writing file from the following URL
http://192.168.1.1/files/90014a68423861503e0302775cb7b500/100RICOH/R0010097.JPG
download complete
It’s a useful tool and there’s a lot more I - or you! - can do with it. I’ll be working with it more and posting more results.
For example, there are clearly differences between Z1 and SC2. I will be doing more testing to compare models and find out strengths and weaknesses of both.
If you use the script and have comments or suggestions, please let me know. If you’d like a Linux version of the executable, drop a line, we can make one.