Git Product home page Git Product logo

seedscan's Introduction

seedscan

Simple python utility using scanimage and ffmpeg to make long duration timelapse videos with a flatbed scanner.

Setup notes

Scanner permissions

By default USB scanner can only be accessed by scanimage via sudo. To allow user acces, find the scanner's vendor and product hex IDs with lsusb. IDs are the two colon seperated values after 'ID'.

$ lsusb
$ Bus 001 Device 002: ID 04b8:0110 Seiko Epson Corp. GT-8200U/GT-8200UF [Perfection 1650/1650 PHOTO]`

Then add the following to a file named 50-usb-epsonscanner.rules (or something similar) in /etc/udev/rules.d using your vendor and product IDs.

SUBSYSTEM=="usb", ATTRS{idVendor}=="04b8", ATTR{idProduct}=="0110", MODE="0666"

Reboot and you should be able to use scanimage without sudo.

Cron

Scanns are triggered via a cron job. Add the following to the user's cronfile (i.e. crontab -e). A scan every 10 minutes seems like a good place to start, but this can be changed to fit the experiment.

*/10 * * * * python /path/to/seedscan/scan.py

CircuitPython (for sensors)

To run the temp/humidity/pressure sensors, we need CircuitPython and the library for the sensor (AdaFruit MS8607)First. I am using a RasperryPi Zero W for which detailed instructions can be found here: CircuitPython, MS8607 library. Here is the short version.

Check that you are running python 3* and pip to match, then install CircuitPython:

$ sudo pip3 install --upgrade setuptools
$ sudo pip3 install --upgrade adafruit-python-shell
$ wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py
$ sudo python3 raspi-blinka.py

Note: this will set python 3 as system wide default and requires a reboot to complete. Also, output indicates that pre-installing setuptools may be unnecessary.

Then install the library for the MS8607:

sudo pip3 install adafruit-circuitpython-ms8607

Last thing is to change permissions so that non-root users can access I2C devices:

$ sudo groupadd i2c
$ sudo chown :i2c /dev/i2c-1
$ sudo chmod g+rw /dev/i2c-1
$ sudo usermod -aG i2c user

Then you should be able to access ic2-i withou t elevating privileges. Test is with:

i2cdetect -y 1

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.