Exchange dummy variables between 2 espeasy.

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ironic
Normal user
Posts: 6
Joined: 02 Nov 2019, 15:41

Exchange dummy variables between 2 espeasy.

#1 Post by ironic » 02 Nov 2019, 16:18

Hi all.

I'm french and very happy when i discovered ESPeasy few weeks ago.
I have 8 NodeMCU and lot of sensors, relays, oled, WS2812, DFplayer...
I'm not a noob and made severals DIY projects with them.

One thing make me crazzy.
How can i send a dummy variable from ESPeasy 1 to ESPeasy 2 like this.
(2 ESP8266 are connected to my network, one have DHT22 and other an Oled)
I would like, the more easy possible, send the temperature from ESP 1 (witch is in a dummy variable) to the second ESP (in Dummy variable too).
I try node but i want to use Dummy variables, not just send sensors values.
I said i want to receive temerature from another ESP but in fact i want to send ans receive dummy values between 2 ESP.

I can send events to other ESP but how send variables ?

I read a lot a topics since severals days and try a lot of things but i fail.

I use 2 NodeMCU V3 with ESP_Easy_mega-20191028_normal_ESP8266_4M1M
(Rules enable, UDP 65500, but no controllers in 2 ESPeasy and only Generic Dummy and oled ssd1306 Devices)

I"m happy to read this forum but sorry if this topicis somewhere, i don't read/see it.
If it is easy, sorry for this topic.


I can send a value from my browsher like ()

Browsher :

Code: Select all

http://192.168.0.210/control?cmd=event,Var1=5
ESP 2 :

Code: Select all

On var1 do
 TaskValueSet 2,1,%eventvalue%
endon
But this do nothing :

Code: Select all

SendToHTTP 192.168.0.2,80/control?cmd=event,Var1=5

Code: Select all

SendTo 2,event,Var1=5
Strange too, i never find how to use SendTo.

Code: Select all

SendTo 2,event,start_blink
Never launched the start_blink event on ESP 2.
IP of twice ESP are OK.



Best regars.

ironic
Normal user
Posts: 6
Joined: 02 Nov 2019, 15:41

Re: Exchange dummy variables between 2 espeasy.

#2 Post by ironic » 02 Nov 2019, 17:59

Sorry, it works now but i had to reset (delete) all rules, devices, controllers on two ESP.
I will explain how to do for noob people like me, lol.

Best regars.

Patou
Normal user
Posts: 38
Joined: 21 May 2018, 10:33

Re: Exchange dummy variables between 2 espeasy.

#3 Post by Patou » 02 Nov 2019, 22:03

Hello,
An easy way to communicate from one esp to the other is using espeasy p2p udp controller it is explained here :
https://espeasy.readthedocs.io/en/lates ... #c013-page

Please read also some post as :
[Solved] mega 0805 is ok after that version change > no p2p anymore ?
viewtopic.php?f=6&t=7031&p=40360&hilit=p2p#p40360
Have an good evening
Patou

ironic
Normal user
Posts: 6
Joined: 02 Nov 2019, 15:41

Re: Exchange dummy variables between 2 espeasy.

#4 Post by ironic » 09 Nov 2019, 05:18

Hi.

To get temperature from ESP 1 and send to ESP 2 i do :
ESP 1 have DHT22 (device 1), no controller, no dummy device.
ESP 2 have Oled, oled device (device 1), dummy device (device 9).


ESP 1 rules

Code: Select all

On WiFi#Connected do
  timerSet,1,5
endon

On Rules#Timer=1 do
  sendTo 2,event,one=[DHT22#Temperature]
  timerSet,1,5
endon
On Wifi connected, start a timer of 5s.
On Timer true, send event (named one here) with DTH data to ESP 2.


ESP 2 rules

Code: Select all

on one do
  TaskValueSet 9,1,%eventvalue%
endon
On event one (from ESP 1 and every 5 seconds), send value of "one" to Dummy Device (device 9), Value 1
Here, %eventvalue% is the data from ESP 1.

Now, i can use oled device on ESP 2 to show temperature from this Dummy Device.
Receive data every 5 seconds isn't needed for temperature. Every 1 or 5 minutes is enough.

I know lot of peaple know how to do this but if it can help someone.

Thank to esp community.

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

Re: Exchange dummy variables between 2 espeasy.

#5 Post by TD-er » 09 Nov 2019, 10:10

You could have a look at the ESPEasy p2p controller.
See: https://espeasy.readthedocs.io/en/lates ... #c013-page

There is also a list in there about things to look at like unit number.
Don't forget checking that list or else you may look like forever why it isn't working.

ironic
Normal user
Posts: 6
Joined: 02 Nov 2019, 15:41

Re: Exchange dummy variables between 2 espeasy.

#6 Post by ironic » 09 Nov 2019, 13:27

Hi.

I know i can use p2p controller, i used it but :
When i enabled p2p controller on all my 8 NodeMCU with port 65500, my wife told me is notebook wifi was broken.
When i disconected and reconnected wifi, all went ok but 30mn later, same thing. Wifi lost 4 time just when i played with p2p controller.

Really strange, so i found another way.

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

Re: Exchange dummy variables between 2 espeasy.

#7 Post by TD-er » 09 Nov 2019, 16:49

Have you also tried a different port?
We have registered port 8266 as the official UDP port for this protocol.

ironic
Normal user
Posts: 6
Joined: 02 Nov 2019, 15:41

Re: Exchange dummy variables between 2 espeasy.

#8 Post by ironic » 10 Nov 2019, 19:35

I have received 3 Wemos pro, i'll try with all my NodeMCU/Wemos on port 8266 soon.
I think i don't need that all my esp send they datas to all other esp.

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests