Search This Blog

Thursday, March 22, 2018

Play an mp3 file on raspberry pi remotely, use it as an alarm or to call some one

Get the apache2 and php from here


Create an index.php and place it in root, create the mp3 file and sh file which
will be played by the php, you can use mp3 recorder online to create a custom message
or alarm sound.

Use this link to create php file and I used omxplayer isntead of mpg123 mentioned, i got pi3



Well i could open this local ip of my pi and it played my sound remotely through a webpage,
I saved a bookmark on my android phone on home screen to use it handy.

Tip* You could also test your script and mp3 locally by running in shell before inserting it in php page.

I cam going to use it frequently to call my wife, she doesn't check her phone often and I am
too lazy to move from my couch.

In case you get some weird vchiq error  
* failed to open vchiq instance fix this here 

Oh and yes, i did a mac/ip binding on my dlink router so that my pi always picks up same
address, if you want to use it from outside home(remotely) you can do a port forward also.

No comments:

Post a Comment