letscontrolit / ESPEasy

Easy MultiSensor device based on ESP8266/ESP32
http://www.espeasy.com
Other
3.28k stars 2.21k forks source link

[ESPEasy P2P] Add port nr to NodeStruct #2252

Closed enesbcs closed 1 year ago

enesbcs commented 5 years ago

I know, that the ESPEasy P2P data structure v0 is the following:

struct NodeStruct
{
  String nodeName;
  byte ip[4];
  uint16_t build;
  byte age;
  byte nodeType;
};

But in RPIEasy there are several HTTP ports can be used and i appended a word after this structure to let it know the other nodes, how to point exactly. https://github.com/enesbcs/rpieasy/issues/13

Could this be integrated in ESPEasy or could this port selection feature be added to the newer v1 structure?

uzi18 commented 5 years ago

please be more precise, what kind of info you need to add at the end of this structure

TD-er commented 5 years ago

And also why not also using an UDP port? You can also start a service on the Pi to collect the UDP data. Also I claimed (UDP) port 8266 for this, which is a port number > 1024, so you don't need to be root to run a service for it.

So please give some use case or a bit more information on what you're missing.

Budman1758 commented 5 years ago

I believe he is asking for this so that RPIEasy nodes in the ESPEasy node list on the main page include the port number in the ip address that you can click on to go to that node. As it is now if you click on an RPI node in that list it will not get to that node unless its running on the default port 80.

TD-er commented 5 years ago

port number for the web interface you mean? Ah, I get it.

enesbcs commented 5 years ago

Yep sorry, i missed that information. :) RPIEasy tries to use a free HTTP port for it's webGUI in this order [80,8080,8008] . (as this is a linux computer some of us already installed onto it an apache webserver for example that grabs port 80, or Domoticz which uses default port 8080, so RPIEasy uses what it could, etc..)

So in the ESPEasy NodeList when someone clicking an RPIEasy node that's running on 8080 or 8008 ports will be redirected to a wrong place. I have to extend the structure a little to solve this.

struct NodeStruct
{
  String nodeName;
  byte ip[4];
  uint16_t build;
  byte age;
  byte nodeType;
  word webgui_portnumber; // if it contains 0 than i suppose 80
};

Not a bug in the ESPEasy, it's a hack by me, sorry. :)

TD-er commented 5 years ago

Well, since the v1 version of the protocol is still in development, you may also think of other information missing.

uzi18 commented 4 years ago

@enesbcs so if you want to test it maybe we can ask @TD-er to provide test builds :)

uzi18 commented 2 years ago

@TD-er this issue should be closed @enesbcs please confirm

tonhuisman commented 1 year ago

This issue can be closed as per the information/request above.