Scorp_pi
Posts: 2
Joined: Sun Jan 22, 2017 1:40 pm

auto play mp3 on smartphone wifi conection

Sat Jul 14, 2018 9:17 pm

Hello to all

Sorry for my bad english .

I am trying to find info on how to and if possible to acomplish this

I like to listen to music as soon i get home .
Now i have to start it all by hand .

My question : Is it possible to let the pi play my mp3 or play list as soon my smartphone connects to my wifi.

I have done a lot of seach atempts but i am not getting any info that is related to my needs. it tels me only how to play mp3 on my phone or how to transfere mp3 to my phone ,i do not need that i like to autoplay my music when i enter my home automaticly . (my phone makes conection with my wifi that meens that i am home )

I hope it is clear what my intentions are and hope that with your help i will be able to .

Thank you for your time

Scorpi_pi

mutrised
Posts: 44
Joined: Thu Nov 08, 2012 12:41 am
Location: France

Re: auto play mp3 on smartphone wifi conection

Mon Jul 16, 2018 9:18 am

Hi,

You may need to give a bit more info. You connect your phone through your wifi ? I supose it's on your internet router's wifi.

You can setup your router to provide a static IP to your phone and use a script on your PI to see if your phone is connected or not.

You can go multiple way for this
- Monitoring DHCP request and trigger event once it sees DHCP ACK to your phone
- Monitoring ARP request from you phone IP
- Try to ping periodically you phone IP (polling style, less effective than network monitoring)

You can't try using tcpdump for this.
sudo tcpdump -vnes0 -i eth0 port 67 or port 68
Will print DHCP traffic.
sudo tcpdump arp -i eth0
Will print ARP packet

This is a start point =)
Last edited by mutrised on Mon Jul 16, 2018 8:36 pm, edited 1 time in total.
RPI2B 7/24 - web, NAS/media, Owncloud and more
RPI0 7/24 - VPN, DHCP, DNS (including filtering), wakeonlan proxy
RPI0W - VPN gateway providing secure WIFI AP and network router, some kind of internet BOX when on the move ;)

Scorp_pi
Posts: 2
Joined: Sun Jan 22, 2017 1:40 pm

Re: auto play mp3 on smartphone wifi conection

Mon Jul 16, 2018 6:38 pm

Thank you i will try it bt i have to whait till the weekand .

Thank you for the starting point.

Return to “Graphics, sound and multimedia”