Giter Site home page Giter Site logo

piclodio2's Introduction

Piclodio2

This version is not anymore maintained, please take a look to Piclodio 3

Piclodio2 is a web radio player and a also an alarm clock. You can add url stream to complete the collection. Scheduling alarm clock is easy and can be periodic.

alt tag

Prerequisites

pip for python dependencies, Mplayer to play stream, at to stop alarm clock automatically, sqlite3 to store data, git to clone the project and python-alsaaudio to manage sound

sudo apt-get install python-pip mplayer at sqlite3 git python-alsaaudio

Install Django framework from pip

sudo pip install Django==1.7.7

Clone the project. Notice we didn't use sudo here. The folder has to belong to the Pi user.

cd /home/pi
git clone https://github.com/Sispheor/Piclodio2.git

Option 1 : Use Django's server to run piclodio

It's not the best practice but it's easy and fast.

As pi user :

Copy the init script

sudo cp Piclodio2/run_piclodio/init_script/piclodio.sh /etc/init.d/piclodio
sudo chmod +x /etc/init.d/piclodio
sudo update-rc.d piclodio defaults

You can edit it to customise settings Start piclodio :

sudo /etc/init.d/piclodio start

That's it, you can now access your piclodio at http://youip:8000

Option 2 : Run Piclodio with apache

Prerequisites

sudo apt-get install apache2 libapache2-mod-wsgi

Move Piclodio in default apache directory and give access

sudo mv /home/pi/Piclodio2 /var/www
sudo chown -R www-data: /var/www/Piclodio2

Copy vHost from sources folder into apache vHost configuration folder

sudo cp /var/www/Piclodio2/run_piclodio/apache/piclodio.conf /etc/apache2/sites-available/piclodio

Enable the vHost

sudo a2ensite piclodio

And last, we have to allow the Apache user www-data to use mplayer. Edit the sudoers file with the command

sudo visudo

and add this line at the end of the file

www-data ALL=NOPASSWD:/usr/bin/mplayer* ,/usr/bin/pgrep mplayer ,/usr/bin/killall mplayer, /usr/bin/at

Add Apache user to audio group to allow him to control sound

sudo usermod -a -G audio www-data

Reload Apache

sudo service apache2 reload

That's it! Piclodio is now available on it IP address on http://RPI_IP_ADDRESS/piclodio

piclodio2's People

Contributors

arnaudmm avatar sispheor avatar yoranmaulny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

piclodio2's Issues

Alarm clock doesn't work anymore after edit

The prob is in the crontab
This is what I get after edit:

40 7 * * [u'1', u'2', u'3', u'4', u'5'] env DISPLAY=:0.0 python /var/www/Piclodio2/runWebRadio.py 1 >/dev/null 2>&1 #piclodio 1

What we should have

40 7 * * 1,2,3,4,5 env DISPLAY=:0.0 python /var/www/Piclodio2/runWebRadio.py 1 >/dev/null 2>&1 #piclodio 1

Fill debug page

one button to run a speaker test

output of picsound debug
output of crontab -l
output of select * from alarmClock
output of ps aux | grep mplayer

Play mp3 rescue file in case of "no internet connection"

Sometime (like this morning) it happened that i don't have any internet connection so my Piclodio does not turn music on, so i don't get up and I'm late !!

The idea is to check return code of mplayer [stream_url]

if return code is not 0 (stream is dead or we dont have any internet connection..), then we "mplayer backup.mp3"

Documentation Issues

The documentation should start with a description of what the project is and what it does. I figured it out from bits of information further on but it should be right at the top.

I also noticed the docs use wget instead or pip, is the raspberry pi restricted from using pip to install python packages? pip install Django==1.6 seems easier.

Also many of these instructions might be good to fold into an init or setup script for convenience. But that's a nice to have :-)

Add MP3/OGG Support

Hi

Maybe possible to play a local mp3,ogg sound instead of a radio ?
I could only select a webradio

Thanks by advance

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.