ESPEasy P2P Networking - sendTo - Help needed

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Riewekooche
Normal user
Posts: 21
Joined: 21 Nov 2022, 07:40

ESPEasy P2P Networking - sendTo - Help needed

#1 Post by Riewekooche » 29 Jun 2023, 11:27

Dear friends,

at my ESP12f (Unit1) i messure the temperature with a DHT22.
The value is found at device task-1 DHTo#T1.

Now I need this value at my second ESP12f (Unit2) in the DummyDevice-task-4 (TaskValueSet 4,1,x)

First i activated the ESPEasy P2P in the Controller-menu at both ESPs. Then i inserted a rule at the sender:
on DHTo#T1 do
sendTo 1,"TaskValueSet 4,1,([DHTo#T1])"
endon

In the log, the rule is executed, but i don't know how to get the sended values at the unit2.
What should i do?

Kind regards
Thomas

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

Re: ESPEasy P2P Networking - sendTo - Help needed

#2 Post by TD-er » 29 Jun 2023, 11:36

You can simply share a plugin/task directly to another node.
See for instructions here: https://espeasy.readthedocs.io/en/lates ... #c013-page

The sendto command is using the same p2p protocol as mentioned in that link.
Make sure the unit numbers are unique in your setup an all nodes participating use the same UDP port number (preferrably use port 8266)

N.B. you should not use () in the command.
The "sendto" command requires the unit number of the receiving node, so in your setup it should be something like this:

Code: Select all

on DHTo#T1 do
  sendTo,2,"TaskValueSet 4,1,[DHTo#T1]"
endon
Assuming you have given the units their own (unique) unit ID. Do not use unit ID 0 or 255.

On the receiving node you must have a dummy task at task-index 4.

Riewekooche
Normal user
Posts: 21
Joined: 21 Nov 2022, 07:40

Re: ESPEasy P2P Networking - sendTo - Help needed

#3 Post by Riewekooche » 29 Jun 2023, 12:45

Hi TD-er,

i'd activated the P2P Network at both sides and used a wrong TaskValueSet (4 instead of 5).

Now it works :-)

Thanks

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

Re: ESPEasy P2P Networking - sendTo - Help needed

#4 Post by TD-er » 29 Jun 2023, 12:48

Good to hear it is now working :)

Have fun!

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

Re: ESPEasy P2P Networking - sendTo - Help needed

#5 Post by Ath » 29 Jun 2023, 12:49

Riewekooche wrote: 29 Jun 2023, 12:45 Hi TD-er,

i'd activated the P2P Network at both sides and used a wrong TaskValueSet (4 instead of 5).

Now it works :-)

Thanks
That was one of the reasons that support for taskname and taskvaluename was introduced for the TaskValue* group of commands ;)
So you could have used:

Code: Select all

  sendTo,2,"TaskValueSet DHTremote,Temp,[DHTo#T1]"
assuming you named your dummy task "DHTremote" and used the value name "Temp"
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests