rgee0 / seeds2

A Python application for live tweeting photos of your seeds growing on your Raspberry Pi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

seeds2

A Python application for live tweeting photos - in this case a germinating broad bean - from a Raspberry Pi. This is fork of the original seeds2 project by Alex Ellis. The main difference is the addition of a timelapse option which will retain locally the tweeted images, thus enabling production of a timelapse video when the activity that you're capturing completes. Here's an example on YouTube

InternetOfPulses Timelapse on YouTube

Installation

  • Install dependencies
$ sudo apt-get -y install python3-pip libopenjp2-7 libopenjp2-7-dev libopenjp2-tools
$ sudo pip3 install -r requirements.txt
  • Get the Roboto font from:
$ curl -sSL https://github.com/googlefonts/roboto/releases/download/v2.138/roboto-unhinted.zip -o roboto.zip
  • Extract it
$ unzip roboto.zip -d roboto

Configuration

Most configuration can be achieved without altering the python code via config.py.

  • Update your access keys

Now add your Twitter keys into the config.py file:

"twitter": {
                "enabled": True,
                "message" : "Internet of seeds #InternetOfSeeds",
                "ckey": "",
                "csecret": "",
                "akey": "",
                "asecret": ""
            },

For testing without Tweeting you can set enabled to False in the twitter section of config.py.

  • The default mode of operation is for timelapse to be disabled - images are deleted once tweeted. To enable timelapse set timelapse to True in config.py. This will create a series of timestamped images in the images directory which can later be combined to create a video. Its also possible to run in timelapse mode without Tweeting, just set twitter enabled to False and timelapse to True in config.py.

Tip: If capturing over a long period of time make sure you have sufficient disk space.

Running

Interactively: Run once using python3 main.py

Scheduled: Use cron and this entry:

*/10 08-20 * * * /home/pi/seeds2/seed-it.sh

This results in one image/tweet every 10 minutes between 8am and 8:50pm.

About

A Python application for live tweeting photos of your seeds growing on your Raspberry Pi.


Languages

Language:Python 98.6%Language:Shell 1.4%