nathanpjones / garagepi Goto Github PK
View Code? Open in Web Editor NEWOverengineer your garage door with your Raspberry Pi!
License: MIT License
Overengineer your garage door with your Raspberry Pi!
License: MIT License
Installing pip...
ERROR: This script does not work on Python 2.7 The minimum supported Python version is 3.6. Please use https://bootstrap.pypa.io/pip/2.7/get-pip.py instead.
modifying setup.sh to use https://bootstrap.pypa.io/pip/2.7/get-pip.py fixes the issue,
Telegram Notifs fail
RPi Model:
RPI 4
OS Release:
Raspbian Stretch
Service Status:
active and running
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: [2021-01-05 02:02:57,092] INFO in telegram: Created TelegramNotification object Test notification from GaragePi
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: [2021-01-05 02:02:57,095] INFO in telegram: Triggering Telegram notification
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: Traceback (most recent call last):
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/flipflop.py", line 455, in run
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: protocol_status, app_status = self.server.handler(self)
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/flipflop.py", line 871, in handler
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: result = self.application(environ, start_response)
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/flask/app.py", line 2464, in call
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: return self.wsgi_app(environ, start_response)
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/flask/app.py", line 2450, in wsgi_app
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: response = self.handle_exception(e)
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/flask/app.py", line 1867, in handle_exception
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: reraise(exc_type, exc_value, tb)
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/flask/_compat.py", line 39, in reraise
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: raise value
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/flask/app.py", line 2447, in wsgi_app
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: response = self.full_dispatch_request()
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/flask/app.py", line 1952, in full_dispatch_request
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: rv = self.handle_user_exception(e)
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/flask/app.py", line 1821, in handle_user_exception
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: reraise(exc_type, exc_value, tb)
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/flask/_compat.py", line 39, in reraise
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: raise value
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/flask/app.py", line 1950, in full_dispatch_request
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: rv = self.dispatch_request()
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/flask/app.py", line 1936, in dispatch_request
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: return self.view_functionsrule.endpoint
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/webserver/garage.py", line 227, in test_telegram
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: event.trigger()
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/common/telegram.py", line 36, in trigger
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: apobj.notify(body=self.event_name)
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/apprise/Apprise.py", line 442, in notify
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: if not py3compat.asyncio.notify(coroutines, debug=self.debug):
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/home/pi/garage_pi/venv/lib/python3.5/site-packages/apprise/py3compat/asyncio.py", line 79, in notify
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: loop = asyncio.get_event_loop()
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/usr/lib/python3.5/asyncio/events.py", line 671, in get_event_loop
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: return get_event_loop_policy().get_event_loop()
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: File "/usr/lib/python3.5/asyncio/events.py", line 583, in get_event_loop
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: % threading.current_thread().name)
2021-01-05 02:02:57: (mod_fastcgi.c.2543) FastCGI-stderr: RuntimeError: There is no current event loop in thread 'Thread-3'.
When using the online install script I get the following. It looks like pip is killing off support for Python 2.7. No easy fix that I could find. Those python3 format strings and other python3 only syntax is peppered through out the pip code.
Installing pip...
Traceback (most recent call last):
File "", line 24244, in
File "", line 199, in main
File "", line 82, in bootstrap
File "/tmp/tmpy2ZHCX/pip.zip/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
RPi Model:
RPi0W
OS Release:
RPiOS lite 2020-01-11
Service Status:
Unit garagepi.service could not be found.
Edited the setup script to use pip 2.7
Running the online setup, "crashes" at:
"Setting up virtual environment...
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3'"
RPi Model:
Pi Zero W
OS Release:
Linux raspberrypi 5.10.17+ #1414 Fri Apr 30 13:16:27 BST 2021 armv6l GNU/Linux
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
Service Status:
Unit garagepi.service could not be found.Updating packages...
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists...
Installing pip...
Collecting pip<21.0
Using cached pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.3.4
Uninstalling pip-20.3.4:
Successfully uninstalled pip-20.3.4
Successfully installed pip-20.3.4
Installing virtualenv...
Requirement already satisfied: virtualenv in /usr/local/lib/python2.7/dist-packages (20.4.6)
Requirement already satisfied: importlib-resources>=1.0; python_version < "3.7" in /usr/local/lib/python2.7/dist-packages (from virtualenv) (3.3.1)
Requirement already satisfied: filelock<4,>=3.0.0 in /usr/local/lib/python2.7/dist-packages (from virtualenv) (3.0.12)
Requirement already satisfied: importlib-metadata>=0.12; python_version < "3.8" in /usr/local/lib/python2.7/dist-packages (from virtualenv) (2.1.1)
Requirement already satisfied: distlib<1,>=0.3.1 in /usr/local/lib/python2.7/dist-packages (from virtualenv) (0.3.1)
Requirement already satisfied: appdirs<2,>=1.4.3 in /usr/local/lib/python2.7/dist-packages (from virtualenv) (1.4.4)
Requirement already satisfied: six<2,>=1.9.0 in /usr/local/lib/python2.7/dist-packages (from virtualenv) (1.16.0)
Requirement already satisfied: pathlib2<3,>=2.3.3; python_version < "3.4" and sys_platform != "win32" in /usr/local/lib/python2.7/dist-packages (from virtualenv) (2.3.5)
Requirement already satisfied: contextlib2; python_version < "3" in /usr/local/lib/python2.7/dist-packages (from importlib-resources>=1.0; python_version < "3.7"->virtualenv) (0.6.0.post1)
Requirement already satisfied: typing; python_version < "3.5" in /usr/local/lib/python2.7/dist-packages (from importlib-resources>=1.0; python_version < "3.7"->virtualenv) (3.10.0.0)
Requirement already satisfied: singledispatch; python_version < "3.4" in /usr/local/lib/python2.7/dist-packages (from importlib-resources>=1.0; python_version < "3.7"->virtualenv) (3.6.1)
Requirement already satisfied: zipp>=0.4; python_version < "3.8" in /usr/local/lib/python2.7/dist-packages (from importlib-resources>=1.0; python_version < "3.7"->virtualenv) (1.2.0)
Requirement already satisfied: configparser>=3.5; python_version < "3" in /usr/local/lib/python2.7/dist-packages (from importlib-metadata>=0.12; python_version < "3.8"->virtualenv) (4.0.2)
Requirement already satisfied: scandir; python_version < "3.5" in /usr/local/lib/python2.7/dist-packages (from pathlib2<3,>=2.3.3; python_version < "3.4" and sys_platform != "win32"->virtualenv) (1.10.0)
Setting up virtual environment...
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3'
Fresh install of Jessie on RPI2 B model (40 Pin GPIO)
Almost everything installed perfect... Did run into a snag with the SECRET_KEY not generating at the end. I was able to resolve this by manually running the cmd and redirectly the output to the app.cfg. I am able to hit webserver page.
I have GPIO pin 7 configured to a relay. Currently I am seeing not seeing the Open button (when clicked/confirmed) trigger the GPIO pin 7. To confirm my wiring and hardware, I installed webiopi (w/patch for v1.7.x) and this was able to trigger the relay.
Also worth mentioning is.... The CPU/GPU temps are not registering.
Was hoping this would work, but appears there is something missing, perhaps a config?
Immediately after registering as open, the garage registers as closed again. This happens even as the garage is still open.
Note the timestamps in the data listed. This started happened after a recent update of system packages, but unfortunately I can't nail down a specific timeline. This setup has been otherwise working flawlessly for over a year, or since the last release update.
2022-05-12 14:52:17 | SensorTrip | Door state changed to CLOSED.
2022-05-12 14:52:16 | SensorTrip | Door state changed to OPEN.
2022-05-12 10:54:48 | SensorTrip | Door state changed to CLOSED.
2022-05-12 10:54:47 | SensorTrip | Door state changed to OPEN.
2022-05-12 10:53:03 | SensorTrip | Door state changed to CLOSED.
2022-05-12 10:53:02 | SensorTrip | Door state changed to OPEN.
2022-05-11 17:05:39 | SensorTrip | Door state changed to CLOSED.
2022-05-11 17:05:38 | SensorTrip | Door state changed to OPEN.
RPi Model:
raspberry pi zero w
OS Release:
Raspbian GNU/Linux 10 (buster)
Service Status:
N/A
The only notable log.
2022-05-10 19:21:25,414 [359 :0xb6f20900] CONTROL ERROR Exception while running controller [in app @ /home/pi/GaragePi/backend/app.py:113]
Traceback (most recent call last):
File "/home/pi/GaragePi/backend/app.py", line 111, in main
GaragePiController(config['IPC_PORT']).start()
File "/home/pi/GaragePi/backend/controller.py", line 50, in start
msg = socket.recv_multipart()
File "/home/pi/GaragePi/venv/lib/python3.7/site-packages/zmq/sugar/socket.py", line 566, in recv_multipart
parts = [self.recv(flags, copy=copy, track=track)]
File "zmq/backend/cython/socket.pyx", line 783, in zmq.backend.cython.socket.Socket.recv
File "zmq/backend/cython/socket.pyx", line 819, in zmq.backend.cython.socket.Socket.recv
File "zmq/backend/cython/socket.pyx", line 186, in zmq.backend.cython.socket._recv_copy
File "zmq/backend/cython/checkrc.pxd", line 13, in zmq.backend.cython.checkrc._check_rc
File "/home/pi/GaragePi/backend/app.py", line 99, in sigterm_handler
sys.exit(0)
SystemExit: 0
I installed GaragePi and edited app.cfg. I was able to access the GaragePi with a web browser login and see the CPU and GPU temps. If I change something in a python file or the app.cfg what is the best way to restart the services without rebooting?
I tried:
sudo service lighttpd restart
sudo service garagepi restart
But then the CPU and GPU temperature stay as "?" in the web browser until I reboot the RPi.
First of all thank you. I have been using my GaragePi for at least 5 years. I was forced to rebuild my pi today and i was attempting to install garagepi from scratch.
Setup does not complete.
Building wheel for pyzmq (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/pi/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xwqy_5t4/pyzmq/setup.py'"'"'; file='"'"'/tmp/pip-install-xwqy_5t4/pyzmq/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-bfg1f7em
cwd: /tmp/pip-install-xwqy_5t4/pyzmq/
Logs attached.
RPi Model: Raspberry Pi 3 Model B Rev 1.2
OS Release: 2020-05-27-raspios-buster-full-armhf.zip
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"Service Status:
Unit garagepi.service could not be found.Hi Nathan,
Great article. I'm just trying to see if the code/project will work with a Raspberry Pi Zero with Wireless
RPi Model: Zero W
https://core-electronics.com.au/raspberry-pi-zero-wh.html
OS Release: Raspbian Stretch Lite Kernel version 4.14
Apologies if this is not the right way to ask the question, as this is my first time with Github
Regards,
Arul.
RPi Model:
OS Release:
Service Status:
Have noticed after running garage_pi for several weeks it will eventually stop loading the webpage.
RPi Model:
rpi2
OS Release:
jessie
Service Status:
RPi Model: Raspberry Pi Zero
OS Release: Raspbian GNU/Linux 9 (stretch)
Service Status: Unit garagepi.service could not be found
No logs found
Error:
Fails at: Failed building wheel for pyzmq
Fails at: Failed building wheel for RPi.GPIO
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.