Android Question ESP8266 AND ANDROID

tamayo461

Member
Licensed User
Longtime User
Hello everyone, I know that this topic has already been talked about, however I still can not communicate bidirectionally an ESP8266 module and an android phone.

I monitor what goes in and what comes out from the ESP8266 through the Arduino IDE serial port window.

Note: Arduino is only the bridge between PC and ESP8266.


B4X:
Sub JobDone (job As HttpJob)
    Log("JobName = " & job.JobName & ", Success = " & job.Success)
    If job.Success = True Then
        Select job.JobName
            ToastMessageShow(job.JobName,True)
            Case "get"
                ToastMessageShow(job.getString,True)
                If job.getString.Length < 1 Then
                    ToastMessageShow("Nothing...",True)
                End If              
            Case "post"
                ToastMessageShow("Send...",True)
        End Select
    Else
        ToastMessageShow("Error: " & job.ErrorMessage, True)
    End If
    job.Release
End Sub

Sub btnSend_Click
    Dim job1 As HttpJob
    job1.Initialize("post", Me)
    job1.PostString(edtIp.Text, edt.text)  
End Sub

Sub btnReceive_Click
    Dim job1 As HttpJob
    job1.Initialize("get", Me)
    job1.Download(edtIp.text)
End Sub

I never get "job.Success", however the data if sent as seen in the images.

Screenshot_2017-07-12-09-09-16.png 12-07-2017 09-09-21 a-m-.png

Screenshot_2017-07-12-09-09-16.png
12-07-2017 09-09-21 a-m-.png
 

tamayo461

Member
Licensed User
Longtime User
Replace http lib with okhttp lib and httputils with okhttputils2

thanks I do the changes, but...

ResponseError. Reason: java.io.IOException: unexpected end of stream on okhttp3.Address@a7035e2b, Response:
JobName = post, Success = false
 
Upvote 0
Top