Giter Club home page Giter Club logo

petfeedd's Introduction

petfeedd

About

petfeedd is a daemon for Raspberry Pi that will feed your pets. :)

Well, okay, obviously, it won't physically feed your pets. You'll still have to build the hardware part of the feeder. But it aims to wrap up the common functionality that pet feeders require into a format that can be reused for any number of feeder designs.

petfeedd provides:

  • A web interface for "programming" your feeder, that allows an arbitrary number of feeds of an arbitrary size.

  • A RESTful API that can be used to write third-party clients.

  • An auto-discovery protocol that can be used to find feeders on your network. Useful for writing third party clients.

  • A notification system that supports email, MQTT and Twitter.

petfeedd is implemented in NodeJS with Vue for the web front end.

A Note About Security

Let's have some common sense here. This is a pet feeder. Do not expose it to the Internet. It implements no security on the web interface. There are no users or passwords or API keys. Again, it's a pet feeder, not a banking site. Keep it safely behind your firewall.

If you are truly paranoid about this, you can use nginx as a proxy to add HTTP authentication, or simply not expose the web interface once you have it configured.

Supported Hardware

petfeedd is reported to be working without modification on:

  • Raspberry Pi Zero
  • Raspberry Pi Zero 2
  • Raspberry Pi 3
  • Raspberry Pi 3B v1.2
  • Raspberry Pi 3B+
  • Raspberry Pi 4

I generally recommend not using the Zero for a project like this. The limited onboard memory tends to be problematic.

Documentation

Contributing

Patches are always welcome if you have some cool functionality you would like to add.

Author

Rebecca Peck

License

GPLv3

petfeedd's People

Contributors

dependabot[bot] avatar maju6406 avatar rebeccathedev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

petfeedd's Issues

Failed at step CHROOT spawning /usr/local/bin/pipenv: No such file or directory

After following "Build from source" direction, I attempt to start the service and get the titled error in the syslog. My cloned dir is /home/pi/petfeedd. My pi is a model 3 B+. I'm not super familiar with creating services, but could this be a directory error within the petfeedd.service file? Also, why did the directions create a user, but never use it? The user in the petfeedd.service file is root.

Issue reading GPIO

Upon starting petfeedd the service starts but unable to communicate with GPIO even though everything installs correctly.

`
root@petfeeder:/opt/petfeedd# tail -f /var/log/syslog
Aug 21 22:16:28 petfeeder pipenv[2398]: /root/.local/share/virtualenvs/petfeedd-0kLIorXM/lib/python3.5/site-packages/gpiozero/devices.py:451: PinFactoryFallback: Falling back from rpigpio: No module named 'RPi'

Aug 21 22:16:28 petfeeder pipenv[2398]: 'Falling back from %s: %s' % (name, str(e))))

Aug 21 22:16:28 petfeeder pipenv[2398]: /root/.local/share/virtualenvs/petfeedd-0kLIorXM/lib/python3.5/site-packages/gpiozero/devices.py:451: PinFactoryFallback: Falling back from rpio: No module named 'RPIO'

Aug 21 22:16:28 petfeeder pipenv[2398]: 'Falling back from %s: %s' % (name, str(e))))

Aug 21 22:16:28 petfeeder pipenv[2398]: /root/.local/share/virtualenvs/petfeedd-0kLIorXM/lib/python3.5/site-packages/gpiozero/devices.py:451: PinFactoryFallback: Falling back from pigpio: No module named 'pigpio'

Aug 21 22:16:28 petfeeder pipenv[2398]: 'Falling back from %s: %s' % (name, str(e))))

Aug 21 22:16:28 petfeeder pipenv[2398]: * Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)

Aug 21 22:16:47 petfeeder pipenv[2398]: 10.204.33.126 - - [21/Aug/2018 22:16:47] "GET / HTTP/1.1" 200 -

Aug 21 22:16:47 petfeeder pipenv[2398]: 10.204.33.126 - - [21/Aug/2018 22:16:47] "GET /api/events HTTP/1.1" 200 -

Aug 21 22:16:47 petfeeder pipenv[2398]: 10.204.33.126 - - [21/Aug/2018 22:16:47] "GET /api/status HTTP/1.1" 200 -
`

Feed button does nothing

I have started my container with the following:

docker run -d --restart always --privileged -v /etc/localtime:/etc/localtime -v /opt/petfeedd.db:/petfeedd/petfeedd.db -v /etc/petfeedd.conf:/petfeedd/petfeedd.conf -p 0.0.0.0:8080:8080 -p 0.0.0.0:11211:11211 peckrob/petfeedd-arm32v6

I have placed petfeedd.conf in the folder and per the logs it seems to be seeing the config. Despite this, setting my GPIO pin to 27, nothing happens when clicking feed now. I have verified I can manually trigger this pin outside of petfeedd.

Config file found at ./petfeedd.conf
Parsing configuration.
petfeedd 2022-01-30 23:19:26,410 (INFO): Logging enabled.
petfeedd 2022-01-30 23:19:26,482 (INFO): Starting web worker.
petfeedd 2022-01-30 23:19:26,500 (INFO): Starting time worker.
petfeedd 2022-01-30 23:19:26,528 (INFO): Starting notification worker.
petfeedd 2022-01-30 23:19:26,551 (INFO): Starting feed worker.
petfeedd 2022-01-30 23:19:26,570 (INFO): Starting auto discovery worker.

If it means anything, I'm running on a pi zero w.

Modify to turn on a relay?

I have an existing pet feeder i've modified to run with a relay and pi, not a servo. Would it be possible to use this for that purpose instead?

Timezone in Docker

hey, very nice work with the docker-image :-D i am currently building a new cat-feeder using your code and so far it works perfect!

i found one minor issue though:
the docker image seems not respect the local timezone of the raspberry:

  • Pi is set to timezone "Europe/Zurich" using raspi-config
  • $ date shows correct local date and time
  • $ docker run --privileged -v /opt/petfeedd.db:/petfeedd/petfeedd.db -v /etc/petfeedd.conf:/petfeedd/petfeedd.conf -p 0.0.0.0:8080:8080 peckrob/petfeedd-arm32v7 with logging=enabled shows all times from docker-container are 1 hour off (eg: local date on raspberry=23:10:33 - log-entry in docker-container = 22:10:33)

would be nice if there would be an option to respect this

Adding Seconds to Schedule Feeds

Is it possible to add the seconds to the schedule feeds? I have a particular Kitty that will go to the feeder that comes out first and he runs fast while his brother takes his time, So we always try to set out feeders a maximum of 5 to 10 seconds apart so the kitty will go for his first, but since these are regular internal electronic clocks on the feeders, both feeders will eventually get out of sync within 2 days. Thanks!

Settings page blank

I just attempted to install petfeed on a Raspberry Pi 3 Model B, I had a bit of an issue with the dependencies but I seem to have gotten them resolved. Hashes did not match. I have an issue where I can get to petted via my web browser, but the settings page is blank with just the navigation banner displayed. Is this intended?

KeyError: 'gpio'

Hello,

I have just installed the Docker version and I'm getting the error below:
192.168.0.100 - - [13/Aug/2019 07:53:04] "GET /api/status HTTP/1.1" 200 -
petfeedd 2019-08-13 07:53:07,158 (INFO): Found a feed event. Dispensing 1 feeds.
192.168.0.100 - - [13/Aug/2019 07:53:07] "POST /api/feed HTTP/1.1" 200 -
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/petfeedd/src/feed_worker.py", line 50, in run
self.feed(feed_event.size)
File "/petfeedd/src/feed_worker.py", line 68, in feed
feed_size_time = float(self.config["gpio"]["servo_feed_time"]) * float(feed_size)
File "/usr/local/lib/python3.7/configparser.py", line 958, in getitem
raise KeyError(key)
KeyError: 'gpio'

Prior to installing and running this, I did an apt-get update and apt-get upgrade.

'_get_pk_value' removed in peewee 3.0.

Love this project and excited to get it working. I've assembled everything and tried installing the code in the virtual environment as instructed. No dice there, so I tried making sure all dependencies are installed globally (the raspberry pi here is single-purpose for me, so not too concerned about this) and just running the code straight. Here's what I get:

2018-06-21 13:29:00,753] ERROR in app: Exception on /api/feed [POST]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/flask/_compat.py", line 33, in reraise
raise value
File "/usr/lib/python3/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File "/opt/petfeedd/src/web_worker.py", line 97, in feed_now
feed_event = FeedEvent.create(size=1, name="On Demand")
File "/usr/local/lib/python3.5/dist-packages/peewee.py", line 5315, in create
inst.save(force_insert=True)
File "/opt/petfeedd/src/models/BaseModel.py", line 14, in save
if self._get_pk_value() is None:
AttributeError: 'FeedEvent' object has no attribute '_get_pk_value'

Usable for watering?

Will the program work also to dispense water into the bowl? I imagine I'd have to get a different new rotator that would be water tight.

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.