ping plugin

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
BartSr
Normal user
Posts: 123
Joined: 27 Sep 2019, 17:45

ping plugin

#1 Post by BartSr » 12 Oct 2023, 11:57

Hi!
How can I use the ping-plugin?
Is there a usual binfile which includes this ?

For an application I want to be sure that some other esp's (ESP82) are alive. These are sending (by rules ) status info of GPIO which I want to use in a central one (ESP32)
Aim: sent open/close status of doors to central panel.

TIA
-Bart

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ping plugin

#2 Post by Ath » 12 Oct 2023, 12:54

The ping plugin is available in all Collection builds, except for ESP32, as the underlying code is explicit for ESP8266, and not compatible with ESP32. Some experiments have been done on getting this to work as intended, but have not been successful/stable yet. A lot of work is currently going into compatibility of ESP32 with newer Arduino (3.0) libraries (with many breaking changes :o), and once that is completed, the Ping plugin will most likely get some attention.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ping plugin

#3 Post by TD-er » 12 Oct 2023, 12:55

I've been looking into porting the ping plugin to ESP32, but so far was not successful.
I have planned to look into it a bit more after transitioning to the ESP-IDF 5.1 SDK as a lot has changed since IDF 5 and I don't want to re-do it in a few months.

BartSr
Normal user
Posts: 123
Joined: 27 Sep 2019, 17:45

Re: ping plugin

#4 Post by BartSr » 12 Oct 2023, 14:14

Ath and TD-er, thanks for your prompt reply.
Stupid me I didnot check using ESP82 but ESP32 instead.
I flashed from https://td-er.nl/ESPEasy/latest/ (most fast way for me to flash!!) using ESP_Easy_mega_20230929_collection_A_ESP8266_4M1M and it was peanuts to try this ping-option.

Maybe it's somewhere in the docs but if ping fails the counter gets updated. Is there a limit to that countervalue?

-Bart

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ping plugin

#5 Post by Ath » 12 Oct 2023, 15:05

There is no limit, other than the max. value allowed in such a variable (theoretically 3.4028237 × 10^38 :shock:), but you will get an event generated every interval with the last stored value. You can reset that using the "pingset,<new_value>" command.
/Ton (PayPal.me)

BartSr
Normal user
Posts: 123
Joined: 27 Sep 2019, 17:45

Re: ping plugin

#6 Post by BartSr » 11 Nov 2023, 11:56

Well, I managed to use ping.
The status is diplayed by zero (ping Ok) or a number.
But once I reboot the device there is only a dash (-) iso a value.
Reset of the device (nodemcu) brought back a 0 as value.
How to prevent that dash-value? Using Pingset command?
I am using the ping (several) to monitor a doorlock.
TIA
Bart

BartSr
Normal user
Posts: 123
Joined: 27 Sep 2019, 17:45

Re: ping plugin

#7 Post by BartSr » 12 Nov 2023, 11:56

In addition: would it be a solution to have a rule providing a certain delay somewhere in the proces during start-up?

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ping plugin

#8 Post by TD-er » 12 Nov 2023, 12:27

You can put a "taskdisable,N" (with N being the task index) in the rules like this:

Code: Select all

on System#Boot do
  taskdisable,1 // Disable task #1 for now
  TimerSet,1,10 // Set timer #1 at 10 seconds
endon

on Rules#Timer=1 do
  taskenable,1
endon

BartSr
Normal user
Posts: 123
Joined: 27 Sep 2019, 17:45

Re: ping plugin

#9 Post by BartSr » 12 Nov 2023, 13:08

TD-er. I hoped that a time delay would enable the ping activity but sorry to say result not as ecpected.
But after I pressed reset on NodeMCU the value 0 for fails pops up prior to have the device enabled.
Any suggestion? For info also firmware data.
Schermafbeelding 2023-11-12 130602.jpg
Schermafbeelding 2023-11-12 130602.jpg (15.65 KiB) Viewed 2516 times
Schermafbeelding 2023-11-12 131201.jpg
Schermafbeelding 2023-11-12 131201.jpg (40.45 KiB) Viewed 2513 times

BartSr
Normal user
Posts: 123
Joined: 27 Sep 2019, 17:45

Re: ping plugin

#10 Post by BartSr » 12 Nov 2023, 19:06

After digging through some esp-documentation I found that pulling the rst-pin low wil have same effect as pressing rst-button.

I tried by puling the rsp-pin to ground (simple using a wire) and indeed then the 0-value appears as ping-value.

So the solution is to pull rst-pin low after boot. Is that possible from rules or do I have to use an optocoupler to pull rst low controlled by a regular I/O pin?

or LongPulse_ms,xx,0,10 where xx needs a replacement for rst-pin.

-Bart

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ping plugin

#11 Post by Ath » 12 Nov 2023, 19:46

During initialization this plugin sets the Fails value to 0, so it's a bit surprising that it is displayed as -.
Though I'm understanding more and more of how ESPEasy works, this is kind of a mystery to me.

You use a rather old release of ESPEasy. Though it would be strange if it would change behavior, but can you update to a more recent release? Either by downloading from https://github.com/letscontrolit/ESPEasy/releases or installing via https://td-er.nl/espeasy or https://td-er.nl/espeasy/latest (the latest beta available) These last 2 links require either Chrome or Edge browsers to be able to install, because the technique used isn't (yet) implemented in other browsers.
/Ton (PayPal.me)

BartSr
Normal user
Posts: 123
Joined: 27 Sep 2019, 17:45

Re: ping plugin

#12 Post by BartSr » 12 Nov 2023, 20:21

Ath, more recent built seems to be the clue.
After boot the ping value shows zero now.

Stupid I didnot try that sooner.....

Thanks as usual!
-Bart
Attachments
abc.jpg
abc.jpg (59.25 KiB) Viewed 2487 times

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ping plugin

#13 Post by Ath » 12 Nov 2023, 21:06

Ok, great that it's solved now :D

The fix for resetting that 0 value was merged in March, so would have been included in the May-build you where using, but a lot has changed since that build, so it's rather hard to go back in time.
/Ton (PayPal.me)

BartSr
Normal user
Posts: 123
Joined: 27 Sep 2019, 17:45

Re: ping plugin

#14 Post by BartSr » 23 Nov 2023, 16:52

The ping plugin has run for 10 days without problems. There are 5 devices to be monitored. So far so good.
Today I noticed for one ESP device around 2500 fails.Interval 5 sec. But I could open the relevant website as usual.
The only way to revert to 0 fails was to reboot the ESP with ping plugin.
Known problem?
Bart

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 37 guests