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

Webserver port + P2P information exchange #3053

Merged
merged 12 commits into from
May 23, 2020

Conversation

uzi18
Copy link
Contributor

@uzi18 uzi18 commented May 4, 2020

@TD-er something new :)

src/src/DataStructs/NodeStruct.h Show resolved Hide resolved
@@ -364,6 +368,8 @@ void sendSysInfoUDP(byte repeats)
data[14] = Settings.Build >> 8;
memcpy((byte *)data + 15, Settings.Name, 25);
data[40] = NODE_TYPE_ID;
data[41] = lowByte(Settings.WebserverPort);
data[42] = highByte(Settings.WebserverPort);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if on the receiving side the message is accepted if its size differs from before.
Also on the receiving end you must make sure to realize this can be missing information.
Also there is some extended data version of this message if I'm not mistaken.

Maybe we should also introduce a version/revision of this message type?

Copy link
Contributor Author

@uzi18 uzi18 May 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we send here 80 bytes and check only if 1st byte is 255 and packet len is more than 2 bytes
maybe we can use here build id on receiver site, but it is not a problem, because old builds not use these data

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But do they check for packet type based on the length of the packet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean rpieasy or older versions of espeasy?
on our side we have only check for length of packet but in fact it is always true because we send/receive always 80 bytes :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought there was some part of the p2p code that actually checks on the length of a packet.
But maybe the length is a parameter in the data itself.
Have to check the code as the correctness of my memory also has some variation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've -by accident- come across this code myself as I needed to store node information received via another entry point and indeed it is a bit more data that's being sent.

I'm now creating a struct for it so we can just byte copy the whole struct at once and also extend with other features.

I will also add the port number as you added and maybe some more fields too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TD-er so you want to merge this and extend with your work?
be aware about endiness of ints - arduino declares cpu as bigendian so can't store it directly thats why used here lowByte/highByte and makeWord

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also think about it and we should have these structs in src/DataStructs/...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already have it in src/DataStructs :)

Copy link
Contributor Author

@uzi18 uzi18 May 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TD-er and what about rest of webserver port stuff (not related to p2p)?

src/src/DataStructs/SettingsStruct.h Show resolved Hide resolved
@uzi18
Copy link
Contributor Author

uzi18 commented May 5, 2020

@TD-er in ESPEasyStorage.ino line 155 we have test for build numbers with <= do i have to add there +1?
What do you think we can merge this PR or need to add something more?
Thinking about check also if mDNS sends also proper port ? not sure if it is possible but will check

@TD-er
Copy link
Member

TD-er commented May 5, 2020

A test build is running and will be ready in about 10 - 15 minutes.

@TD-er
Copy link
Member

TD-er commented May 5, 2020

A [est build: ESPEasy_mega-20200426-70-PR_3053.zip

@ghtester
Copy link

ghtester commented May 5, 2020

Just quickly tested:
Build:⋄ 20107 - Mega
System Libraries:⋄ ESP82xx Core 83166f94, NONOS SDK 2.2.2-dev(a58da79), LWIP: 2.1.2 PUYA support
Git Build:⋄
Plugin Count:⋄ 83 [Normal] [Testing]
Build Origin: Travis
Build Time:⋄ May 6 2020 01:01:06
Binary Filename:⋄ ESP_Easy_mega_20200506_test_beta_ESP8266_4M1M
Build Platform:⋄ Linux-4.15.0-91-generic-x86_64-with-glibc2.27
Git HEAD:⋄ HEAD

It looks to be working fine, tested with Webserver Port change to 81.

Thanks for the great job!

@TD-er
Copy link
Member

TD-er commented May 6, 2020

I tested the links generated on the start page and it generated links to older units with random port numbers.
You should check against the build number in the p2p code to see if the other side was aware of sending a port number.

@uzi18
Copy link
Contributor Author

uzi18 commented May 6, 2020

ok will add one more test there

@uzi18
Copy link
Contributor Author

uzi18 commented May 6, 2020

@TD-er here you are :)

TD-er added a commit to TD-er/ESPEasy that referenced this pull request May 12, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request May 22, 2020
@uzi18
Copy link
Contributor Author

uzi18 commented May 22, 2020

@TD-er any news with this PR?

@TD-er
Copy link
Member

TD-er commented May 22, 2020

I will add some of the code I made for the other project I work on and then I will merge it.

@TD-er TD-er merged commit 9fe0bcc into letscontrolit:mega May 23, 2020
@uzi18
Copy link
Contributor Author

uzi18 commented May 24, 2020

thx, so now will try to find next bug/feature to resolve :)

@TD-er
Copy link
Member

TD-er commented May 24, 2020

Preferably bugs, as I would like to add a release stamp on it.

@uzi18
Copy link
Contributor Author

uzi18 commented May 24, 2020

do you have a list of most wanted?

@TD-er
Copy link
Member

TD-er commented May 24, 2020

Not really the most wanted, but since you've also been working on ESP32, and I haven't looked at this one, maybe you can have a look at #3079

TD-er added a commit to TD-er/ESPEasy that referenced this pull request May 27, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Jun 6, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Jun 6, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Jun 9, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Jun 22, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Jun 23, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Jun 25, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Jun 28, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Jun 28, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Jul 3, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Jul 3, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Jul 23, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Jul 31, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Aug 9, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Aug 11, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Sep 19, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Sep 19, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Sep 25, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Sep 25, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Sep 27, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Sep 29, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Sep 29, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Oct 4, 2020
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Oct 7, 2020
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

Successfully merging this pull request may close these issues.

4 participants