B4R Question [ESP8266] astream disconnect problems

Pendrush

Well-Known Member
Licensed User
Longtime User
I'm using this example.
After B4J get connected for the first time on NODE MCU (ESP8266), everything work as expect, but when B4J client get disconnected, ESP8266 fire timer_tick event on about every 5 seconds (timer is on 1000ms), also ESP8266 don't detect client is disconnected. When I start again B4J connection is established but no data in logs on both devices. in B4J Successful is True, but there is no response from ESP8266. When I click reset button on ESP8266 everything start to work again until B4J client is disconnected again and then again after connection nothing in logs, timer tick event on ESP8266 fire on about every 5 sec instead of 1 sec. I have tested on two NODE MCU board and get same behavior.

Edit:
After client get disconnected and reconnected again, there is no data in communication for exact 10 minutes. After data start to flow, Timer_Tick fire on every 1 sec again.

Anyone know why is all behaving like this?
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Note that it is better to use B4RSerializator with AsyncStreams in prefix mode as demonstrated here: https://www.b4x.com/android/forum/t...ceive-objects-instead-of-bytes.72404/#content

You don't see the "Error" message in the logs, right?

The only thing that you can do if the connected state is wrong is to add a timer that will act as a heartbeat and close the connection after a few seconds without any communication.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…