Hi,
I have my doubts where to post this problem.
I have a ESP8266 module reviving data from a device and pass it through WiFi to B4j/B4a/B4I
I use the same code in B4j/B4A to get data.
Sub AStreams_NewData (Buffer() As Byte)
Dim msg, debugstr As String
Dim i As Int
msg = BytesToString(Buffer, 0, Buffer.Length, "ISO-8859-1")
dData = dData & msg
For i = 0 To dData.Length - 1
RecievedText(i) = Asc(dData.CharAt(i))
debugstr = debugstr & Asc(dData.CharAt(i))
'Log(RecievedText(i))
Next
Log(debugstr)
Log(dData.Length)
For i = 0 To 149
RecievedText(i) = ""
Next
dData = ""
msg = ""
End Sub
It is the same problem Standard/Prefix ASyncStream
The code receive between 50 to 2000 lines then it stops and throw an error.
B4J error:
java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at anywheresoftware.b4a.randomaccessfile.AsyncStreams$AIN.readNumberOfBytes(AsyncStreams.java:287)
at anywheresoftware.b4a.randomaccessfile.AsyncStreams$AIN.run(AsyncStreams.java:212)
at java.lang.Thread.run(Thread.java:748)
java.net.SocketException: Software caused connection abort: recv failed
B4A error:
android.system.ErrnoException: recvfrom failed: ETIMEDOUT (Connection timed out)~i
I have tried lot of adjustments, but nothing helps.
If I only have connection between device and ESP8266 there is no problem.
The problem seems to be from ESP8266 to java/android.
I dont know if anybody can help me from this information?
If you need more information I will post it.
Mogens