Page 1 of 1

rules for STA available

Posted: 04 Jun 2018, 13:49
by riker1
Hi
I experienced that the esp is not always able to connect to the Router

How can I define a rule to send a message/ or switch an GPIO do show if network connect - STA Mode is running?

Or send a mail, MQTT when esp is falling back to AP Mode

Thanks for the help.

Thomas

Re: rules for STA available

Posted: 05 Jun 2018, 14:06
by TD-er
How should a MQTT message be sent when STA is failing?
There is an event when wifi is connected and you could set a "LWT" (Last Will and Testament) in the MQTT config.
If the node is disconnected from the broker, the broker will send that LWT message.

Re: rules for STA available

Posted: 05 Jun 2018, 16:44
by riker1
Hi
Have a route from 4.1 set
to 0.x
So could send a mail
Or mqtt

so if ESP is fallback to AP, with 192.168.4.1 it still can send emails, and mqtt via route.

I experienced a lot of wifi disconnects and connects.
why is ESP often get disconnected and reconnecting?

Re: rules for STA available

Posted: 05 Jun 2018, 17:40
by riker1
TD-er wrote: 05 Jun 2018, 14:06
There is an event when wifi is connected and you could set a "LWT" (Last Will and Testament) in the MQTT config.
If the node is disconnected from the broker, the broker will send that LWT message.
where do i configure the LWT? in mqtt controller config? or mosquitto?

Re: rules for STA available

Posted: 05 Jun 2018, 18:09
by mrwee
riker1 wrote: 05 Jun 2018, 16:44 I experienced a lot of wifi disconnects and connects.
why is ESP often get disconnected and reconnecting?
Have ~20-30 x ESP8266 modules running. Most with ESP Easy, and none disconnect/connect from either Wi-Fi nor MQTT. Maybe you should troubleshoot there first?

Re: rules for STA available

Posted: 05 Jun 2018, 18:16
by riker1
mrwee wrote: 05 Jun 2018, 18:09
riker1 wrote: 05 Jun 2018, 16:44 I experienced a lot of wifi disconnects and connects.
why is ESP often get disconnected and reconnecting?
Have ~20-30 x ESP8266 modules running. Most with ESP Easy, and none disconnect/connect from either Wi-Fi nor MQTT. Maybe you should troubleshoot there first?
Hi
maybe it is related to device delay, not sure.
will try to trubbbleshoot.

thanks

Re: rules for STA available

Posted: 06 Jun 2018, 22:49
by TD-er
riker1 wrote: 05 Jun 2018, 16:44 [...]
I experienced a lot of wifi disconnects and connects.
why is ESP often get disconnected and reconnecting?
I don't experience those myself, but I've seen so many reported issues already that I'm very curious to the used configuration.
What plugins?
Is there a MQTT import plugin active?
Are there just disconnects, or is it also reboots?
Can you post some logs from such a reconnect?
Is there a controller configured (e.g. Domoticz MQTT) which is not enabled?