Git Product home page Git Product logo

pi-focus's Introduction

Pi-focus

This application provides a web-based interface to control the focus of a webcam on a Raspberry pi. Very useful on e.g. OctoPrint, where autofocus is not desirable

Building

The easiest way to build the application is to cross-compile it from a desktop PC

Go can very easily cross-compile to the Raspberry Pi and to build pi-focus you need to install the Go tools on your pc/mac:

https://golang.org/doc/install

To to build the application for the Raspberry Pi, clone the pi-focus files to your machine and in the pi-focus direcory use the following command:

env GOOS=linux GOARCH=arm GOARM=7 go build

When the compilation is done, you can transfer the application to your Pi using the deploy.sh script.

You will need to edit the deploy-script so that it uses the correct IP-address of your Pi

Deployment

When you have done that, just enter the following command. It will ask for the password for the pi user on the Pi, which will be raspberry unless you have changed it.

./deploy.sh

Execution

Now you can ssh to your Pi and start the application:

./pi-focus

When the application is running, you can enter the url :1080 (if using octopi, try octopi.local:1080) in your browser and then control the focus of your camera.

Setting up automatic start

To enable pi-focus to always run on your pi, a systemd definition is provided. You can activate it like this:

cd ~
sudo cp pi-focus.service /etc/systemd/system
sudo systemctl start pi-focus.service
sudo systemctl enable pi-focus

This will ensure that pi-focus always runs when you boot up your Pi.

pi-focus's People

Contributors

skjerk avatar

Stargazers

 avatar

Watchers

 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.