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

UDP->remotePort() returns incorrect value #209

Open
PsychicSmurf opened this issue Jan 3, 2021 · 3 comments
Open

UDP->remotePort() returns incorrect value #209

PsychicSmurf opened this issue Jan 3, 2021 · 3 comments

Comments

@PsychicSmurf
Copy link

Using the example UDP code in the library I have noticed that when it logs the received packet, and serial prints the remote IP Address and port, that a 5-digit port has it's first digit removed.

Using a UDP test tool (Packet Sender), on Windows 10, I transmitted a packet to the Arduino running the test code connected to my local wifi.
The test tool doesn't allow me to set the source port, but it does indicate which one its using.

If I'm using UDP:61065 in the Test Tool
then the Arduino prints "1065" in the following line:
Serial.println(Udp.remotePort());
so the output is "port 1065"

The same happens for each port the test tool uses. The first digit is removed, and the last four digits are correct.
This means that the "Ack" response here doesn't work:
Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
Udp.write(ReplyBuffer);
Udp.endPacket();
as it uses the wrong port.

When I manually override it, it works perfectly.

@JAndrassy
Copy link

This library is not maintained. Even if you provide a PR with a fix I doubt that it will be merged.
I made a new library for AT 1.7+. See if you can use it. https://github.com/jandrassy/WiFiEspAT

@PsychicSmurf
Copy link
Author

Honestly, I'd love to. I did look at your library first, however I can't get to the point where I could use it.

The serial ESP8266 devices I have are 1MB flash and were shipped with 1.5.4 firmware.
And I can't find a UK source for 2MB devices, or devices with newer firmware.

To use your library I would need to flash them and I have yet to find a Windows procedure that would let me (1) Build 1 MB version of the firmware as the download is 2MB and (2) Upload that firmware to the modules.

@JAndrassy
Copy link

JAndrassy commented Jan 4, 2021

AT 1.7.4 has a 1 MB version in download from Espressif's site

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