brewpi / brewpi-tools Goto Github PK
View Code? Open in Web Editor NEWVarious tools to setup/update/configure BrewPi
License: GNU General Public License v3.0
Various tools to setup/update/configure BrewPi
License: GNU General Public License v3.0
As a total noob with Raspian Pi I'm having 'fun' with the brew pi install - the issue being that it appears the new version of Raspain Stretch has been 'upgraded' to PHP7, removing all PHP5 code, so the brew pi tools install fails. It seems there are some workarounds for the OS, although I'm still working on persuading them to work... Meanwhile is there any likelyhood of the brewpi tools being upgraded to use PHP7?
this is the line in the install that causes the issue :
sudo apt-get install -y apache2 libapache2-mod-php5 php5-cli php5-common php5-cgi php5
none of libapache2-mod-php5 php5-cli php5-common php5-cgi php5 are included in the Raspian Stretch
following instructions per this article: http://docs.brewpi.com/en/latest/automated-brewpi-install/automated-brewpi-install.html and I get this:
pi@raspberrypi:~ $ git clone https://github.com/BrewPi/brewpi-tools.git ~/brewpi-tools
Cloning into '/home/pi/brewpi-tools'...
remote: Counting objects: 479, done.
remote: Total 479 (delta 0), reused 0 (delta 0), pack-reused 479
Receiving objects: 100% (479/479), 138.44 KiB | 0 bytes/s, done.
Resolving deltas: 100% (288/288), done.
pi@raspberrypi:~ $ sudo ~/brewpi-tools/install.sh
Checking for Internet connection...
Success!
Checking whether this script is up to date...
/home/pi/brewpi-tools is up-to-date.
***** Installing/updating required packages... *****
Reading package lists...
Building dependency tree...
Reading state information...
Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5-cli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package libapache2-mod-php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5-cgi is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapache2-mod-php5' has no installation candidate
E: Package 'php5-cli' has no installation candidate
E: Package 'php5-common' has no installation candidate
E: Package 'php5-cgi' has no installation candidate
E: Package 'php5' has no installation candidate
*** ERROR ERROR ERROR ERROR ERROR ***
----------------------------------
See above lines for error message
Setup NOT completed
bummer.......
We should make an install.log file to assist in troubleshooting installations. This log would be a mirror of all text printed to screen and input by the user, so we can see exactly what did and didnt work, and what settings the user used.
Wildcard imports make the code hard to read.
from git import *
Repo()
is harder to read than
import git
git.Repo()
When importing parts of modules, make it explicit, so a reading can see where things come from at the top of the file:
from git import Repo
Maybe the imports should be excepted too, like in brewpi.py
The updater should check its own repo/remote for updates :)
Our update script does a few things that are very much oriented at Linux. On Windows, we could skip those parts, but the git actions to update the repo and updating the controller should still work.
The update script can check on which platform it is running and still do most of the actions when not running on Linux.
Prior to running, install.sh should check for a working network connection, otherwise downloads will fail.
While not likely, a user might image an sd card, copy the installer file to the card (not knowing it needs to download more data) and boot the Pi from it without connecting it to a network (or configuring wifi properly, etc) the installer will fail and leave the user in a 'bad' state as some, but not all, of the install did take place.
On a fresh pi, git stash failed because user.name and user.email were not set in the git config.
When doing a stash, git wants to store the user with the stash and fails.
Most users will probably not have this set up, because they only pull. We need to catch this error and offer an easy way to configure the settings.
***** Updating cron for the brewpi user... *****
no crontab for brewpi
See above lines for error message
Setup NOT completed
The updater should quit all brewpi instances by invoking brewpi.py --quit.
Line 142:
else
case "$webPath" in
y | Y | yes | YES | Yes)
webPath="/var/www";;
* )
pass;;
esac
pass is Python, not bash! (or am I wrong?)
Reported by Azuu
install.sh references a URL that is no longer in existence.
The catch all exceptions should be replaced with catching just the expected exceptions. Catching all is dangerous and could hide errors.
Currently, the updater just says 'don't forget to update the hex file, too'. We should have a way of a) checking the version of the Arduino hex file and if it is compatible with the current version of BrewPi, and b) download the hex file and update that as well
The update script only checks whether it is up-to-date compared to the local copy of the remote. It should do a git fetch first!
Checking whether the update script is up to date
Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
/home/geo/BrewPi/brewpi-tools is up-to-date.
We'll need to error check connections, otherwise we get a false up-to-date message
We now run apt-get update before installing packages when the latest update is not very too long ago. This can cause a failure if the package repo was updated in the meantime. We should take the safe option and update always.
@vanosg Agree?
The python packages on apt are often very outdated, we should not rely on it.
The latest version is also different for various operating systems. (Linux flavors or Windows).
It would be better to install the packages from pip. The installer and upgrade script should be modified for this.
Related issue (demonstrates the problem with psutil):
BrewPi/brewpi-script#47
There is no reason the script cannot update itself: the python scripts are loaded in memory and can just be overwritten with a new version while the old version is still running.
This will be less confusing for users.
Update script has many hardcoded paths to the repo's. These should be removed:
Check the default location, if the repo is not found there, prompt.
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.