Page 1 of 1

Control your reflex with gp2server

Posted: Mon Jun 15, 2015 8:43 am
by minimalfra
Hi I'm a Noobs...
I want to achieve this project: https://www.youtube.com/watch?v=_aXn34VpjB8,

first of all, I've intstalled app "maven" to install gphoto2, to install this I've followed this guide: http://www.yannock.be/computer/compilin ... spberry-pi

then I've intalled Java with this command: apt-get install openjdk-7-jdk

and Now in order to install gp2server from links on youtube guide, I downloaded the zip pack gp2srv-master in the folder home/pi/ and I run file ./build.sh

then I did the same thing with the gp2srv-0.01 from the answer link of youtube's user Mykola M.

and I run the file gp2srv-0.01.tar.gz with command: tar -zxvf gp2srv-0.01.tar.gz

but nothing generate the file ./rugp2srv.sh to run the webapp, like in the video...

thanks a lot in advance... :)

Re: Control your reflex with gp2server

Posted: Mon Jun 15, 2015 9:52 am
by xranby
Indeed, the downloaded gp2srv_0.01.zip release do not contain the ./rugp2srv.sh launch script.
https://github.com/mvmn/gp2srv/releases

The release instead contains an "executable" java jar
"The program is distributed as an executable JAR file + lib folder with dependencies (few more JAR files). Once started, it listens on port 8080 by default (use port command line parameter to set different value). "
https://github.com/mvmn/gp2srv

The following two command lines will start your application using this runnable jar file.

Code: Select all

cd gp2srv_0.01
java -jar GPhoto2Server-0.0.1-SNAPSHOT.jar

Re: Control your reflex with gp2server

Posted: Mon Jun 15, 2015 11:52 am
by minimalfra
hi thank you xranby for your answer...

But I'm sorry, Your advice is correct without errors but I can't access to port 8080

the address is this: raspberrypi.192.168.1.26:8080 because i'm not in local... is it true?

Re: Control your reflex with gp2server

Posted: Mon Jun 15, 2015 12:33 pm
by xranby
minimalfra wrote:hi thank you xranby for your answer...

But I'm sorry, Your advice is correct without errors but I can't access to port 8080

the address is this: raspberrypi.192.168.1.26:8080 because i'm not in local... is it true?
the address you posted can not be resolved by DNS nameservers.
try using the address using the ip-number only

http://192.168.1.26:8080

if you want to reach this address from outside your local network then you need to configure your broadband router and let it portforward traffic on port 8080 to the local ip-number 192.168.1.26

Re: Control your reflex with gp2server

Posted: Mon Jun 15, 2015 3:03 pm
by minimalfra
xranby wrote:Indeed, the downloaded gp2srv_0.01.zip release do not contain the ./rugp2srv.sh launch script.
https://github.com/mvmn/gp2srv/releases

The release instead contains an "executable" java jar
"The program is distributed as an executable JAR file + lib folder with dependencies (few more JAR files). Once started, it listens on port 8080 by default (use port command line parameter to set different value). "
https://github.com/mvmn/gp2srv

The following two command lines will start your application using this runnable jar file.

Code: Select all

cd gp2srv_0.01
java -jar GPhoto2Server-0.0.1-SNAPSHOT.jar
The Output of the command is this:

Code: Select all

Exeption in thread "main" java.lang.NullPointerExeption
                        at x.mvmn.gp2srv.GPhoto2ServerLauncher.main(GPhoto2ServerLauncher.java:4
1)
So maybe this command don't open the port 8080 you know ?

Image

Re: Control your reflex with gp2server

Posted: Mon Jun 15, 2015 3:37 pm
by xranby
minimalfra wrote:
xranby wrote:...

Code: Select all

cd gp2srv_0.01
java -jar GPhoto2Server-0.0.1-SNAPSHOT.jar
The Output of the command is this:

Code: Select all

Exeption in thread "main" java.lang.NullPointerExeption
                        at x.mvmn.gp2srv.GPhoto2ServerLauncher.main(GPhoto2ServerLauncher.java:4
1)
So maybe this command don't open the port 8080 you know ?
The program has aborted at line 41 of GPhoto2ServerLauncher.java
https://github.com/mvmn/gp2srv/blob/mas ... r.java#L41

The only way for this code to fail with a null pointer exception is that PathFinderHelper.findInPath("gphoto2", true) returns null,
the returned null.getAbsolutePath() then trigger the NullPointerException.

This means that gphoto2 command is not found on your system.

If you know where gphoto2 is located on your system then you can set the gphoto2path, for example if gphoto2 is installed in /home/pi/gphoto-suite-install/bin/bin/gphoto2 then use:
java -jar GPhoto2Server-0.0.1-SNAPSHOT.jar --gphoto2path=/home/pi/gphoto-suite-install/bin

Re: Control your reflex with gp2server

Posted: Tue Jun 16, 2015 7:51 am
by minimalfra
Hi xranby, almost everything is ok, I managed to use the webapp but not totally.... I can get only the preview of my reflex, but I can't access the settings, because this is the output:

Code: Select all

 2015-06-16 09:24:00.823 - ERROR: Failed to parse camera config
java.lang.Exception: Unable to parse type value RANGE
	at x.mvmn.gp2srv.service.gphoto2.ConfigParser.setSetting(ConfigParser.java:67)
	at x.mvmn.gp2srv.service.gphoto2.ConfigParser.parseConfigEntries(ConfigParser.java:50)
	at x.mvmn.gp2srv.service.gphoto2.command.GP2CmdGetAllCameraConfigurations.submitRawStandardOutput(GP2CmdGetAllCameraConfigurations.java:26)
	at x.mvmn.gp2srv.service.gphoto2.GPhoto2CommandService.executeCommand(GPhoto2CommandService.java:17)
	at x.mvmn.gp2srv.web.servlets.CameraControlServlet.processRequestByPath(CameraControlServlet.java:181)
	at x.mvmn.gp2srv.web.servlets.CameraControlServlet.doGet(CameraControlServlet.java:172)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
	at org.eclipse.jetty.server.Server.handle(Server.java:369)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:486)
	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:933)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:995)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
	at java.lang.Thread.run(Thread.java:701) 
why this error :?: :? :?:

Re: Control your reflex with gp2server

Posted: Tue Jun 16, 2015 9:24 am
by xranby
minimalfra wrote:Hi xranby, almost everything is ok, I managed to use the webapp but not totally.... I can get only the preview of my reflex, but I can't access the settings, because this is the output:

Code: Select all

 2015-06-16 09:24:00.823 - ERROR: Failed to parse camera config
java.lang.Exception: Unable to parse type value RANGE
	at x.mvmn.gp2srv.service.gphoto2.ConfigParser.setSetting(ConfigParser.java:67)
	at x.mvmn.gp2srv.service.gphoto2.ConfigParser.parseConfigEntries(ConfigParser.java:50)
	at x.mvmn.gp2srv.service.gphoto2.command.GP2CmdGetAllCameraConfigurations.submitRawStandardOutput(GP2CmdGetAllCameraConfigurations.java:26)
	at x.mvmn.gp2srv.service.gphoto2.GPhoto2CommandService.executeCommand(GPhoto2CommandService.java:17)
	at x.mvmn.gp2srv.web.servlets.CameraControlServlet.processRequestByPath(CameraControlServlet.java:181)
	at x.mvmn.gp2srv.web.servlets.CameraControlServlet.doGet(CameraControlServlet.java:172)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
	at org.eclipse.jetty.server.Server.handle(Server.java:369)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:486)
	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:933)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:995)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
	at java.lang.Thread.run(Thread.java:701) 
why this error :?: :? :?:
You should file a bugreport to the author of gp2srv
your camera/reflex sends a new type "RANGE" that is unknown by the software to handle.

CameraConfigEntry currently only know about DATE, MENU, RADIO, TEXT, TOGGLE types.
https://github.com/mvmn/gp2srv/blob/mas ... Entry.java#

use this link to send a bugreport and include the stacktrace that you pasted here
https://github.com/mvmn/gp2srv/issues/new
it may be good to include as much information as possible in the report like the model of the camera/reflex you are using.

Re: Control your reflex with gp2server

Posted: Tue Jun 16, 2015 9:59 am
by minimalfra
Just like that? https://github.com/mvmn/gp2srv/issues/1

xranby thanks for your support... ;)

Re: Control your reflex with gp2server

Posted: Tue Jun 16, 2015 10:10 am
by xranby
minimalfra wrote:Just like that? https://github.com/mvmn/gp2srv/issues/1
Excellent, its always good to document issues before your try fix them :)

I would recommend you to try learn how to fix the issue.
You can fix the issue by cloning her/his project and then send a "pullrequest" with a patch.

The first step is to clone a copy of gp2srv sourcecode

Code: Select all

git clone https://github.com/mvmn/gp2srv
then you need to edit the file gp2srv/blob/master/src/main/java/x/mvmn/gp2srv/model/CameraConfigEntry.java
and change line 8 to contain RANGE
the third step is to compile gp2srv
in order to compile the software you need to have maven installed

Code: Select all

sudo apt-get install maven
make your own build of the software using the build script that runs the maven "mvn" command

Code: Select all

cd gp2srv
sh build.sh
this will produce a new
GPhoto2Server-0.0.1-SNAPSHOT.jar
inside the target directory
target/gp2srv-bin/GPhoto2Server-0.0.1-SNAPSHOT.jar
copy this file into /home/pi/gp2srv_0.01

When you have verified that your fix work then commit your work using git.

first step here is to create your own github account and then "fork" the gp2srv project
you do this by pressing the Fork button at this page
https://github.com/mvmn/gp2srv

After you have forked the project allows you to commit your fix
Configure git to know who you are:

Code: Select all

git config --global user.email "your_email@example.com"
git config --global user.name "Billy Everyteen"
commit the file, if you get a choice of which texteditor to use then pick the one you know how to use.
You need to enter a commit message before you press save inside the text editor during the commit -v step.
A good commit message contains a subject at the first line
"CameraConfigEntry: Add RANGE type

RANGE is sent by reflex Nikon D5200

Signed-off-by: Your Name <your@email>
"

Code: Select all

git add gp2srv/blob/master/src/main/java/x/mvmn/gp2srv/model/CameraConfigEntry.java
git commit -v
when your work is committed then add your own fork as a remote and upload it to your own github account using push

Code: Select all

git remote add minimalfra https://github.com/minimalfra/gp2srv
git push minimalfra master
the final step is to send a pull request using the generate pull request button seen on your github accounts gp2srv page

Re: Control your reflex with gp2server

Posted: Tue Jun 16, 2015 10:29 am
by xranby
minimalfra wrote:Just like that? https://github.com/mvmn/gp2srv/issues/1

The Author of gp2srv has asked you to input additional information into your bugreport
mvmn commented 14 minutes ago

Ok, please run in console "gphoto2 --list-all-config" and send me the output.
P.S. Pleas also check which version of gphoto2 do you have.

Re: Control your reflex with gp2server [RESOLVED]

Posted: Mon Jul 06, 2015 8:42 pm
by minimalfra
this is the final release running

https://github.com/mvmn/gp2srv/releases/tag/0.05

:D :D :D