EspressifApp / EspBlufiForAndroid

EspBlufi is based on the BLUFI protocol, which connect with IOT devices for BLE data communication, realizes device config network, and custom data transmission and reception. EspBlufi is developed and maintained by Espressif Corp.
Other
314 stars 122 forks source link

Sometimes "receive custom data" is not returning IP address after successful connection #35

Open Manasmd opened 1 year ago

Manasmd commented 1 year ago

I tried it with the official ESP BLUFI App (https://github.com/EspressifApp/EspBlufiForAndroid/releases/download/v1.5.3/EspBluFi-1.5.3-24.apk)

the connection is always successful which is a good thing but sometimes the "Receive custom data" is not returning the IP address.

Is there any way to increase the wait time? I have already increased my GATT_WRITE_TIMEOUT = 10000L;

but I guess this is only the write time, how can I increase the response wait time?

Screenshot_20221109_181812

Manasmd commented 1 year ago

@XuXiangJun Could you please guide me on this?

XuXiangJun commented 1 year ago

So you implemented the function of returning the IP address on the device side, right?

Normally, if there is no operation on the APP side, the connection should not be disconnected. "Receive custom data" is triggered when the device actively sends a notify message.

Manasmd commented 1 year ago

Hi @XuXiangJun Thank you so much for your reply. Yea that's right, it's implemented on the device already. As you can see from the screenshot, it did return the IP address the first time. but the consecutive tests do not return the IP address (this happens like every 1/3 tests)

Manasmd commented 1 year ago

I noticed after the post configure params complete there seems to be a very short waiting time as the Disconnected is triggered very fast.

Is there a way to keep the window open longer after post configure params complete step?

XuXiangJun commented 1 year ago

APP will never close the connection actively unless you press the disconnect button. Maybe the connection was closed by the device. Could you check the device side?

XuXiangJun commented 1 year ago

When the connection was disconnected, the error status is not printed, indicating that this is a normal disconnection. So I think this is because the device disconnect the connection.

Manasmd commented 1 year ago

I see, so you mean the APP is not closing the connection and it could be the device that's setting the timeout after "post configure params complete" step?