Go Down

Topic: UDP message broadcast from android phone to arduino mega - how? (Read 2047 times) previous topic - next topic

boylesg

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

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

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.

Go Up