===== Pi-Radio ===== Image: 2016-09-23-raspbian-jessie-lite.img IP Address: 192.168.0.121\\ PW:st0lenm0ments ---- ==== Upgrade ==== $ sudo raspi-config $ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get install htop python-pip idle idle3 ---- ==== Mount USB Stick ==== $ sudo mkdir /home/pi/stolenmoments $ sudo blkid /dev/sda1: LABEL="USB-STICK" UUID="3DE8-04D4" TYPE="vfat" PARTUUID="4ca531d6-01" $ sudo nano /etc/fstab edit: #USB Stick on /dev/sda1 UUID=3DE8-04D4 /home/pi/stolenmoments vfat utf8,umask=022,uid=pi,gid=pi 0 0 or: #USB Stick on /dev/sda1 /dev/sda1 /home/pi/stolenmoments vfat utf8,umask=022,uid=pi,gid=pi 0 0 $ sudo mount -a ---- ==== IP and Network configuration ==== === Enable the SSH Server === In Raspian Jessie it should be activated allready. If not enable the SSH server by opening the raspi-config: $ sudo raspi-config In 8. Advanced Options you can activate SSH. === Static IP Address === Look up your gateway: $ netstat -r -n Find you IP address: $ ip addr Give the Raspberry Pi a static IP address. Open the interfaces file: $ sudo nano /etc/network/interfaces Add these lines after "face eth0 inet dhcp": Or: # Ethernet auto eth0 allow-hotplug eth0 iface eth0 inet static address 192.168.0.121 netmask 255.255.255.0 gateway 192.168.0.1 dns-nameservers 8.8.8.8 8.8.4.4 Save and quit, ctl+o, Return, ctl+x.\\ Disable the DHCP-Client:\\ $ sudo service dhcpcd stop $ sudo systemctl disable dhcpcd Restart ethernet:\\ $ sudo ifdown eth0 $ sudo ifup eth0 Or/and reboot: $ sudo reboot ==== Login over SSH ==== One can login from your computer with: $ ssh pi@192.168.0.099 or with XWindows support: $ ssh -XY pi@192.168.0.099 PW: raspberry\\ === Miscellaneous === If the host key verification failed, one can remove the old key with:\\ $ ssh-keygen -R 192.168.0.099 And with\\ ~. one can terminate a broken ssh session. ---- ==== Setting up the radio ==== **Pi-FM-RDS**\\ [[https://github.com/Ginkgo23/PiFmRPi2]]\\ $ mkdir /home/pi/Pi-FM-RDS $ cd /home/pi/Pi-FM-RDS $ sudo apt-get install libsndfile1-dev $ wget https://github.com/Ginkgo23/PiFmRPi2/archive/master.zip $ unzip master.zip $ cd PiFmRPi2-master/src $ make clean $ make $ sudo ./pi_fm_rds -freq 99.9 -audio sound.wav or: $ sudo /home/pi/Pi-FM-RDS/PiFmRPi2-master/src/pi_fm_rds -freq 99.9 -audio /home/pi/stolenmoments/radioouterspace_de.wav ---- ==== Autostart ==== $ sudo nano /etc/rc.local insert before "exit 0": printf " " printf "*******************************************************\n" printf "* *\n" printf "* ( ( ( ( (( o )) ) ) ) ) *\n" printf "* | *\n" printf "* | *\n" printf "* | *\n" printf "* *\n" printf "* Radio From Outer Space *\n" printf "* dernulleffekt.de *\n" printf "* W.Spahn Okt 2016 *\n" printf "* *\n" printf "*******************************************************\n" printf " " #start radio /home/pi/stolenmoments/radiofromouterspace_01.py & ---- ==== Read-Only SD Card ==== Change the SD card to a read-only mode.\\ [[http://raspberrypi.stackexchange.com/questions/5112/running-on-read-only-sd-card]]\\ [[https://web.archive.org/web/20150101110424/http://raspberrycenter.de/forum/umruestung-raspberry-pi-read-only-root-filesystem]]\\ === Fstab === in: $ sudo nano /etc/fstab change: /dev/mmcblk0p2 / ext4 defaults,noatime,ro 0 1 tmpfs /tmp tmpfs defaults,size=30M 0 0 === Disable some Programms === disable rsyslog and dphys-swapfile:\\ $ sudo systemctl disable rsyslog $ sudo systemctl disable dphys-swapfile === Remount === To remount the partition writabe:\\ $ sudo mount / -o remount,rw ---- ====GPIO Connections==== GPIO 04 Antenna GPIO 17 Button EN GPIO 18 Button DE GPIO 22 LED DE GPIO 23 LED EN GPIO 27 Shutdown/Reset [[http://elinux.org/RPi_Low-level_peripherals]]\\ ---- ==== Other Radios ==== **PiFM**\\ [[https://github.com/rm-hull/pifm]]\\ [[http://www.icrobotics.co.uk/wiki/index.php/Turning_the_Raspberry_Pi_Into_an_FM_Transmitter]] $ mkdir /home/pi/radio $ cd /home/pi/radio download pifm:\\ $ wget http://omattos.com/pifm.tar.gz or:\\ $ wget http://dernulleffekt.de/download/pifm.tar.gz and unpack:\\ $ tar -xzvf pifm.tar.gz connect a wire to GPIO 4.\\ $ sudo ./pifm left_right.wav freq 22050 stereo **FM Transmitter**\\ for Pi 2,3 \\ make a folder: $ mkdir /home/pi/PiRadio $ cd /home/pi/PiRadio install: $ sudo apt-get install unzip make gcc g++ download:\\ $ wget https://github.com/markondej/fm_transmitter/archive/master.zip unzip: $ unzip master.zip $ cd fm_transmitter-master/ make: $ make transmit: $ sudo ./fm_transmitter -f 99.9 star_wars.wav ----