p2p Config (Read another units GPIO)

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Adelya
New user
Posts: 9
Joined: 12 Sep 2020, 19:47

p2p Config (Read another units GPIO)

#1 Post by Adelya » 05 Jul 2021, 17:15

Hi,
My Setup (both units ok) -
esp.png
esp.png (20.68 KiB) Viewed 6659 times
Unit 1 'Send'
send.png
send.png (7.2 KiB) Viewed 6659 times
Unit 2 'Receive'
Receive.png
Receive.png (5.98 KiB) Viewed 6659 times
Problem nothing being received ? Please advise on my setup error / understanding.

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

Re: p2p Config (Read another units GPIO)

#2 Post by TD-er » 05 Jul 2021, 22:57

What build do you use?
Looks like a relative old build.

Please also check the points mentioned here: https://espeasy.readthedocs.io/en/lates ... #c013-page
And the values on the 'device' page will perhaps not update automatically if that's the only task.
Just as test you can add another task on the 'receiving' node outputting a system info task and most important, set the "interval" of that task to 1 sec to get regular updates on the devices page.

Adelya
New user
Posts: 9
Joined: 12 Sep 2020, 19:47

Re: p2p Config (Read another units GPIO)

#3 Post by Adelya » 05 Jul 2021, 23:05

Thanks. mega-20200426. I will try & revert.

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

Re: p2p Config (Read another units GPIO)

#4 Post by TD-er » 05 Jul 2021, 23:07

Maybe you can try one of these builds: (later build than the 2021-05-31 on GitHub)
https://td-er.nl/ESPEasy/
The files themselves: https://td-er.nl/ESPEasy/static/

Adelya
New user
Posts: 9
Joined: 12 Sep 2020, 19:47

Re: p2p Config (Read another units GPIO)

#5 Post by Adelya » 06 Jul 2021, 12:43

Thanks (both). Their are other tasks & they update as expected. Added the sys info which also updates. Confirm the update to 1 sec no difference. I don't really wish to update the firmware & risk another bug, unless it is known this rev does not work. Read the docs again. I guess I just want it confirmed that with what I have done already their is no obvious mistakes ?

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

Re: p2p Config (Read another units GPIO)

#6 Post by TD-er » 06 Jul 2021, 12:55

Has the unit number of either ESP been changed since you added the 'receiving' task?
Maybe also try to share the sysinfo task (or just another one which has actually an update interval), to check if that one does work as expected

Adelya
New user
Posts: 9
Joined: 12 Sep 2020, 19:47

Re: p2p Config (Read another units GPIO)

#7 Post by Adelya » 06 Jul 2021, 13:47

send.png
send.png (6.23 KiB) Viewed 6627 times
receive.png
receive.png (4.99 KiB) Viewed 6627 times
No.

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

Re: p2p Config (Read another units GPIO)

#8 Post by TD-er » 06 Jul 2021, 13:49

OK, just a hunch... Can you change the task variable name to a non-default string?
e.g. "testload" and add it again to the receiving node

Adelya
New user
Posts: 9
Joined: 12 Sep 2020, 19:47

Re: p2p Config (Read another units GPIO)

#9 Post by Adelya » 06 Jul 2021, 14:03

send.png
send.png (6.89 KiB) Viewed 6625 times
receive.png
receive.png (6.37 KiB) Viewed 6625 times

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

Re: p2p Config (Read another units GPIO)

#10 Post by TD-er » 06 Jul 2021, 14:05

And no update on the receiving end?
Not even if you refresh the devices tab on the receiving end?

Adelya
New user
Posts: 9
Joined: 12 Sep 2020, 19:47

Re: p2p Config (Read another units GPIO)

#11 Post by Adelya » 06 Jul 2021, 14:09

No. Tried refreshing & rebooting. Is their any obvious error in what I did, now or in the gpio test ?

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

Re: p2p Config (Read another units GPIO)

#12 Post by TD-er » 06 Jul 2021, 14:26

I'm not sure if it will work as expected for tasks that do not report on a regular interval like the switch plugin.
But it should work on other tasks.

The sysinfo is also a bit tricky since it does allow for dynamically select a different number of output values.
So perhaps you do have another sensor connected to the ESP, which does always send the same set of value types. (e.g. BME280)

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

Re: p2p Config (Read another units GPIO)

#13 Post by TD-er » 06 Jul 2021, 14:29

Can you send commands to the other unit via rules using the sendto command?
See: https://espeasy.readthedocs.io/en/lates ... nd-publish

I think the simplest test is to send a logentry command to the other unit from the command field on the Tools page.

Code: Select all

sendto,2,"logentry,Test"
It may become a bit tricky using the various quotes, so better first try it simple like this example :)

Adelya
New user
Posts: 9
Joined: 12 Sep 2020, 19:47

Re: p2p Config (Read another units GPIO)

#14 Post by Adelya » 06 Jul 2021, 15:01

sendto,2,"logentry,Test" >> Success!! Appears in 'receive' unit log.

Let me try the send to command (later today) & revert. Thank you so much!

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

Re: p2p Config (Read another units GPIO)

#15 Post by TD-er » 06 Jul 2021, 15:42

OK, this can also be used from the rules to send data to the 'other side'.
For example you can act on events from the tasks and just 'forward' them to the other node, or use commands like "taskvalueset" to set values in a dummy task.

Still I don't know why the p2p isn't working for you, but at least this may be a work-around which is a bit more flexible.

Adelya
New user
Posts: 9
Joined: 12 Sep 2020, 19:47

Re: p2p Config (Read another units GPIO)

#16 Post by Adelya » 06 Jul 2021, 21:42

In Rules - sendTo 2,'let,1,1'
worked better than what I originally was trying to do, so thank you very much.

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

Re: p2p Config (Read another units GPIO)

#17 Post by TD-er » 06 Jul 2021, 22:02

You're welcome :)
Maybe it is even better to send events to the other host.
You can include upto 4 event values, which can be accessed via %eventvalue1% ... %eventvalue4$ when handling the event.
The syntax is something like this:

Code: Select all

sendto,2,event,"myevent#bla=12,34,56,78.90"
Since a comma is needed in the event, I wrapped it in quotes.

Assigning a value to a variable does not trigger any event, so you cannot act on it, only use the new value.
So if you need an immediate action, you may want to consider sending an event.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 98 guests