Welcome, Guest
Username: Password: Remember me

TOPIC: hibernate problem:have to restart mqtt driver

hibernate problem:have to restart mqtt driver 1 year 3 months ago #3289

  • Zaitsev
  • Zaitsev's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
windows 8 x 64 platform.
After hibernate mqtt is not working and I have to trig disable/enable button to restart.
Proposal: on c# it is easy to fix:
http://]https://msdn.microsoft.com/en-us/library/system.serviceprocess.servicebase.onpowerevent.aspx

PS:
I worked it around by myself using automation:
//===================
int N=0;
public void Setup()
{
	Console.WriteLine("\nSetup()\n");
  	EventHelper.ModuleChangedHandler((o, m, p) =>
    {
      if (m.Domain == Domains.MQTTCLIENT /*&& p.Property == "Status.Connection"*/ )
 		Console.WriteLine("\n<event>\t" + m.Address + " in program id "+ Program.ProgramId.ToString()+ " driver "+ 
                          m.Domain + " address "+ m.Address + " property "+ p.Property + " value " + p.Value);
      	N=0;
        return true;
    });
	Console.WriteLine();
}
public void Run()
{
	Console.WriteLine("\n\t<Run>\tN={0}",N++);
    if(N>=3){
      N=0;
	  Console.WriteLine("\n\t<MQTTCLIENT.SetIsEnabled>");
      DriverHelper.ProcessCommad(Domains.MQTTCLIENT, "1", "SetIsEnabled","");
    }
}
Also this solution reconnects MQTT which is significant for some brokers.
But again - this is just work around.
Last Edit: 1 year 3 months ago by Zaitsev. Reason: workaround
The administrator has disabled public write access.
Time to create page: 0.156 seconds
Powered by Kunena Forum