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:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
Trying to connect to: 192.169.0.200
Failed to connect: (ErrnoException) android.system.ErrnoException: isConnected failed: EHOSTUNREACH (No route to host)
Trying to connect to: 192.169.0.201
Failed to connect: (ErrnoException) android.system.ErrnoException: isConnected failed: EHOSTUNREACH
or
Trying to connect to: 192.168.0.200
Trying to connect to: 192.168.0.200
Trying to connect to: 192.168.0.200
starter$ResumableSub_ConnectToServerresume (java line: 235)
java.net.SocketException: Socket is closed
at java.net.PlainSocketImpl.checkNotClosed(PlainSocketImpl.java:116)
at java.net.PlainSocketImpl.getInputStream(PlainSocketImpl.java:213)
at java.net.Socket.getInputStream(Socket.java:365)
at anywheresoftware.b4a.objects.SocketWrapper.getInputStream(SocketWrapper.java:220)
at b4a.SerializatorROB.starter$ResumableSub_ConnectToServer.resume(starter.java:235)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:240)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)