Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

easyfetch-->"unit-menu" via port forward not working. #8

Closed
JonHea opened this issue Jan 23, 2024 · 7 comments
Closed

easyfetch-->"unit-menu" via port forward not working. #8

JonHea opened this issue Jan 23, 2024 · 7 comments

Comments

@JonHea
Copy link

JonHea commented Jan 23, 2024

Hello!
For some years now I have built up a P2P network with a number of ESP8266, since some time ago I have also installed "easyfetch" which I appreciate extremely much.

Building autonomous simple dashboards is a hit!!

I have a dedicated IoT-WIFI at home where all espeasy are hosted. This IoT-WIFI is behind my regular WIF network, via a port forward (TCP port80) in the firewall between the regular WIFI network and the IoT-WIFI I can reach a special one (ESP32) that I have as the main unit for various reasons.
If I'm on my regular WIF network and run via port forward to fetch.htm on the ESP32 everything looks fine, units update, but if I open the "unit-menu" I see all other nodes in the network as expected. But if I click on another node, nothing happens!

Question:
How does the communication work between other P2P nodes and the node that you look at in the web browser. Is direct contact created between the web browser and the node you are looking at or is the traffic "routed" through the node you are looking at in the web browser??

Best regards Jonas Hellman

@chromoxdor
Copy link
Owner

chromoxdor commented Jan 23, 2024

How does the communication work between other P2P nodes and the node that you look at in the web browser. Is direct contact created between the web browser and the node you are looking at or is the traffic "routed" through the node you are looking at in the web browser??

Hi Jonas,

When you start easyfetch the first time it simply fetches the JSON of the node where easyfetch is hosted. (you can see the JSON output if you click on the Button "show JSON " in the /tools tab in ESPEasy).
Only the containing information is used to generate the content in easyfetch. One of the entries is the node list.
e.g.

"nodes":[
{"nr":1,
"name":"Main",
"build":20719,
"platform":"ESP Easy Mega",
"ip":"192.168.1.132",
"age":0
},{"nr":2,
"name":"Junkers",
"build":20258,
"platform":"ESP Easy Mega",
"ip":"192.168.1.182",
"age":1
},...

This list is used to generate the unit-list of the sidenav.
If you click on one of the units, easyfetch starts to fetch the JSON output of this unit through the corresponding IP.

That the nodes can find each other (and also communicate) they use a special P2P network
The P2P network is an ESPEasy feature and has nothing to do with easyfetch.
Infos and tips regarding this topic can be found here: https://espeasy.readthedocs.io/en/latest/Controller/C013.html

The unit list in easyfetch is the same as the on in ESPEasy in the /main tab. So if the units do not appear there, they will be missing in easyfetch as well.
Bildschirmfoto 2024-01-23 um 17 27 38

BTW FYI: I didn't document some new features in easyfetch. 🫣
But if you wanna try:

  • custom color for sensor and big-value tiles: devicename + ? + hex color(without leading #) e.g.: "sensor?1E847C"
  • the clock plugin generates a button tile now wich lights up according to the state of the first value (output). by clicking on it the plugin page opens.
  • when using "_" it will be displayed as space in value names
  • when using "." it will be used for wordbreak in long value names (so you can decide where the name should break)

@chromoxdor
Copy link
Owner

chromoxdor commented Jan 23, 2024

Is direct contact created between the web browser and the node you are looking at or is the traffic "routed" through the node you are looking at in the web browser??

To elaborate that:
Since easyfetch gets the JSON output of the unit you selected to render the tiles (and everything else) it directly contacts this unit to fetch the data.
But sending commands is a different thing. Because of the CORS policy, easyfetch has to send every command trough the unit that hosts easyfetch.
For example: When you press a button called "Relay" on a unit with the unit number 2 the command will look like this: http://<IP_main_unit>control?cmd=SendTo,2,"event,RelayEvent"

@JonHea
Copy link
Author

JonHea commented Jan 23, 2024 via email

@chromoxdor
Copy link
Owner

can this also be solved on TextbigVal!?

It could be... do you need it?

@chromoxdor
Copy link
Owner

can this also be solved on TextbigVal!?

i just added this in the latest update... :)

@JonHea
Copy link
Author

JonHea commented Jan 24, 2024 via email

@chromoxdor
Copy link
Owner

Do you want me to wish for more features if I come up with something??

I am of course very interested to hear what other people might be missing in easyfetch.
Feature requests are always welcome but i can not promise that they will ever be implemented since i want to keep the whole thing as small as possible. But i am already thinking about restructuring easyfetch so that features can be easily deactivated for devices with limited space (e.g. 1M units).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants