diff --git a/README.md b/README.md index 4301e78..e5c47ef 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ I'm assuming that you are starting with the Raspian Minimal Linux distribution. 1. Make sure your Raspberry Pi is up to date with the latest packages & firmware with `sudo apt-get update; sudo apt-get dist-upgrade` 2. Enable I2C by executing `sudo raspi-config` as described in Adafruit's tutorial: https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c 3. Add the necessary Python and GStreamer dependencies using the command: `sudo apt-get install wiringpi python-bottle python-requests python-oauth2client python-httplib2 python-setuptools python-pip python-dev python-dateutil python-smbus gstreamer0.10-x gstreamer-tools gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly python-gst0.10` -4. Install hack-clock via `wget https://github.com/deckerego/hack-clock/releases/download/2.1.6/python-hackclock_2.1.6-1_all.deb; sudo dpkg -i python-hackclock_2.1.6-1_all.deb` +4. Install hack-clock via `wget https://github.com/deckerego/hack-clock/releases/download/2.1.7/python-hackclock_2.1.7-1_all.deb; sudo dpkg -i python-hackclock_2.1.7-1_all.deb` 5. Tweak `/etc/hack-clock.conf` and `/etc/default/hack-clock` to fit your needs (GPIO pins, correct weather station, etc.). A list of observed weather stations is available at http://forecast.weather.gov/stations.php 6. Reboot your Pi to re-load modules and start the IDE web server @@ -62,6 +62,9 @@ commenting out the I2S interfaces and un-commenting the `audio=on` parameter. Fo #dtoverlay=hifiberry-dac #dtoverlay=i2s-mmap +Once you have commented out the I2S settings as shown above, subsequent upgrades should +just skip the I2S changes so you don't need to keep re-commenting things out. + You will also need to remove the custom `/etc/asound.conf` configuration file on your Pi - it does not need to be present if you are using the headphone jack. diff --git a/debian/changelog b/debian/changelog index af3aad1..7ded14a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ -hackclock (2.1.6-1) stable; urgency=low +hackclock (2.1.7-1) stable; urgency=low - * Fixed IFTTT event name trigger + * Detect if I2S is already _ignored_, then allow standard Pi audio to continue + * Changed icons for "save" and "restore" in IDE -- DeckerEgo Tue, 01 Mar 2017 21:32:00 -0500 diff --git a/debian/python-hackclock.postinst b/debian/python-hackclock.postinst index 1df1076..5310765 100644 --- a/debian/python-hackclock.postinst +++ b/debian/python-hackclock.postinst @@ -10,28 +10,33 @@ chown -R pi:pi /home/pi/hack-clock echo "Installing missing Python modules..." pip install -r /usr/share/doc/hack-clock/requirements.txt -# Set the hifiberry-dac i2s module -echo "Installing I2S audio..." -if [ -e $BOOT_CONFIG ] && grep -q "^dtoverlay=hifiberry-dac$" $BOOT_CONFIG; then - echo "hifiberry already installed" +# If I2S audio is already ignored, don't insert the I2S overlays +if [ -e /boot/config.txt ] && grep -q -E "^#.*dtoverlay=i2s-mmap" /boot/config.txt; then + echo "I2S already ignored, skipping I2S overlay" else - echo "dtoverlay=hifiberry-dac" | sudo tee -a $BOOT_CONFIG -fi - -# Enable (optional) i2s-mmap to get rid of popping and set volumes -if [ -e $BOOT_CONFIG ] && grep -q "^dtoverlay=i2s-mmap$" $BOOT_CONFIG; then - echo "i2s-mmap already installed" -else - echo "dtoverlay=i2s-mmap" | sudo tee -a $BOOT_CONFIG -fi - -# Make sure old audio is disabled -if [ -e $BOOT_CONFIG ] && grep -q -E "^dtparam=audio=on$" $BOOT_CONFIG; then - echo "Commenting out dtparam=audio=on in $BOOT_CONFIG" - sudo sed -i "s|^dtparam=audio=on$|#dtparam=audio=on|" $BOOT_CONFIG &> /dev/null -elif [ -e $MOD_CONFIG ] && grep -q "^snd-bcm2835" $MOD_CONFIG; then - echo "Commenting out snd-bcm2835 in $MOD_CONFIG" - sudo sed -i "s|^snd-bcm2835|#snd-bcm2835|" $MOD_CONFIG &> /dev/null + # Set the hifiberry-dac i2s module + echo "Installing I2S audio..." + if [ -e $BOOT_CONFIG ] && grep -q "^dtoverlay=hifiberry-dac$" $BOOT_CONFIG; then + echo "hifiberry already installed" + else + echo "dtoverlay=hifiberry-dac" | sudo tee -a $BOOT_CONFIG + fi + + # Enable (optional) i2s-mmap to get rid of popping and set volumes + if [ -e $BOOT_CONFIG ] && grep -q "^dtoverlay=i2s-mmap$" $BOOT_CONFIG; then + echo "i2s-mmap already installed" + else + echo "dtoverlay=i2s-mmap" | sudo tee -a $BOOT_CONFIG + fi + + # Make sure old audio is disabled + if [ -e $BOOT_CONFIG ] && grep -q -E "^dtparam=audio=on$" $BOOT_CONFIG; then + echo "Commenting out dtparam=audio=on in $BOOT_CONFIG" + sudo sed -i "s|^dtparam=audio=on$|#dtparam=audio=on|" $BOOT_CONFIG &> /dev/null + elif [ -e $MOD_CONFIG ] && grep -q "^snd-bcm2835" $MOD_CONFIG; then + echo "Commenting out snd-bcm2835 in $MOD_CONFIG" + sudo sed -i "s|^snd-bcm2835|#snd-bcm2835|" $MOD_CONFIG &> /dev/null + fi fi # Boot upon start diff --git a/package.sh b/package.sh index 68564fc..bc08a56 100755 --- a/package.sh +++ b/package.sh @@ -7,7 +7,7 @@ rm home/pi/hack-clock/backups/blocks_clock.* cd .. echo "Compressing file..." -tar Jcf hackclock_2.1.6.orig.tar.xz hack-clock/ +tar Jcf hackclock_2.1.7.orig.tar.xz hack-clock/ cd hack-clock dpkg-buildpackage -rfakeroot -uc -us diff --git a/setup.py b/setup.py index 3ec6fbc..3e6b3b8 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ def all_files(newroot, oldroot): setup( name='HackClock', - version='2.1.6', + version='2.1.7', description='A hackable alarm clock for the Raspberry Pi', author='DeckerEgo', author_email='john@deckerego.net', diff --git a/srv/hackclock/views/blocks/editor.tpl b/srv/hackclock/views/blocks/editor.tpl index cd178a9..93ed0a4 100644 --- a/srv/hackclock/views/blocks/editor.tpl +++ b/srv/hackclock/views/blocks/editor.tpl @@ -29,15 +29,15 @@