Arduino Forum
>
Using Arduino
>
Interfacing w/ Software on the Computer
>
UDP message broadcast from android phone to arduino mega - how?
Print
Go Down
Pages:
[1]
Topic: UDP message broadcast from android phone to arduino mega - how?
(Read 3266 times)
previous topic
-
next topic
boylesg
Edison Member
Posts: 1,192
Karma: 62
[add]
UDP message broadcast from android phone to arduino mega - how?
Oct 09, 2017, 06:04 pm
My android phone has an ip address of 127.0.0.1 while my arduino has an ip address of 10.0.0.32.
I am broadcasting from my android app to 10.0.0.255.
However my arduino mega is not receiving it.
However if I broadcast a udp message from another arduino mega on 10.0.0.255 then my receiving arduino receives the message OK.
Has anyone had success interfacing and android phone app to an arduino via udp?
If so how did you get it to work.
Does my failure have anything to do with the fact that the android phone and arduino are on different sub-domains (I think they are called from memory)?
PaulS
Brattain Member
Posts: 85,605
Karma: 2571
[add]
Seattle, WA USA
Re: UDP message broadcast from android phone to arduino mega - how?
#1
Oct 09, 2017, 09:15 pm
Quote
My android phone has an ip address of 127.0.0.1
That is NOT the IP address of the phone on any network. That is the IP address of any device that is not connected to a network. You can't broadcast to a network if you are not connected to a network.
The art of getting good answers lies in asking good questions.
boylesg
Edison Member
Posts: 1,192
Karma: 62
[add]
Re: UDP message broadcast from android phone to arduino mega - how?
#2
Oct 10, 2017, 12:09 am
Last Edit
: Oct 10, 2017, 12:29 am by boylesg
Oh!
Don't suppose you have used Android Studio yourself have you?
It seems that, from Lollipop onward, your app has to connect separately to the wifi network.
Just getting a 'pointer' to the Android WifiManager is not enough.
Print
Go Up
Pages:
[1]
Loading...