B4R Question MQTT disconnect

derez

Expert
Licensed User
Longtime User
Using two NodeMcu and one Wemos D1 with the same problem...
The mqtt broker is on a b4j server and works fine. The micros are clients for the same topic which is a date and time string like this : "18 07 19 16 37 00 5" . After about 20 (+-2) received messages the clients report MQTT disconnect, try to reconnect but without success, and usually restarts.
It does not matter if the rate is one message every 1.5 minute or 30 minutes.
Looks like a buildup of used memory. Any idea how to clean it while still working to prevent the disconnection ?
Thanks.
 

derez

Expert
Licensed User
Longtime User

StackbufferUsage is 16 , not changing.
The available ram starts with 48912 and reduces in each received message by 2640. After 19 messages there is none left...
The JoinString is done every second but without effect on the available ram. The ram is reduced by the received message !
 
Upvote 0

derez

Expert
Licensed User
Longtime User
The available ram is reduced like this, see what happens below 1000 :
 
Upvote 0

derez

Expert
Licensed User
Longtime User
Unrelated to Mqtt but related to all the forum members.
Because of communication problem I initialized a softserial every time I got MQTT message, this init caused the ram to reduce.
When moved to app_start it behaves normally.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…