mvmn / gp2srv

GPhoto2 Web Interface
GNU Lesser General Public License v3.0
53 stars 9 forks source link

Set libgphoto2 path + live view not working on Nikon N70 #10

Closed spectrared closed 7 years ago

spectrared commented 7 years ago

Prior issue was closed, however, while the jar no longer throws the version error, it now claims it cannot locate either gphoto2 or the libgphoto2 (it appears to want a copy from a Debian distribution?). I ensured the $PATH contains the proper path, and tried using the command setting(-gphoto2path) with no effect. I did not capture the error output but I can reproduce the issue and send it along next time I access the laptop.

Probably a separate issue, but under Linux, images from the camera are downloaded to the proper location, but not displayed in the browser -- this may be a cockpit error.

mvmn commented 7 years ago

using the command setting(-gphoto2path) This is for version before 1.x, in newer versions you should use -Djna.library.path=/path/to/libgphoto2/folder

spectrared commented 7 years ago

No joy.. tmo.pdf

spectrared commented 7 years ago

My error.. The gphoto2 library and libgphoto2 locations are in different subdirectories and need to be specified independently. Thanks for the help/

mvmn commented 7 years ago

java -jar Gphoto2Server-2.7.jar -Djna.library.path=/opt/local/bin The problem here is that you have to put -D<prop>=<val> kind of parameters before -jar <jar file>. Like this: java -Djna.library.path=/opt/local/bin -jar Gphoto2Server-2.7.jar

mvmn commented 7 years ago

Thanks for the help/

No problem. I assume you've got things running now, right?

spectrared commented 7 years ago

More of less. There are a couple of issues, probably specific the OS X.

There is no image of the last capture. Download and delete works just fine, but I cannot see images via the webpage.

Any attempt to change some camera settings shows as working, but they fail and cause debug output on the terminal. After that I simply get a generic error when trying to capture a photo. Thanks for the help. Linux is back on the shelf for now.

mvmn commented 7 years ago

Which camera do you have? Which browser do you use? Which capture format do you have set on your camera (RAW or JPEG)?

they fail and cause debug output on the terminal

Copypaste it here and I'll take a look.

spectrared commented 7 years ago

Camera is a Nikon D70, set to shoot JPEG basic at 3008x2000, I ran Gphoto2 -- summarize in the attached. Browser varies -- Safari on an iPhone4, Safari on an iPad (2017), Safari on an iMac running Sierra (Safari 10.1.1), or Firefox 53.0.2

The attached terminal session should be pretty straightforward Logged in (user beowolf [yes, I know it should be beowulf, but that is how I created it..]) Killed the PTP process ran gphoto2 --summary (yes, misspelled it the first time) displayed run.sh to display the actual startup command. took a few shots, changed some settings, then got an error on capture and download. all downloaded photos appeared in gp2srv_images except the last. No captured images seem to be on the SD card (card is in a Compact Flash adapter) killed the process, shut off the camera, redid everything with similar results. I just pasted the server portion at the bottom of the session. Loggp2srv.txt

mvmn commented 7 years ago

Seems like you may have capture target set to internal RAM. Change it to memory card. It might be you're overfilling camera's internal RAM and that's why errors start to occur.

https://cloud.githubusercontent.com/assets/1076779/13042833/50c6cdde-d3cc-11e5-84f1-bbdb6d883d54.png

spectrared commented 7 years ago

You are correct. Did not catch that before. Now the shots are appearing more or less where they should on the camera or computer, and named appropriately. I’m still not getting any main page preview of the last shot, but I can go to files and see it on the camera. If I have JPEG+NEF selected as the Quality setting, it works once, thereafter I only see the NEF image. I also got a POST to /capture error somewhere along the line, but the server and camera kept on going. I will try a more structured test later. This may be sufficient for my near term needs if I avoid trying to change settings on the fly.

Maybe I should try one of the pre-version 1 releases to see if that will show the preview?

Thanks.

On 2017, May 22, , at 5:19 PM, Mykola Makhin notifications@github.com wrote:

Seems like you may have capture target set to internal RAM. Change it to memory card. It might be you're overfilling camera's internal RAM and that's why errors start to occur.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

mvmn commented 7 years ago

Did you try live view? I don't actually have any other preview functionality on Camera tab (which is the one you call main page I guess) - just the live view.

mvmn commented 7 years ago

Here's a demo of a usage https://www.youtube.com/watch?v=-noDPD6v7nY

spectrared commented 7 years ago

Yes,

With the target location fixed, Live View opens a large frame, but in the middle there is the missing image icon (in Safari). When I have an hour, I will hook everything back up and set up debug mode (I recall seeing a flag for that somewhere), turn on Live mode, take a picture (simple capture), refresh, then quit. I’ll send you the terminal session. Would that be helpful?

On 2017, May 22, , at 7:50 PM, Mykola Makhin notifications@github.com wrote:

Did you try live view?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

mvmn commented 7 years ago

Yes

mvmn commented 7 years ago

It would also help if you'd look in the browser console for errors.

spectrared commented 7 years ago

OK, not sure where the debug output went -- the terminal session looks pretty normal.. I did this all locally, rather than try over WiFi.. The camera is set for RAW+JPEG at the camera. I did not touch any configuration buttons in the application. Terminal Session.txt screen shot 2017-05-23 at 1 29 02 pm

Here is the sequence: boot OS X 10.6.8 connect camera

killall PTPCamera turn on camera kill the process again fix the capture target start server with DEBUG capture turn on Live View (ERROR UNSUPPORTED on terminal, nothing in browser except the checkmark is set) turn off LiveView capture capture-download delete stop server (CTRL-C) Turn on debug console in Safari Do the routine again capture Safari console as screenshot.

I hope this helps. The Safari output says something happened with LiveView, but I don't know why it would work for you and not here..

mvmn commented 7 years ago

What address do you have in address bar? 0.0.0.0:8080? Have you tried localhost:8080 or 127.0.0.1:8080 instead?

spectrared commented 7 years ago

just now — same result

On 2017, May 23, , at 2:06 PM, Mykola Makhin notifications@github.com wrote:

What address do you have in address bar? 0.0.0.0:8080? Have you tried localhost:8080 or 127.0.0.1:8080 instead?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

mvmn commented 7 years ago

ERROR UNSUPPORTED on terminal

Can you paste full error message please?

mvmn commented 7 years ago

P.S. Can you also ensure you have PTP mode set on you N70 in settings/USB?

http://www.nikonsupport.eu/europe/kdb/en/2007/13907/Image/d70_menu08_en.jpg

spectrared commented 7 years ago

The unsupported error is in the Terminal output at 13:16:16

x.mvmn.jlibgphoto2.exception.GP2Exception: GP_ERROR_NOT_SUPPORTED at x.mvmn.jlibgphoto2.util.GP2ErrorHelper.checkResult(GP2ErrorHelper.java:41) at x.mvmn.jlibgphoto2.GP2Camera.internalCapturePreview(GP2Camera.java:131) at x.mvmn.jlibgphoto2.GP2Camera.capturePreview(GP2Camera.java:163) at x.mvmn.gp2srv.camera.service.impl.CameraServiceImpl.capturePreview(CameraServiceImpl.java:33) at x.mvmn.gp2srv.web.servlets.LiveViewServlet.doGet(LiveViewServlet.java:53) 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:464) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:913) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:975) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:641) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:231) 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:695) Live view stopped: x.mvmn.jlibgphoto2.exception.GP2Exception GP_ERROR_NOT_SUPPORTED

The camera is on PTP mode according to the menu. Note that the D70 has an old version of that protocol, and Nikon's SDK does not support it. I thought gphoto2 worked though. I will see what I can find, but Nikons from somewhere around the D700 are different.

spectrared commented 7 years ago

Live view is not supported on Nikon DSLRs in PTP mode until the D90, according to the libgphoto2 documents. Everything else is supported, it appears. I imagine if the invocation hits the LiveView code, the unsupported error is thrown.

mvmn commented 7 years ago

Actually the live view over libgphoto2 is made by repeatedly capturing preview images. So no, that's not it.

That's why I've asked for stack trace - it appears capture preview command results in "not supported" error:

x.mvmn.jlibgphoto2.exception.GP2Exception: GP_ERROR_NOT_SUPPORTED at x.mvmn.jlibgphoto2.util.GP2ErrorHelper.checkResult(GP2ErrorHelper.java:41) at x.mvmn.jlibgphoto2.GP2Camera.internalCapturePreview(GP2Camera.java:131) at x.mvmn.jlibgphoto2.GP2Camera.capturePreview(GP2Camera.java:163) at x.mvmn.gp2srv.camera.service.impl.CameraServiceImpl.capturePreview(CameraServiceImpl.java:33) at x.mvmn.gp2srv.web.servlets.LiveViewServlet.doGet(LiveViewServlet.java:53)```

spectrared commented 7 years ago

Thanks for the help, many thanks. Capture-preview fails from the gphoto2 command line. I cannot ask you to change the way you are implementing the LiveView in the first tab. You got Java 1.5 working and helped me fix the configuration error on the camera, so all in all it is good. I can work with this for what I am doing - I'll just limit Capture to on-camera and navigate to the files tab for review. If I ever figure out development, I can create a tab for a simplified interface that lacks the items that will not work (and maybe implement a last captured frame using the features that work).

I would suggest noting in the readme that some features are camera dependent and LiveView in particular will not work on some early model Nikon DSLRs.

spectrared commented 7 years ago

..and it is D70.. (and apparently D40, D50, D70s and D80, probably D100)

mvmn commented 7 years ago

Ok, maybe I'll update the readme later.

This was a surprise for me though that some cameras won't even support capturing of preview - probably I'm spoiled by Canon's automation friendliness :-)

Also since this project is merely a web interface for (lib)gphoto2, perhaps it's up to (lib)gphoto2 to mention the partial feature support.

Regarding the simplified interface - on "camera" tab you have a possibility to hide all settings except for favorites (see "All / Favorites" buttons at the top). Each camera setting has a checkbox near it - that's the one to mark it as favorite.