So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Hairyloon
#88073 I have tried the "Range Extender-NAPT" example in the ESP libraries for Arduino, and found that it works reasonably well, but I can't work out if it actually does what I think it obviously ought to do or not.

If we have two devices connected to the repeater, and those two devices want to connect to each other, then does the NAPT handle that all by itself, or does it address the question through the router that it is extending?

Sorry, I don't understand how these things actually work, and I imagine the answer is entirely obvious if you have the first clue about it... which I don't.
User avatar
By pangolin
#88074 Not such a silly question: REAL NAT routers often have an option called "isolate AP clients" which wil prevent two devices from talking to each other, but both able to "see" the internet of the far side of the router. Unticking it allows them to see all other devices connected to the router.

The answer is academic for any example running on ESP8266 since it has only one hardware WiFi channel. This means that both the far-side connection to the internet and the local AP to which your devices connect must both use that same one channel. This can lead to connection problems for AP clients.

See https://bbs.espressif.com/viewtopic.php?f=10&t=324

This fact alone renders any such code little more than a curiosity and certainly not a practical real-world app. So when you say "it works reasonably well" be aware that you have just been lucky. In a "busy" WiFi environment e.g. a block of flats where everyone has a strong router, you own router is likely to "channel hop" to get the least congested channel. If it does this all of your AP clients (max 4 - another serious limitation for real apps) which connected on the previous channel will get disconnected. (scenario 2 in the above link)

This can happen quite frequently, rendering the app impractical for any sensible work.

Always remember: Examples are just that - they are not production-quality code.
User avatar
By Hairyloon
#88081
pangolin wrote:Not such a silly question: REAL NAT routers often have an option called "isolate AP clients" which wil prevent two devices from talking to each other, but both able to "see" the internet of the far side of the router. Unticking it allows them to see all other devices connected to the router.

Sorry, but that doesn't actually answer the question. Does the ESP allow the devices connected to it to see each other and communicate, or would we have to add that option to enable it?
If thy can, and the purpose for the moment is to allow those devices to communicate with each other, then it may not matter if the connection to the internet router is broken.

So when you say "it works reasonably well" be aware that you have just been lucky. In a "busy" WiFi environment e.g. a block of flats where everyone has a strong router, you own router is likely to "channel hop" to get the least congested channel...

Not lucky, just working within the limitations of the device: in a quiet environment only to extend the signal from one router to one device (maybe two).
User avatar
By pangolin
#88085 "Sorry, but that doesn't actually answer the question. Does the ESP allow the devices connected to it to see each other and communicate, or would we have to add that option to enable it?"

The question is little to do with the ESP: it is 100% dependent on the code it runs. The code you mentioned is what I was commenting on. You are free to write whatever code your skill level allows, there is nothing inherent in the ESP architecture that prevents AP node cross-talk.

"it may not matter if the connection to the internet router is broken." then why use the device at all? just connect the nodes to the main router. You are over-complicating the issue.

"Not lucky". Yes, lucky. Unless you fully understand the issues covered in the the link, then you do not really know what the "limitations of the device" are and therefore you cannot accurately comment.

In your own words "Sorry, I don't understand how these things actually work, and I imagine the answer is entirely obvious if you have the first clue about it... which I don't."...in which case, you might learn more by listening to people who do, rather than contradicting them simply because you either don't like or don't understand the answers.

I reiterate: the code you mentioned is merely an example. Its is not practical for serious use and thus most of this is academic. I'm happy to help with specific code / design questions on any real world project you might have, but ESP8266 is not a suitable device for a reliable solution to NAT routing due to its single hardware channel. I urge you to read and digest the information in the previous link I sent you.