YMMV

* your mileage may vary

Sunday, 13 March 2016

Pi Radio - New Version Under Jessie

New Version of Pi-Radio running under Jessie.  Removed Pygame, some buttons, button size is larger and I rotated the screen 180 for better placement.

Download the latest version of Raspbian Jessie Lite which have the Frame Buffer Drivers install by default.  https://www.raspberrypi.org/downloads/raspbian/

uname -a
Linux raspberrypi 4.1.13+ #826 PREEMPT Fri Nov 13 20:13:22 GMT 2015 armv6l GNU/Linux.

Update sources
sudo apt-get update

Run raspi-config to set local environment
sudo raspi-config

Follow setup for TFT
https://www.raspberrypi.org/forums/viewtopic.php?f=45&t=105797

Install required packages
sudo apt-get install python3 python3-dev python3-setuptools python3-pip -y
sudo apt-get install python3-pil -y
sudo apt-get install mpd mpc -y
sudo apt-get install netpbm -y
sudo pip3 install evdev
sudo pip3 install python-mpd2

mkdir Music
mkdir radio

Get radio files from google drive and place them in "radio"
directory should look like this
/home/pi/radio/<files>
https://drive.google.com/open?id=0BwUGkFVOqZsPTFQxWm9BUjkxczg

Compile "Quick and dirty PNM to RGB565 converter"
https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=57810&p=893723#p893723
gcc -O2 -o ppmtorgb565 ppmtorgb565.c

sudo cp /etc/mpd.conf /etc/mpd.orig
sudo nano /etc/mpd.conf

Update these lines:
< music_directory "/home/pi/Music"
< #connection_timeout "none"
< playlist_directory "/home/pi/radio/playlists"
< user "root"
< #group                          "root"
< bind_to_address "0.0.0.0"
< mixer_type      "software"      # optional
<restore_paused "yes"

Configure alsa-base.conf
sudo nano /etc/modprobe.d/alsa-base.conf
# This sets the index value of the cards but doesn't reorder.
options snd_usb_audio index=0
options snd_bcm2835 index=1
# Does the reordering.
options snd slots=snd-usb-audio,snd-bcm2835

Source
http://raspberrypi.stackexchange.com/questions/40831/how-do-i-configure-my-sound-for-jasper-on-raspbian-jessie

Set autologin
http://dumb-looks-free.blogspot.fr/2016/01/jessie-systemd-debian-auto-login-to.html

By default the console goes blank after X minutes.  This is set in /etc/kbd/config:
sudo nano /etc/kbd/config
BLANK_TIME=30

Modify .bashrc adding the following lines to the end
Nano .bashrc
clear
setterm --cursor off
cd radio/
sudo python3 pi-radio2.py

reboot

3 comments:

  1. Hi,

    I am following your tutorial but am stuck at this part:

    Compile "Quick and dirty PNM to RGB565 converter"
    https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=57810&p=893723#p893723
    gcc -O2 -o ppmtorgb565 ppmtorgb565.c

    When I run the command I get this:

    $ gcc -O2 -o ppmtorgb565 ppmtorgb565.c
    gcc: error: ppmtorgb565.c: No such file or directory
    gcc: fatal error: no input files
    compilation terminated.

    Any ideas on what I have missed to get this error?

    Thanks

    ReplyDelete
  2. Hello
    it looks like you did not download ppmtorgb565.c or the file is not in the current working directory.

    ReplyDelete
  3. Perfect, I have downloaded the files now and placed them in /home/pi/radio/ directory and all is working.
    Many thanks

    ReplyDelete