Welcome, Guest
Username: Password: Remember me

TOPIC: MQTT switch freezing

MQTT switch freezing 1 year 7 months ago #2809

  • simsonite
  • simsonite's Avatar
  • Offline
  • New Member
  • Posts: 8
  • Karma: 0
Hi,

Thanks for the great work and effort that has been put on EasyIoT!

I have a problem with the MQTT switch... My problem is that it freezes after some time. My setup is a NodeMCU powered by a cell phone charger which drives a 3.3v relay which is powered by a separate 230v->3.3v converter. When powering the NodeMCU, a switch module is created and i can switch on/off a lamp N number of times. But after let's say a day of so, the NodeMCU won't respond to my requests. If i reset it, i can run it for another day.

The weird thing is however that i had it connected to a computer with debugging messages for 3 days + and had no problems what so ever. I've tried several chargers but i always lose the control of the NodeMCU after some time when it's not connected to a computer.

Any idea?
Thanks
The administrator has disabled public write access.

MQTT switch freezing 1 year 7 months ago #2812

  • NightOne
  • NightOne's Avatar
  • Offline
  • Premium Member
  • Posts: 81
  • Thank you received: 26
  • Karma: 5
I am about 90% sure its a power issue....Do you have a capacitor between the 3.3v phone charger and the NodeMCU....if not put a 1000uF cap to help the power fluctuation from the phone charger.
The administrator has disabled public write access.

MQTT switch freezing 1 year 6 months ago #2818

  • simsonite
  • simsonite's Avatar
  • Offline
  • New Member
  • Posts: 8
  • Karma: 0
Hi again,

I did actually put a 1000uF capacitor previously but it didn't help.

Here's what I did next.
1. I had it connected to the same computer but now without a terminal so I couldn't read the debugging messages. I lost the connection to it after just a few hours.
2. I disabled the debugging messages and powered the NodeMCU with the SonyEricsson charger I used earlier and after 2.5 days, it's still running.

So, it seems that by disabling the serial output, the problem is solved. Seems like the output buffer(?) is getting full and thereafter it just stops responding. Why I didn't came to this conclusion earlier was that I have some temperature sensors which prints debugging messages (but just connected to a charger) and I haven't had a problem with them. But they are not using MQTT.

Thoughts?
The administrator has disabled public write access.

MQTT switch freezing 1 year 6 months ago #2847

  • HM
  • HM's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
Hi there

I got more the less the same problem.
After a while my ESP do not react on IOT commands, but I can ping the module and use the local button.

Does yours still run stable after deactivating "Debug" ?

Best
Henrik
The administrator has disabled public write access.

MQTT switch freezing 1 year 6 months ago #2854

  • EasyIoT
  • EasyIoT's Avatar
  • Offline
  • Administrator
  • Posts: 833
  • Thank you received: 258
  • Karma: 24
HM wrote:
Hi there

I got more the less the same problem.
After a while my ESP do not react on IOT commands, but I can ping the module and use the local button.

Does yours still run stable after deactivating "Debug" ?

Best
Henrik

Do you have myMqtt.subscribe("/Db/" + instanceId + "/" + String(storage.moduleId) + "/Sensor.Parameter1"); in myConnectedCb() function? In first version of program it was missing, and switch did not reconnect after disconnect. Proper function is like this:

void myConnectedCb() {
#ifdef DEBUG
Serial.println("connected to MQTT server");
#endif
myMqtt.subscribe("/Db/" + instanceId + "/" + String(storage.moduleId) + "/Sensor.Parameter1");
}
The administrator has disabled public write access.

MQTT switch freezing 1 year 6 months ago #2857

  • HM
  • HM's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
Thank you.

I did not have the right function. :unsure: :whistle:
I will try this, hopefully it helps - I will let you know :woohoo:

Best
Henrik
The administrator has disabled public write access.
Time to create page: 0.137 seconds
Powered by Kunena Forum