Code Monkey home page Code Monkey logo

eda040-project's Introduction

EDA040 camera project

Project in the course EDA040 at Lund University.

User guide

Once you have installed the client application and deployed the server on a camera you can start the application and connect to a camera by long tapping on a frame and choose which camera to connect to. If you are using a proxy or the fake camera, use the IP-address at the bottom of the list. (NOTE: You can only display one camera if using proxy or fake camera.)

To close a connection, simply long tap on the image from that camera and choose Yes on the dialog that comes up.

By default, the cameras use idle mode, which displays one picture every five second. If any of the connected cameras detect motion in the picture, all of them will enter video mode displaying a continuously stream of images.

The current mode is displayed in the lower part of each frame with a V for video mode and nothing for idle mode. This is where the delay between the capturing and displaying of the image is displayed (Note: This relies on the clock in both your device and the camera which means that it will only be as correct as they are.)

When the cameras enter video mode, the triggering camera will display [T] in the same area, letting you know which of them forced the other into video mode.

For debug purposes, there are extra buttons available when pressing the menu button on your Android device for forcing the cameras to enter video or idle mode.

Server UML

Server UML

Client UML

Client UML

Problems experienced

We can't say that we have experienced that many problems, except with LJRT. Mostly, the development has been smooth. We have had several problems with Eduroam, specifically with the lack of open ports making it impossible to test the app on a physical device.

Also, the LJRT library has carried with it some problems. Mostly some implementation details which differ between that and Java.

How to build and run

$ git clone git://github.com/Meldanya/eda040_project.git
$ wget http://dl.google.com/android/android-sdk_r15-linux.tgz
$ tar xvzf android-sdk_r15-linux.tgz
$ PATH=$PATH:"`pwd`/android-sdk-linux/tools"
$ echo "sdk.dir = ../../android-sdk-linux/" > eda040_project/Client/local.properties
$ cd eda040_project

Beware! You have to redo the third last command if you switch shell.

Server

Server should be started before trying to connect with client....

$ cd Server

Cross compiled

Make sure you did not execute the commands in Proxy server below.

$ echo 'CAMERAPASSWORD' > password.local
$ ./compile2c.sh argus-X argus-Y < password.local

Enjoy, ice cold.

Proxy server

$vi src/ImageCapture.java

Change to:

import se.lth.cs.cameraproxy.Axis211A;
import se.lth.cs.cameraproxy.MotionDetector;
// import se.lth.cs.camera.Axis211A;
// import se.lth.cs.camera.MotionDetector;

// Real and fake.
// this.camera = new Axis211A(); 
// this.motionDetector = new MotionDetector();

// Proxy.
this.camera = new Axis211A("argus-4", 8080); // Proxycamera.
this.motionDetector = new MotionDetector("argus-4", 8080); // Proxycamera

Because we're now using modern Java, exceptions must be caught.

$ $EDITOR src/CameraServer.java

In run(), change to:

try {
	socket.close();
} catch (IOException e) {
	System.err.println("cold not close connection");
}	

The files we move in this step is only needed as mock placeholders for the C-crosscompiler.

$ mv src/se /tmp

Now you can compile the junk:

$ ant

Open a new shell and run the following:

$ telnet argus-4
telnet> /etc/CameraProxy 8080

Now return to the previous shell. It's time for execution! (not the lethal one):

$ java -cp bin:lib/* CameraServer

Client

$ cd Client

Emulator

$ android create avd -n api_10 -t target-10
$ emulator -avd api_10 &

Wait until emulator is started and Android OS i up an running. Then compile, upload and watch the lolcat.

$ ant debug
$ ant installd
$ adb lolcat

If the program should freeze at any point, run the following:

$ ddms &

And find the process se.lth.student.eda040.a1 in the upper left frame and press the stop button.

Start the application

Proxy

Choose proxy-camera.

Direct connection

Choose a real camera.

Real phone

Connect the phone to your computer.

$ ant debug
$ ant installd
$ adb lolcat

Start the application Choose a real camera.

Implementation Details

The sync feature is implemented but not currently used by our application. This is due to it requires synced timestamps on all systems, including the Emulator. This is not an issue we intend to solve.

Contributors

  • Erik Jansson
  • Erik Westrup
  • Oscar Olsson
  • Tommy Olofsson

eda040-project's People

Contributors

erikagnvall avatar erikw avatar tommyolofsson avatar tor-oscar avatar

Watchers

 avatar  avatar  avatar

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.