├── .gitignore
├── .travis.yml
├── Makefile
├── README.md
├── include
├── Api.h
├── Base64.h
├── CameraController.h
├── Command.h
├── Helper.h
├── Server.h
└── Settings.h
├── resources
├── error_messages.xml
└── settings.xml
├── src
├── Api.cpp
├── Base64.cpp
├── CameraController.cpp
├── Command.cpp
├── Helper.cpp
├── Server.cpp
├── Settings.cpp
└── main.cpp
└── webif
├── css
├── bootstrap-theme.css
├── bootstrap-theme.min.css
├── bootstrap.css
├── bootstrap.min.css
├── slider.css
└── styles.css
├── fonts
├── glyphicons-halflings-regular.eot
├── glyphicons-halflings-regular.svg
├── glyphicons-halflings-regular.ttf
└── glyphicons-halflings-regular.woff
├── img
├── debut_dark.png
├── loader.gif
├── pic.jpg
└── sos.png
├── index.html
├── js
└── app.js
└── lib
├── backbone-min.js
├── bootstrap-slider.js
├── bootstrap.min.js
├── caman.full.min.js
├── jquery.easing.1.3.js
├── jquery.min.js
└── underscore-min.js
/.gitignore:
--------------------------------------------------------------------------------
1 | #########
2 | # Compiled source #
3 | ###################
4 | *.com
5 | *.class
6 | *.dll
7 | *.exe
8 | *.o
9 | *.so
10 | *.bc
11 |
12 | # Logs and databases #
13 | ######################
14 | *.log
15 | *.sql
16 | *.sqlite
17 |
18 | # OS generated files #
19 | ######################
20 | .DS_Store
21 | .DS_Store?
22 | ._*
23 | .Spotlight-V100
24 | .Trashes
25 | ehthumbs.db
26 | Thumbs.db
27 |
28 | #.ignore .idea folder
29 | .idea/
30 | =======
31 | # Mac Stuff
32 | .DS_STORE
33 |
34 |
35 | image.jpg
36 | bin
37 |
38 | .cproject
39 | .project
40 | .settings/
41 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: cpp
2 | dist: trusty
3 | sudo: false
4 | compiler:
5 | - gcc
6 | addons:
7 | apt:
8 | packages:
9 | - libboost-dev
10 | - libboost-system-dev
11 | - libmicrohttpd-dev
12 | - libgphoto2-dev
13 | - libexiv2-dev
14 | script:
15 | - make VERBOSE=1
16 |
17 | before_deploy: "cd bin && tar -zcvf ../CameraControllerApi-$TRAVIS_TAG.tar.gz . && cd .."
18 | deploy:
19 | provider: releases
20 | api_key:
21 | secure: faqXDjv3SX3BYg36+a4xvFZ5L26sIz1u7edjtj1KgqIqUPrBXfj1FAkEjpEAlvLlS0OL2OaJghXua1NuZlzL7+dl2eRtD32oZWyejUS+jy2yFwRJ3oSXGL5T20MM5xFUpDXRm6VuoIFVfuzieJqzz7gVPMr/uT1JnCqbB3GEtAc=
22 | file: "CameraControllerApi-$TRAVIS_TAG.tar.gz"
23 | skip_cleanup: true
24 | on:
25 | repo: scheckmedia/CameraControllerApi
26 | tags: true
27 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | CC=g++ -g
2 | CXXFLAGS=-c -Wall -I include -std=c++0x
3 | LDFLAGS= -lboost_system -lgphoto2 -lmicrohttpd -lpthread -lexiv2
4 | CPP_FILES := $(wildcard src/*.cpp)
5 | OBJ_FILES := $(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
6 | EXECUTABLE=CameraControllerApi
7 | RESOURCES= resources/error_messages.xml resources/settings.xml webif
8 |
9 | all: dirs $(CPP_FILES) bin/$(EXECUTABLE)
10 |
11 | bin/$(EXECUTABLE): $(OBJ_FILES)
12 | $(CC) $(LDFLAGS) -o $@ $^ $(LDFLAGS)
13 |
14 | obj/%.o: src/%.cpp
15 | $(CC) $(CXXFLAGS) -c -o $@ $<
16 |
17 | dirs:
18 | @mkdir -p bin obj
19 | @cp -R $(RESOURCES) bin
20 |
21 |
22 | .PHONY: clean
23 | clean:
24 | $(RM) -rf $(EXECUTABLE) obj bin
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | CameraControllerApi
2 | ===================
3 | The CameraControlerApi is an attempt to control a DSLR via REST functionality. At the moment is it possible
4 | to change the camera settings (ISO, aperture, time), take pictures and stream the live view of the camera (only tested with a Nikon D90).
5 |
6 | ###Web-Interface###
7 |
8 | `http://device_ip:port/webif/`
9 |
10 |
11 | ###Demonstration###
12 |
13 | [](http://www.youtube.com/watch?v=tkMP7_gnoiU)
14 |
15 |
16 | How to use
17 | -----------
18 | You will get all valid data for a command from the "list" action.
19 |
20 | ###Settings###
21 |
22 | **List the configuration with validate values**
23 |
24 | `http://device_ip:port/settings?action=list`
25 |
26 |
27 |
28 | **ISO**
29 |
30 | `http://device_ip:port/settings?action=iso&value=200`
31 |
32 |
33 |
34 | **Aperture**
35 |
36 | `http://device_ip:port/settings?action=aperture&value=f/22`
37 |
38 |
39 |
40 | **Shutter Speed**
41 |
42 | `http://device_ip:port/settings?action=speed&value=1/1000`
43 |
44 |
45 |
46 | **Whitebalance**
47 |
48 | `http://device_ip:port/settings?action=whitebalance&value=Cloudy`
49 |
50 |
51 |
52 | ###Capture###
53 |
54 | **take a picture**
55 |
56 | `http://device_ip:port/capture?action=shot`
57 |
58 |
59 |
60 | **autofocus**
61 |
62 | `http://device_ip:port/capture?action=autofocus`
63 |
64 |
65 | ###File system###
66 |
67 | **list of the available images on camera**
68 |
69 | `http://device_ip:port/fs?action=list`
70 |
71 |
72 |
73 | **get an image**
74 |
75 | `http://device_ip:port/fs?action=get&value=filename.jpg&path=/path/to/file`
76 |
77 |
78 |
79 |
80 | Each method will response with a JSON file. If you want a XML response you have to put the command "&type=xml" on the end of the upper commands
81 |
82 |
83 | ####Live View
84 | live view will be generated as mjpeg-stream. you can easy implement this stream in html inside an image tag e.g:
85 | ```
86 |
87 |
88 |
89 |
90 | Live View
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 | ```
99 |
100 |
101 |
102 | ##Dependencies##
103 | ```apt-get install libboost-dev libboost-system-dev libmicrohttpd-dev libgphoto2-dev libexiv2-dev```
104 |
105 | + libgphoto
106 | + libboost
107 | + libboost-system
108 | + libmicrohttpd
109 | + libexiv2
110 |
--------------------------------------------------------------------------------
/include/Api.h:
--------------------------------------------------------------------------------
1 | //
2 | // Api.h
3 | // CameraControllerApi
4 | //
5 | // Created by Tobias Scheck on 09.08.13.
6 | // Copyright (c) 2013 scheck-media. All rights reserved.
7 | //
8 |
9 | #ifndef __CameraControllerApi__Api__
10 | #define __CameraControllerApi__Api__
11 |
12 | #include "CameraController.h"
13 | #include
14 | #include
15 | #include
16 | #include