Android Question WIFI terminal communication

mare1980k1

Member
Licensed User
Longtime User
I would like to make wifi terminal for communication between phone and independent device that is not on internet. I have the IP and the port of the device and I managed to make an application to connect to it.

My question is how to send and receive simple text?
Thanks in advance
 

mare1980k1

Member
Licensed User
Longtime User
Thank you for your response.
I looked up at this example, but I found a bunch of code that I didn't need and that is linked to some other code.

Please help me just to get through the first step.

I want to send text to wifi that I am connected to.
I tried:
B4X:
Sub Process_Globals
   Private server As HttpServer
   Public port As Int = 2460
   Public MsgText As String
End Sub

Sub Service_Create
   server.Initialize("Server")
   server.Start(port)
End Sub

Sub btnConnect_Click
msgtext=lbltext.text
Dim sendmsg as ServletResponse
sendmsg.SendString(MsgText)
End Sub


I am looking for the most simple way to send text to a wifi device I am already connected. Please help. Thank you
 
Upvote 0

spairo

Member
Licensed User
I am developing android application in which there is a communication part between an OBD device and android device.
I'm planning to use ELM327 OBDII protocols for communication over WiFi network.
ATZ, ATPPxx, ATDI commands must be send to ELM327 Wifi device.
Through the SSID I get a connection to the Wifi network.
I can not set any IP address for the phone to connect to ELM327 WiFi.
In each case it gets the message " is Connected failed: EHOSTUNREACH (no route to host)".
How to set the client, server to be able to send commands from the phone to the ELM327 Wifi device.
log:
or
 

Attachments

  • B4X-serializer.zip
    9.5 KB · Views: 224
  • 1008.jpg
    26.7 KB · Views: 213
  • 1009.jpg
    33.6 KB · Views: 234
  • 1010.jpg
    33.6 KB · Views: 316
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…