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

The UDP stack #18

Open
Clancys74 opened this issue Dec 5, 2018 · 5 comments
Open

The UDP stack #18

Clancys74 opened this issue Dec 5, 2018 · 5 comments

Comments

@Clancys74
Copy link

Hello,

I have installed this library in my project using the ESP-NONOS-SDK-v2.2.0. However, the UDP part is not working. I am initializing the espconn structure with the UDP configured and then i am calling espconn_create(...).
Everything was working nice with the old library i add (got from pfalcon) but now nothing happens. I can't send nor receive anything in UDP. Is there some things i have forgotten to call or init or has changed in this project?

I have also some troubles relatives to the TCP stack but i think it is mostly because this library doesn't have an ssl stack, am i right? And i want secure connection.

Clancys

@martin-ger
Copy link
Owner

There are some problems with the SDK 2.2, that's why I've gone back to 2.1 for the precompiled binaries. Do you have the same problems with the SDK 2.1. If so, could you provide me with a basic demo code?

@Clancys74
Copy link
Author

Clancys74 commented Dec 6, 2018

To be really honest with you, me and my colleagues have already patched this particular SDK everywhere and i really don't want to redo the same thing once again. So i'll stick to this SDK and if i encounter unresolvable problems or too much of them, i'll try something else. Back to the problem now:

I have investigated my problem a liitle bit further and it looks like the UDP frames are sent on the ESP server (the one he creates) The following images is a snip from wireshark, i was connected to the Esp server to see those:
image

Is it possible to have an UDP connection on the ESP server and on the upper connection (an other ESP or the router)?
To explain, i have to listen to a specific port (49743) where a frame is sent but i don't know from where this frame will come. It is sent by an ESP somewhere else on the network.
Other question: Can an UDP frame propagate through each ESP when they are repeater? I mean that if the frame is coming on the ESP server side, is it sent back through to the upper portion on the network and vice-versa? Or do i have to resent it myself each time?

@Clancys74
Copy link
Author

UPDATE:
In the comment above, i have set the wifi as STATION and AP as i want to connect to the server but also transmit my network to others ESP (not implemented yet but it's scheduled).
Now, i have tested to remove the AP part meaning that my ESP is now only connecting to the router as a STATION. This way, i was able to broadcast data in the router network but not receive data in this same network. I still have absolutely no idea of what is happening, i am kind of sure that it is a change in one of the deepest part of the LwIP protocol now and i hope that i can change that to be as it was working before.

@martin-ger
Copy link
Owner

martin-ger commented Dec 6, 2018

I am not sure, whether this has anything to do with your problem (a UDP packet to address 0.0.0.0 is somewhat strange), but I thing I found and probably solved a problem of the lib with SDK 2.2:
Please recompile the lib with the mem.h header from the SDK: ESP8266_NONOS_SDK-2.2.0-28-g89920dc/third_party/include/lwip/mem.h and copy this to the include/lwip dir of my sources. Then recompile the esp-open-lwip.

Will do further tests on that and update it in the repo if it turns out to be stable...

@Clancys74
Copy link
Author

Clancys74 commented Dec 10, 2018

I have done some research and i always finish here (https://github.com/esp8266/Arduino/pull/5210/files/ed9a363136030d9284b6306be7b1b1ceeb20264d). This is a sdk for Arduino and after some research on the repository, i am finding two potentials files:

Have i found the correct one ? If yes, which one is it? If not, can you give me a link to the file or to the corresponding repository?

EDIT: I have done some more tests with the UDP using this tool ( https://packetsender.com/ ) and it looks like my esp can only receive packets directly sent to him but not packets that are broadcasted on the network, this is weird.

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