Git Product home page Git Product logo

alarmpi's Introduction

Welcome to the AlarmPi project.

It's "A Simple Spoken Weather And News Clock" for your Raspberry Pi. Please feel free to take it, and do what you will with it. This project is the culmination of 3 separate projects, an overview can be seen here: https://youtu.be/-Or5jmBqsNE

this project hasn't been updated in a while but still worked as of Jan 2018

And see the details of each of the three parts.

  1. Alarm clock https://youtu.be/julETnOLkaU

  2. Light https://youtu.be/WpM1aq4B8-A

  3. NAS https://youtu.be/T5eKBfstpI0

Setup

required packages:

sudo apt-get install python-feedparser python-dnspython mpg123 festival

optional packages (not all commands will work in all environments):

For Ivona support: sudo pip install pyvona

For pico2wave support (this does not work as of 2016/03/13, but may work in the future -- see below for alternate instructions)

sudo apt-get install libttspico-utils

YOU MUST USE RAMFS to avoid wear on your card and to enable Google Voice.

sudo mkdir -p /mnt/ram
echo "ramfs       /mnt/ram ramfs   nodev,nosuid,nodiratime,size=64M,mode=1777   0 0" | sudo tee -a /etc/fstab 
sudo mount -a

If you wish to use Ivona voice from Amazon you must get a beta test account at:

https://www.ivona.com/us/account/speechcloud/creation/

  1. Open an account
  2. Generate credentials
  3. Put accesskey and secretkey in config file

and finally to set your alarm for 733AM Mon-Fri

crontab -e 33 7 * * 1-5 /home/pi/alarmpi/sound_the_alarm.py

Alternate install for pico2wave:

If you need to build it yourself don't worry, it's easy. I thieved most of these instructions from here. But that was written for wheezy and I found that it was a little trickier with jessie. Here we go:

First of all you need to open the file /etc/apt/sources.list and check it contains (the last line should be uncommented) the following lines:

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

Then as it says in the comment, do:

sudo apt-get update

Now, in the alarmpi project we are instructed to make a ramdrive and mount it on /mnt/ram -- I do a lot of my work here because it saves the SD card some wear and tear. This assumes that is already in place -- note that this should be mounted without the noexec option. Modify as you wish.

mkdir -p /mnt/ram/pico_build
cd /mnt/ram/pico_build
apt-get source libttspico-utils
cd svox-1.0+git*

In your favorite editer, modify the file debian/control such that it no longer specifies the automake version. That is change the line that looks like this:

Build-Depends: debhelper (>= 9~), automake1.11, autoconf, libtool, help2man, libpopt-dev, hardening-wrapper

So that it looks like this:

Build-Depends: debhelper (>= 9~), automake, autoconf, libtool, help2man, libpopt-dev, hardening-wrapper

And save it. Then you can do this:

sudo dpkg-buildpackage -rfakeroot -us -uc
cd ..
sudo dpkg -i libttspico-data_*
sudo dpkg -i libttspico0_*
sudo dpkg -i libttspico-utils_*i

That should be it. Note that if you get a permission denied error, your /mnt/ram was mounted with the noexec option set in fstab. Build somewhere else.

You can test your install like this:

pico2wave -w test.wav "it works! "
aplay test.wav

Cheers!

  • Thanks again to Michael Kidd for adding the config file and giving this project a real structure.
  • Thanks also to Viktor Bjorklund for adding Ivona support.
  • Thanks to Craig Pennington for adding pico2wave support and some housekeeping.

alarmpi's People

Contributors

cpenning avatar senlinhailang avatar skiwithpete avatar tylercode avatar victorbjorklund 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alarmpi's Issues

Yahoo Finance broken

Either with the close of datatables.org or with a shift in the Yahoo Finance API, the stocks portion of this program in un-usable.

Not able to run script outside of install directory

Not sure where the issue is but when I try to run the script outside of the alarmpi directory. For example if I run it from the pi user directory I get the following output.
pi@raspberrypi ~ $ python alarmpi/sound_the_alarm.py
Traceback (most recent call last):
File "alarmpi/sound_the_alarm.py", line 31, in
head = Config.get('main','head')+" "
File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'main'

Looks like it's having problems with the config file but no errors are thrown when I run it from within the alarmpi directory.

As a result I'm also unable to get the cron job to properly run. Any ideas?

Cannot escape symbols in Stocks

For example, using Ivona, if you have the S&P 500 stock on your list (or in my specific case, the voo stock) it will simply stop working after it pronounces the "S".

Can provide any additional details.

Altcoin Prices.

Just a ideal:
I would love to see other alt coin's being read out not just BTC. My python is not so grate or I would just do it my self. But if you can put in a option to do this from https://coinmarketcap.com that would be grate.

Some feature requests :)

Great alarm project Skiwithpete!

I have a few ideas that in opinion would improve the "experience". :D

Firstly having a dimmable LED which would go fromm 0% to 100% (or set %) in a certain time period (say 10minutes), To try and gently awake you, not just BAM from absolutely no light to turned on light.
Also same principle could be achieved with the music. From light music to more and more loud and when the time period comes to get awake fire up the news and weather report.

Instead of local music you could use some streaming service (like Soundcloud)?

Support for other tts engines.

Hi I got alarmpi working grate and its very useful thank you. I have but one request I have to use pico2wave because I don't trust amazon as far as i can throw them. Anyways the pico2wave speech syntheses has to much base and it sounds distorted, Festival was another option but sounds terrible compare to espeak and I would like a male sounding voice compare to pico. is there a way I can use espeak tts engine instead of pico? I thank you for your time and if this was already done im sry to post it back up. I just did not find anything on how to change it to espeak online.

Support for other languages - Inclusion of num2words

Hi,

actually I want to "teach" my alarmpi installation German. The replacements of some hard coded strings (e.g. the bbc reference in get_news.py or the text explanation of the weather and some others) was easily done and I'm not sure if would be worth the effort to have the text completely separated from the code). The change of better_spoken_numbers.py is actually a bit more complicated.
I wonder if you are aware of the num2words package https://github.com/savoirfairelinux/num2words
Maybe it is a good idea to switch to have a "lang=" in the main section of alarm.config and switch to this external package then to build the numbers your self?

Adding option for OpenWeatherMap API

What are the odds of adding the option for OpenWeatherMap API? We each would have to get our own API key of course. I am able to get yahoo weather about three out of every ten attempts.

Thanks!

Cleaning up *..mp3

I believe I found a bug in line 55 of get_trygoogle.py:

#Cleanup any mp3 files created in this directory.
rmcmd = 'rm -f ' + ramdrive + '*.' + tail

In line 21 of alarm.config we find the following value for tail:

tail=.mp3

I found the issue in the code above because I heard my 'That's all for now' greeting twice. This problem After a reboot. In the command line in found the following output when I ran my code:

cleaning up now
rm -f /mnt/ram/*..mp3

Disclaimer: I am completely new to coding and Github, hence I am not sure how to report a bug properly.

Always network down notification?

Hi,
I just started using alarmpi and it looks as it is a good starting point for my goals.
I've some beginners questions. I hope it is OK that I open several issues but so it is more ordered.

The alarmpi.txt "I could not talk to the network test host. I believe the network is down." is promted every time, although the network is clearly running (it gets the weather and bbc news). Where is the check if the network is down actually being performed (I found some def _testnet(self) routine in alarmenv.py but I don't see the connection to the [netdown] section in alam.config that triggers the message. Or is this just a bad example of the generals txt to speech routine?

Ivona changed to Polly

After a long, long day I finally have my alarmpi working on the Raspberry I received yesterday. Thanks so much for all your effort Pete! This was exactly what I was looking for :)

One final minor problem is that it seems nog longer possible to create credentials for Ivona. Amazon just announced 'Polly'.
The Ivona page reads 'We are proud to announce that our Text-to-Speech technology is now available under the Amazon Polly AWS service. Click here to learn more.'
The Amazon press release: http://phx.corporate-ir.net/phoenix.zhtml?c=176060&p=irol-newsArticle&ID=2226605

Is there a way we can still create Ivona credentials or can we use the Polly service?

Ivona: odd pronunciation of apostrophes

I'm not sure if this happens with google as I very much like Ivona voices, but I've noticed it does not pronounce apostrophes correctly. It almost uses it as a word separator (It pronounces "It's" as "It s"). Probably best thing to do would be to just escape them out for Ivona (Unless it happens for all voices)

Similar to #16 but wanted to add it on it's own since it is a distinct issue and not related to stocks alone.

Status of pico2wave?

I'm a bit confused about the support of pico2wave.
In the readme it is stated
"For pico2wave support (this does not work as of 2016/03/13, but may work in the future "
but at the bottom
"Thanks to Craig Pennington for adding pico2wave support".

I just did
sudo apt-get install festival libttspico-utils and then
pico2wave -w Test.wav "A short test" ; mplayer Test.wav; rm Test.wav
worked out of the box without any compilation needed (I'm using a Raspi running Raspbian Jessie).

But if set

[trygoogle]
enabled=0

....
[trypico2wave]
enabled=1

I get

Traceback (most recent call last):
  File "./sound_the_alarm.py", line 42, in <module>
    raise ImportError('Failed to load '+section)
ImportError: Failed to load trypico2wave

And as far as I can see, there is a file
get_trygoogle.py and one get_tryivona.py but no get_trypico2wave .
I used git clone https://github.com/skiwithpete/alarmpi
As there is already the section in the alarm.config and the thanks in the Readme and pico2wave works I wonder why the last step is missing (for me it looks like a very simple module but maybe I don't see some complications)? I would really appreciate to use the TTS locally with pico2wave.

GOOGLE TTS

Hello!
First of all, I would like to thank you for your awesome project! I've been using it for months now, but lately I've had some issues with google tts. I'm not reciving mp3 back, I googled about the problem and it seems that google tts is a lot restricted now, I've tried to enter the "captcha", so that my rpi is recognized by google but it didn't work. I'm wondering if you have similar issue? Or if you know a way to work around it.

I'm very thankful for answers.

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.