P2P Node status event ?
Moderators: grovkillen, Stuntteam, TD-er
P2P Node status event ?
Hi,
Background:
I have built a quite large setup with 15 ESPEasy powered nodes, mix of ESP8266 and ESP32, to control a quite large analog H0 model railway from 1970th.
In General, it all works as a charm
Issue:
However sometimes I have issues to get all nodes up and everything initiated in correct order. Since it's mechatronics involved it's critical.
Question:
Is it possible to get an event for the node status for another node that is seen in the main tab in the GUI?
Haven't found anything in the documentation about it. Am I missing something?
Background:
I have built a quite large setup with 15 ESPEasy powered nodes, mix of ESP8266 and ESP32, to control a quite large analog H0 model railway from 1970th.
In General, it all works as a charm
Issue:
However sometimes I have issues to get all nodes up and everything initiated in correct order. Since it's mechatronics involved it's critical.
Question:
Is it possible to get an event for the node status for another node that is seen in the main tab in the GUI?
Haven't found anything in the documentation about it. Am I missing something?
Re: P2P Node status event ?
Hi,
there are several types of events you could use in rules.
Like when the node boots or connects to the WiFi:
And the Rules example for the receiving node would be:
Edit:
Links to the documentation:
https://espeasy.readthedocs.io/en/lates ... nd-publish
https://espeasy.readthedocs.io/en/lates ... tem-events
there are several types of events you could use in rules.
Like when the node boots or connects to the WiFi:
Code: Select all
On System#Boot Do
//code that will run when the unit boots
Endon
On WiFi#Connected Do
//code that will run when the the node connects to the WiFi
Endon
To help you better it would be good to understand what you mean by "get all nodes up" and "initiated in correct order"
You could use the rules example above and send an event to the "main" node:
Code: Select all
On WiFi#Connected Do
SendTo,1,'Event,Connected=%unit%'. //send the event "connected" to the unit number 1 and also send the units own unit number
Endon
Code: Select all
On Connected Do
LogEntry,'Unit %eventvalue1% just connected to the WiFi'. //example output would be "HTTP: LogEntry,'Unit 5 just connected to the WiFi'
Endon
Edit:
Links to the documentation:
https://espeasy.readthedocs.io/en/lates ... nd-publish
https://espeasy.readthedocs.io/en/lates ... tem-events
Re: P2P Node status event ?
Thank you for your prompt reply!
Yes I think that you have proposed exactly what I need. I will try that during this weekend if I find some time to spend on this hobby-project
I have added a mechanism to make sure that all nodes are initiated and that all rail-switches are in a known positions - it works 60-70% of each power up - but not always. I guess that there is a time race between the nodes to get their Wifi - connections from my router, and that some nodes get their connection before the main node sometimes - even if I added quite long time after WiFi#Connected event in the "not main nodes". The router is quite old and dedicated just for the railway.
Yes I think that you have proposed exactly what I need. I will try that during this weekend if I find some time to spend on this hobby-project
I have added a mechanism to make sure that all nodes are initiated and that all rail-switches are in a known positions - it works 60-70% of each power up - but not always. I guess that there is a time race between the nodes to get their Wifi - connections from my router, and that some nodes get their connection before the main node sometimes - even if I added quite long time after WiFi#Connected event in the "not main nodes". The router is quite old and dedicated just for the railway.
Re: P2P Node status event ?
Interesting approach doing all the controlling with ESPEasy nodes
That reminds me that under my model railway the where huge amounts of tangled cable and so i had to spend quite some time unter the table when something was wrong...o well... i was young and my body didn´t bother
I would be happy to see your installation.
That reminds me that under my model railway the where huge amounts of tangled cable and so i had to spend quite some time unter the table when something was wrong...o well... i was young and my body didn´t bother
I think so too. And there is so much more you can do with rules which makes it easy to come up with a solution to "synchronize" your nodes.
I would be happy to see your installation.
Re: P2P Node status event ?
A bit of topic, but very fun , i have also this experience with all wiring harness under the model railway when I was young - and spending hours under it to make it working.
At the time, maybe 14 years old I had a vague idea about controlling the Fleischmann railway with my Sinclair computer, but I didn't have the skills, money and maybe thechnology wasen't there either to realize it. Now more then 40 years later I suddenly realized that I probably cold make reality of my old idea, and ESPEasy is defitely one of the building block in this.
From my "man cave"... still some harness though...
At the time, maybe 14 years old I had a vague idea about controlling the Fleischmann railway with my Sinclair computer, but I didn't have the skills, money and maybe thechnology wasen't there either to realize it. Now more then 40 years later I suddenly realized that I probably cold make reality of my old idea, and ESPEasy is defitely one of the building block in this.
From my "man cave"... still some harness though...
Re: P2P Node status event ?
chromo23 by using your examples I could verify my time race issue fort the nodes to get WiFi connection from my old router. I ended up with adding a relay controlled by the main node that enables power to all other nodes after WiFi has status connected. Has worked 10 of 10 times now.
Thank you for your support!
Thank you for your support!
Re: P2P Node status event ?
You are welcome.
What are the green things with what it seems red and black buttons on your control board?
Re: P2P Node status event ?
Looks like buttons to control rail switches to direct a train to a different section of the track.
Marklin has them in blue with red and green buttons (at least those old ones I had)
Re: P2P Node status event ?
Ahhh.. i only had these:
I really loved how they could be used as a push button and a switch..
Who is online
Users browsing this forum: Google [Bot] and 0 guests