Skip to content

Commit cfc4da9

Browse files
authored
Merge pull request #2 from klte-hype/master
Fixed some of the scripts
2 parents 9bfea19 + 55f6cbc commit cfc4da9

File tree

8 files changed

+47
-48
lines changed

8 files changed

+47
-48
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ git clone https://github.com/mundeepl/PiFM
5959
```
6060
This will download the software from this repository
6161
```
62-
chmod +x /home/pi/PiFM/setup-pi4.sh
62+
chmod +x ~/PiFM/setup-pi4.sh
6363
```
6464
This changes the permissions to allow you to run the setup
6565
```
@@ -71,11 +71,11 @@ sudo apt-get install git -y
7171
```
7272
This will install git, which allows you to download files from Github
7373
```
74-
git clone https://github.com/mundeepl/PiFM
74+
git clone https://github.com/redmi4a-hype/PiFM
7575
```
7676
This will download the software from this repository
7777
```
78-
chmod +x /home/pi/PiFM/setup.sh
78+
chmod +x ~/PiFM/setup.sh
7979
```
8080
This changes the permissions to allow you to run the setup
8181
```
@@ -108,7 +108,7 @@ If at any point you wish to close the broadcast, make the terminal window active
108108
## Advanced Users (those confident with a terminal)
109109
You can also use PiFM using the terminal
110110
```
111-
cd /home/pi/PiFM/src
111+
cd ~/PiFM/src
112112
sudo ./PiFM
113113
```
114114
This will generate an FM transmission on 87.6Mhz, with default station name (PS), radiotext (RT) and PI-code (PI), without audio. The radio frequency signal is emitted on GPIO 4 (pin 7 on header P1).

pifm-basic.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

3-
# This is a small script created by Mundeep Lamport as an alternative
3+
# This is a small script created by MundeepL as an alternative
44
# to the GUI interface of PiFM, which is an FM transmitter app
55

66

7-
# Initialising and opening the install script by clearing the terminal to make install clutter-free
7+
# Initialising and opening the install script by clearing the terminal to make the installation clutter-free
88
clear
99
echo " "
1010
echo "██████╗ ██╗ ███████╗███╗ ███╗ ██╗ ██████╗"
@@ -33,7 +33,7 @@ echo "allowing you to start transmitting with just a few bits of key, user-custo
3333
sleep 5
3434
clear
3535

36-
# Choosing transmission options by reading in vaariable values
36+
# Choosing transmission options by reading in variable values
3737
# Choose Frequency
3838
echo "Which frequency would you like to use? (85.5-108)"
3939
read frequency
@@ -120,5 +120,5 @@ echo -ne '\n'
120120

121121

122122
# starting the PiFM software with the chosen variable flags
123-
cd /home/pi/PiFM/src
123+
cd $HOME/PiFM/src
124124
sudo ./pifm --freq $frequency --ps $ps --rt "$rt" --audio $audio --pi $pi --pty $pty --mpx $mpx --power $power --preemph $pre

pifm.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ nameaccepted=0
66
textaccepted=0
77

88

9-
# This is a small script created by Mundeep Lamport to streamline
9+
# This is a small script created by MundeepL to streamline
1010
# the process of running Pi FM RDS which is an FM transmitter tool.
1111

1212
clear
@@ -43,7 +43,7 @@ fi
4343

4444
# Choose the radio text (advanced)
4545
until [ $textaccepted == 1 ] ; do
46-
rt=$(zenity --title="PiFM by Mundeep Lamport" --entry --text="Choose the radio text (max. 64 characters)" --entry-text="Hello, World!" --width=500 --height=150 --ok-label="Continue" --cancel-label="Close")
46+
rt=$(zenity --title="PiFM by MundeepL" --entry --text="Choose the radio text (max. 64 characters)" --entry-text="Hello, World!" --width=500 --height=150 --ok-label="Continue" --cancel-label="Close")
4747
rtlength=${#rt}
4848

4949
if [[ $rtlength -ge 0 && $rtlength -le 64 ]] ; then
@@ -114,6 +114,6 @@ zenity --progress --title="PiFM by mundeepl" --percentage=0 --auto-close --auto-
114114
echo "Completed. Starting service Pi FM RDS"
115115

116116
# Running Pi FM RDS
117-
cd /home/pi/PiFM/src
117+
cd $HOME/PiFM/src
118118
sudo ./pifm --ps $ps --rt "$rt" --freq $frequency --audio $audio --preemph $region --pty $genre --power $power
119-
zenity --title="PiFM by mundeepl" --info --text="Transmission ended. Thank you for using the PiFM Transmission software that was developed by mundeepl. If you would like to use more advanced settings, be sure to check out the README file in the /home/pi/PiFM directory. This will teach you further arguements and how to use the command line." --width=500 --height=150 --ok-label="Exit"
119+
zenity --title="PiFM by mundeepl" --info --text="Transmission ended. Thank you for using the PiFM Transmission software that was developed by mundeepl. If you would like to use more advanced settings, be sure to check out the README file in the $HOME/PiFM directory. This will teach you further arguements and how to use the command line." --width=500 --height=150 --ok-label="Exit"

setup-pi4.sh

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

3-
# This is a setup script for the Pi FM RDS Transmitter project streamlined by Mundeep Lamport
3+
# This is a setup script for the Pi FM RDS Transmitter project streamlined by MundeepL
44
clear
55
echo "Welcome to the PiFM installer. This script will help you get up and running."
66
echo "This script is designed specifically for the Raspberry Pi 4."
7-
echo "For more information, visit https://github.com/mundeeplamport"
7+
echo "For more information, visit https://github.com/mundeepl"
88
echo "WARNING! Your system will reboot once completed."
99
sleep 10
1010
clear
@@ -15,7 +15,7 @@ echo "Installing required tools" ; sleep 1
1515
sudo apt-get install libsndfile1-dev zenity git -y
1616
clear
1717
echo "Changing directory --> src" ; sleep 1
18-
cd /home/pi/PiFM/src
18+
cd $HOME/PiFM/src
1919
clear
2020
echo "Cleaning up" ; sleep 1
2121
make clean
@@ -29,26 +29,26 @@ echo "Editing -> /boot/config.txt" ; sleep 1
2929
echo "gpu_freq=250" | sudo tee -a /boot/config.txt > /dev/null
3030
clear
3131
echo "Adding software" ; sleep 1
32-
cd /home/pi/PiFM
32+
cd $HOME/PiFM
3333
# Copy GUI Version
34-
sudo cp /home/pi/PiFM/src/pi4/pifm.sh /usr/local/bin
34+
sudo cp $HOME/PiFM/src/pi4/pifm.sh /usr/local/bin
3535
sudo mv /usr/local/bin/pifm.sh /usr/local/bin/pifm
3636
# Copy Basic Version
37-
sudo cp /home/pi/PiFM/src/pi4/pifm-basic.sh /usr/local/bin
37+
sudo cp $HOME/PiFM/src/pi4/pifm-basic.sh /usr/local/bin
3838
sudo mv /usr/local/bin/pifm-basic.sh /usr/local/bin/pifm-basic
3939
clear
4040
echo "Creating shortcuts" ; sleep 1
41-
sudo cp /home/pi/PiFM/src/pi4/PiFM.desktop /home/pi/Desktop
42-
sudo cp /home/pi/PiFM/src/pi4/PiFM.desktop /usr/share/applications
41+
sudo cp $HOME/PiFM/src/pi4/PiFM.desktop $HOME/Desktop
42+
sudo cp $HOME/PiFM/src/pi4/PiFM.desktop /usr/share/applications
4343
echo "Changing filename/type" ; sleep 0.1
44-
sudo mv /home/pi/PiFM/src/pi_fm_adv /home/pi/PiFM/src/pifm
44+
sudo mv $HOME/PiFM/src/pi_fm_adv $HOME/PiFM/src/pifm
4545
clear
4646
echo "Patching xterm" ; sleep 0.1
4747
cd /usr/bin
4848
sudo cp lxterminal xterm
4949
clear
5050
echo "Assigning permissions" ; sleep 0.1
51-
sudo chmod +x /home/pi/PiFM/pifm
51+
sudo chmod +x $HOME/PiFM/pifm
5252
sudo chmod +x /usr/local/bin/pifm
5353
sudo chmod +x /usr/local/bin/pifm-basic
5454
clear

setup.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ echo "Installing required tools" ; sleep 1
1515
sudo apt-get install libsndfile1-dev zenity -y
1616
clear
1717
echo "Changing directory --> src" ; sleep 1
18-
cd /home/pi/PiFM/src
18+
cd $HOME/PiFM/src
1919
clear
2020
echo "Cleaning up" ; sleep 1
2121
make clean
@@ -27,26 +27,26 @@ echo "Making adjustments to --> /boot/config.txt" ; sleep 1
2727
echo "gpu_freq=250" | sudo tee -a /boot/config.txt > /dev/null
2828
clear
2929
echo "Adding software" ; sleep 1
30-
cd /home/pi/PiFM
30+
cd $HOME/PiFM
3131
# Copy GUI Version
32-
sudo cp /home/pi/PiFM/pifm.sh /usr/local/bin
32+
sudo cp $HOME/PiFM/pifm.sh /usr/local/bin
3333
sudo mv /usr/local/bin/pifm.sh /usr/local/bin/pifm
3434
# Copy Basic Version
35-
sudo cp /home/pi/PiFM/pifm-basic.sh /usr/local/bin
35+
sudo cp $HOME/PiFM/pifm-basic.sh /usr/local/bin
3636
sudo mv /usr/local/bin/pifm-basic.sh /usr/local/bin/pifm-basic
3737
clear
3838
echo "Creating shortcuts" ; sleep 1
39-
sudo cp /home/pi/PiFM/src/PiFM.desktop /home/pi/Desktop
40-
sudo cp /home/pi/PiFM/src/PiFM.desktop /usr/share/applications
39+
sudo cp $HOME/PiFM/src/PiFM.desktop $HOME/Desktop
40+
sudo cp $HOME/PiFM/src/PiFM.desktop /usr/share/applications
4141
echo "Changing filename/type" ; sleep 1
42-
sudo mv /home/pi/PiFM/src/pi_fm_adv /home/pi/PiFM/src/pifm
42+
sudo mv $HOME/PiFM/src/pi_fm_adv $HOME/PiFM/src/pifm
4343
clear
4444
echo "Patching xterm" ; sleep 1
4545
cd /usr/bin
4646
sudo cp lxterminal xterm
4747
clear
4848
echo "Assigning permissions" ; sleep 1
49-
sudo chmod +x /home/pi/PiFM/pifm
49+
sudo chmod +x $HOME/PiFM/pifm
5050
sudo chmod +x /usr/local/bin/pifm
5151
sudo chmod +x /usr/local/bin/pifm-basic
5252
clear

src/pi4/PiFM.desktop

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ Version=1.0
33
Name=PiFM
44
Comment=Broadcast from your Raspberry Pi!
55
GenericName=FM Transmitter
6-
Icon=/home/pi/PiFM/src/PiFM.png
6+
Icon=$HOME/PiFM/src/PiFM.png
77
Terminal=true
88
Type=Application
9-
Exec= /home/pi/PiFM/src/pi4/pifm.sh
10-
9+
Exec= $HOME/PiFM/src/pi4/pifm.sh

src/pi4/pifm-basic.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# This is a small script created by Mundeep Lamport as an alternative
3+
# This is a small script created by MundeepL as an alternative
44
# to the GUI interface of PiFM, which is an FM transmitter app
55

66
clear
@@ -18,7 +18,7 @@ sleep 0.1
1818
echo "╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚══════╝"
1919
echo " "
2020
sleep 1
21-
echo "PiFM has been produced by Mundeep Lamport"
21+
echo "PiFM has been produced by MundeepL"
2222
sleep 5
2323
clear
2424
echo "Welcome to PiFM. An FM-RDS capable transmitter."
@@ -112,5 +112,5 @@ echo -ne '[]####################[] (100%)\r'
112112
sleep 1
113113
echo -ne 'Completed. Starting service Pi FM. \r'
114114
echo -ne '\n'
115-
cd /home/pi/PiFM/src
115+
cd $HOME/PiFM/src
116116
sudo ./pifm --freq $frequency --ps $ps --rt "$rt" --audio $audio --pi $pi --pty $pty --mpx $mpx --power $power --preemph $pre

src/pi4/pifm.sh

+12-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ filecount=0
33
nameaccepted=0
44
textaccepted=0
55

6-
# This is a small script created by Mundeep Lamport to streamline
6+
# This is a small script created by MundeepL to streamline
77
# the process of running Pi FM RDS which is an FM transmitter tool.
88

99
clear
@@ -22,11 +22,11 @@ echo "╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚
2222
echo " "
2323

2424
# Display about
25-
zenity --title="PiFM by Mundeep Lamport" --info --text="Welcome to the Raspberry Pi FM Transmitter with RDS. This is a small applet designed by Mundeep Lamport to easily set up Pi FM RDS and is designed to make the process of broadcasting significantly easier. Please note that the software only decodes .wav or .ogg files." --width=500 --height=150 --ok-label="Begin"
25+
zenity --title="PiFM by MundeepL" --info --text="Welcome to the Raspberry Pi FM Transmitter with RDS. This is a small applet designed by MundeepL to easily set up Pi FM RDS and is designed to make the process of broadcasting significantly easier. Please note that the software only decodes .wav or .ogg files." --width=500 --height=150 --ok-label="Begin"
2626

2727
# Choose a Program Service name (advanced)
2828
until [ $nameaccepted == 1 ] ; do
29-
ps=$(zenity --title="PiFM by Mundeep Lamport" --entry --text="Choose the Program Service Name (max. 8 characters)" --entry-text="PiFM" --width=500 --height=150 --ok-label="Continue" --cancel-label="Close")
29+
ps=$(zenity --title="PiFM by MundeepL" --entry --text="Choose the Program Service Name (max. 8 characters)" --entry-text="PiFM" --width=500 --height=150 --ok-label="Continue" --cancel-label="Close")
3030
pslength=${#ps}
3131

3232
if [[ $pslength -ge 0 && $pslength -le 8 ]] ; then
@@ -40,7 +40,7 @@ fi
4040

4141
# Choose the radio text (advanced)
4242
until [ $textaccepted == 1 ] ; do
43-
rt=$(zenity --title="PiFM by Mundeep Lamport" --entry --text="Choose the radio text (max. 64 characters)" --entry-text="Hello, World!" --width=500 --height=150 --ok-label="Continue" --cancel-label="Close")
43+
rt=$(zenity --title="PiFM by MundeepL" --entry --text="Choose the radio text (max. 64 characters)" --entry-text="Hello, World!" --width=500 --height=150 --ok-label="Continue" --cancel-label="Close")
4444
rtlength=${#rt}
4545

4646
if [[ $rtlength -ge 0 && $rtlength -le 64 ]] ; then
@@ -53,7 +53,7 @@ fi
5353
done
5454

5555
# Choose a frequency
56-
frequency=$(zenity --title="PiFM by Mundeep Lamport" --entry --text="Choose a frequency. (Pi 4 max. 93)" --entry-text="87.6" --width=500 --height=150 --ok-label="Continue" --cancel-label="Close")
56+
frequency=$(zenity --title="PiFM by MundeepL" --entry --text="Choose a frequency. (Pi 4 max. 93)" --entry-text="87.6" --width=500 --height=150 --ok-label="Continue" --cancel-label="Close")
5757
echo "The chosen frequency is $frequency MHz"
5858

5959
# Chooose an audio file (advanced)
@@ -74,19 +74,19 @@ esac
7474

7575

7676
# Choose a region
77-
region=$(zenity --list --title="PiFM by Mundeep Lamport" --text="Select current region" --radiolist --column "Pick" --column "PreEmph" --column "Region" TRUE us USA FALSE eu Europe FALSE eu Asia --ok-label="Continue" --cancel-label="Close")
77+
region=$(zenity --list --title="PiFM by MundeepL" --text="Select current region" --radiolist --column "Pick" --column "PreEmph" --column "Region" TRUE us USA FALSE eu Europe FALSE eu Asia --ok-label="Continue" --cancel-label="Close")
7878
echo "Region set to: $region"
7979

8080
# Choose the genre
81-
genre=$(zenity --list --title="PiFM by Mundeep Lamport" --text="Select the broadcast genre" --radiolist --column "Pick" --column "Number" --column "Genre" TRUE 0 "Undefined" FALSE 1 "News" FALSE 2 "Current Affairs" FALSE 3 "Information" FALSE 4 "Sport" FALSE 5 "Education" FALSE 6 "Drama" FALSE 7 "Culture" FALSE 8 "Science" FALSE 9 "Varied" False 10 "Pop music" FALSE 11 "Rock music" FALSE 12 "Easy listening" FALSE 13 "Light Classical" FALSE 14 "Serious Classical" FALSE 15 "Other music" FALSE 16 "Weather" FALSE 17 "Finance" FALSE 18 "Children's programmes" FALSE 19 "Social affairs" FALSE 20 "Religion" FALSE 21 "Phone-in" FALSE 22 "Travel" FALSE 23 "Leisure" FALSE 24 "Jazz music" FALSE 25 "Country Music" FALSE 26 "National music" FALSE 27 "Oldies music" FALSE 28 "Folk music" FALSE 29 "Documentary" FALSE 30 "ALARM TEST" FALSE 31 "ALARM" --ok-label="Continue" --cancel-label="Close")
81+
genre=$(zenity --list --title="PiFM by MundeepL" --text="Select the broadcast genre" --radiolist --column "Pick" --column "Number" --column "Genre" TRUE 0 "Undefined" FALSE 1 "News" FALSE 2 "Current Affairs" FALSE 3 "Information" FALSE 4 "Sport" FALSE 5 "Education" FALSE 6 "Drama" FALSE 7 "Culture" FALSE 8 "Science" FALSE 9 "Varied" False 10 "Pop music" FALSE 11 "Rock music" FALSE 12 "Easy listening" FALSE 13 "Light Classical" FALSE 14 "Serious Classical" FALSE 15 "Other music" FALSE 16 "Weather" FALSE 17 "Finance" FALSE 18 "Children's programmes" FALSE 19 "Social affairs" FALSE 20 "Religion" FALSE 21 "Phone-in" FALSE 22 "Travel" FALSE 23 "Leisure" FALSE 24 "Jazz music" FALSE 25 "Country Music" FALSE 26 "National music" FALSE 27 "Oldies music" FALSE 28 "Folk music" FALSE 29 "Documentary" FALSE 30 "ALARM TEST" FALSE 31 "ALARM" --ok-label="Continue" --cancel-label="Close")
8282
echo "Program Type: $genre"
8383

8484
# Choose output power
85-
power=$(zenity --list --title="PiFM by Mundeep Lamport" --radiolist --text="Select output power." --column "Pick" --column "Power" TRUE 1 FALSE 2 FALSE 3 FALSE 4 FALSE 5 FALSE 6 FALSE 7 --ok-label="Continue" --cancel-label="Close")
85+
power=$(zenity --list --title="PiFM by MundeepL" --radiolist --text="Select output power." --column "Pick" --column "Power" TRUE 1 FALSE 2 FALSE 3 FALSE 4 FALSE 5 FALSE 6 FALSE 7 --ok-label="Continue" --cancel-label="Close")
8686
echo "Power set to $power"
8787

8888
# End notice before starting
89-
zenity --title="PiFM by Mundeep Lamport" --info --text="Now that you have chosen your options, it is time to begin transmitting. Ensure your antenna is inserted into GPIO 21 and then click start." --ok-label="Start" --width=500 --height=150
89+
zenity --title="PiFM by MundeepL" --info --text="Now that you have chosen your options, it is time to begin transmitting. Ensure your antenna is inserted into GPIO 21 and then click start." --ok-label="Start" --width=500 --height=150
9090

9191
# Cool loading bar
9292
(
@@ -106,11 +106,11 @@ echo "Finishing..." ; sleep 1
106106
echo "Finished." ; sleep 0.5
107107
echo "100"
108108
) |
109-
zenity --progress --title="PiFM by Mundeep Lamport" --percentage=0 --auto-close --auto-kill
109+
zenity --progress --title="PiFM by MundeepL" --percentage=0 --auto-close --auto-kill
110110
(( $? != 0 )) && zenity --error --title="PiFM Error" --text="Error! Could not complete!" --width=200 --height=100
111111
echo "Completed. Starting service Pi FM RDS"
112112

113113
# Running Pi FM RDS
114-
cd /home/pi/PiFM/src
114+
cd $HOME/PiFM/src
115115
sudo ./pifm --ps $ps --rt "$rt" --freq $frequency --audio $audio --preemph $region --pty $genre --power $power
116-
zenity --title="PiFM by Mundeep Lamport" --info --text="Transmission ended. Thank you for using the PiFM Transmission software that was developed by Mundeep Lamport. If you would like to use more advanced settings, be sure to check out the README file in the /home/pi/PiFM directory. This will teach you further arguements and how to use the command line." --width=500 --height=150 --ok-label="Exit"
116+
zenity --title="PiFM by MundeepL" --info --text="Transmission ended. Thank you for using the PiFM Transmission software that was developed by MundeepL. If you would like to use more advanced settings, be sure to check out the README file in the $HOME/PiFM directory. This will teach you further arguements and how to use the command line." --width=500 --height=150 --ok-label="Exit"

0 commit comments

Comments
 (0)