Click here to Skip to main content
15,908,437 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I would like a Pi Website for audio.

6 buttons (maybe more)
Each button launches a server side command.

button 1 on click /var/www/cgi-bin/christmas.sh

christmas.sh =
#!/bin/bash
stop.sh
mplayer -loop 0 /home/pi/Music/christmas/*

button 2 on click /var/www/cgi-bin/rock.sh

rock.sh =
#!/bin/bash
stop.sh
mplayer -loop 0 /home/pi/Music/rock/*


Any help is very appreciated.


Thanks
Posted
Comments
Richard MacCutchan 1-Jan-16 11:39am    
Help with what? All you have posted here is your wishlist, so we really do not know what your problem is.
MIke Kalist 1-Jan-16 12:42pm    
haha sorry i do not know how to to make a website send server side commands

I have been looking for a couple of weeks trying to control pi from wesite.

just do not know how to code that.

1 solution

Please see this CodeProject article: Raspberry Pi as low-cost audio streaming box[^].

—SA
 
Share this answer
 
Comments
MIke Kalist 1-Jan-16 13:13pm    
Hi Thanks I do not want it as a streamer just a way to play only. I am using it for my home media distribution system on 1 input.

I just want a way when i press a button on web interface it runs a command.
Sergey Alexandrovich Kryukov 1-Jan-16 15:12pm    
"I don't want" is not convincing, unless you explain your motivation in a rational way.
Do you want to server up media files for downloading? Then you should explain that in your question; and that's a pretty simple thing. I thought if you wanted to just serve files, you would not ask a question, so I assume something which would be some of a problem, streaming. You need to formulate what you want precisely.

Also, nothing requires HTTP protocol, FTP would also do it. And FTP servers are widely available on most OS. By the way, you never specified explicitly what OS you use or want to use on your PI. You did not even specify what exactly did you mean by "PI".

If I still did not understand you correctly, please try to explain yourself in comprehensible way.

—SA
MIke Kalist 1-Jan-16 15:40pm    
Sorry i think everyone knows what i am thinking.
The raspberry pi debian box is being used basically as a MP3 player.
so if i type in terminal window mplayer -loop 0 /home/pi/Music/christmas/*
it plays all the mp3s in the christmas dir.

because my wife and kids do not know how to use putty to get the raspberry pi to play music i want to make a web interface for the rasberry pi so that when the Mrs or kids go to 192.168.1.23 they can click a button and that button will exec mplayer -loop 0 /home/pi/Music/christmas/*


I hope that makes sence?
I can make the web page but i cant get any code to type or echo mplayer -loop 0 /home/pi/Music/christmas/*

I hope that makes sence
Sergey Alexandrovich Kryukov 1-Jan-16 19:43pm    
Thank you. Then I already answered. On Debian, you can install any kind of server: HTTP, FTP, streaming, or create anything custom. You did not describe what you have on client side, but this is not a problem at all; it could be a Web browser or player capable of playing on-line content.

Forget about mplayer, it's totally unrelated to the "server-side" question.

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900