Giter VIP home page Giter VIP logo

chdk-ptp-java's Introduction

CHDK-PTP-Java

Pure Java (jsr80 usb) interface to the Cannon cameras running CHDK PTP

Interface reference https://github.com/c10ud/CHDK/blob/master/core/ptp.h

Using in other project

This code is has mirrored public repository available under: https://git.man.poznan.pl/stash/projects/KWE/repos/chdk-ptp-java/browse

Artifacts and maven repository

The codes found there are automatically tested and built as artifacts using Jenkins CI server and uploaded to maven repository: https://maven.man.poznan.pl/repository/webapp/browserepo.html?pathId=kiwi-libs-snapshots:org/chdk/ptp/java/CHDK-PTP-Java

Which can be later used in gradle project by simply defining the repository maven address:

repositories
{
    maven() { url 'https://maven.man.poznan.pl/repository/kiwi-repo' } // virtual repo
}

and adding appropriate entry in build.gradle or relevant in pom.xml

dependencies
{
	compile 'org.chdk.ptp.java:CHDK-PTP-Java:+'
}	

Versioning

For the sake of usability, rapid development and usage sanity we use semantic versioning: http://semver.org/

Example Usage

Try to follow chdk.ptp.java.standalone.LiveViewApiDemo.java but part of the example is below:

	    cam = CameraFactory.getCamera(SupportedCamera.SX160IS);
	    cam.connect();
	    cam.setOperaionMode(CameraMode.RECORD);
	    int i = 0;
	    BufferedImagePanel d = new BufferedImagePanel(cam.getView()); // displays live view
	    Random random = new Random();
	    while (true) {
		d.setImage(cam.getView());
		++i;
		cam.setZoom(i % 100);
		if (i % 40 == 0) {
		    cam.setZoom(random.nextInt(100));
		}

		if (i % 8 == 0) {
			cam.setZoom(random.nextInt(100));
			cam.setFocus(random.nextInt(1000) + 100);
		}
		cam.setFocusMode(FocusMode.AUTO);
	    }

Instalation

Download gradle

cd ~/
wget https://services.gradle.org/distributions/gradle-2.2-bin.zip
unzip gradle-2.2-bin.zip
echo "export PATH=\$PATH:$HOME/gradle-2.2/bin" >> ~/.bashrc
source ~/.bashrc

Set-up gradle

Artifactory plugin requires a file

$HOME\.gradle

to be created and filled with the following two lines:

USER=wont_be_used
PASSWORD=but_needs_to_be_here

Eclipse integration

Spring offers Gradle integration which can be acquired from: https://github.com/spring-projects/eclipse-integration-gradle

Check out project

Use console git:

mkdir ~/git
cd ~/git
git clone https://github.com/acamilo/CHDK-PTP-Java.git

or Eclipse plugin.

Build

cd CHDK-PTP-Java
gradle build

Open in eclipse

Import Gradle Project from within Eclipse.

other problems

I.E Afternoon wasters...

on some OSes gvfs will grab the PTP device and you'll get this error.

javax.usb.UsbPlatformException: USB error 6: Unable to claim interface: Resource busy

The solutionin ubuntu is this.

gsettings set org.gnome.desktop.media-handling automount false

To un do this change false to true.

Sometimes, cam.setRecordingMode() will fail but the camera will otherise be responsive.

see thread: http://chdk.setepontos.com/index.php?topic=10664.10

solition is to either kill gvfs-gphoto2-volume-monitor or to make it perminent, change it's name so it doesn't start.

Other OSes

This uses libusb4java so it probably works in windows and mac. I've never tried it though.

chdk-ptp-java's People

Contributors

acamilo avatar alex73 avatar ankhazam avatar danielftavares avatar kralo avatar madhephaestus avatar

Watchers

 avatar  avatar

Forkers

danielftavares

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.