Android Question Talk to Arduino over wifi using Android

Hi all

I am struggling to find a simple way to send commands to the Arduino using an app on android.

My goal is to have an ultrasonic sensor send the distance to the app over the network, whether it is local or not.
I must request the data first and then receive it, Can anyone point me to a tutorial to help me with both sides of the code.

Thanks in advance
 

Thank you, I am using a UNO with an ESP8266 and managed to find the link mentioned above.
I ran into a problem though, it seems that when I press the button, on the B4A app, it doesn't do anything.
I played around adding toast messages to different parts of the code to see where the problem is and it seems the "CallSub2(Starter, "Connect", edtIp)" isn't getting called, so I cut the code from the Connect sub and put it under the button_Click sub, I now get a "new connection message on the B4R side but on the B4A side I get an error "sub: java.lang.Exception: Sub socket_connected was not found". I did make that sub a public sub but I am still new to coding so I'm not sure if that can work the way I think it should.

Thanks again
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top