Page 1 of 1

ESP32 as access point not routing traffic

Posted: Tue Jan 08, 2019 10:30 am
by q-flyche
Hi There,
this is my first post. I tried search but I am either not looking in the right corner or I am the first one running in that "issue"!?
I've got an heltec board with an ESP32 on it. I flashed the latest micropython build on it and got a REPL prompt. Great.
I set up the ESP32 as access point using the following code:

Code: Select all

import network
ap = network.WLAN(network.AP_IF)
ap.active(True)
ap.config(essid='my-ssid', authmode=network.AUTH_WPA_WPA2_PSK, password='my-password')
ap.ifconfig(('192.168.84.1', '255.255.255.0', '192.168.84.1', '192.168.84.1')) # ip, netmask, gateway, dns
This is working fine. I can connect to the access point using my smart phone, computer whatever. Assume I have a Raspberry Pi added to the network running a simple webserver and my computer:

Code: Select all

esp32 (as access point) = 192.168.84.1 
raspberry = 192.168.84.2 
computer = 192.168.84.3
From my computer, I can ping the esp32. But I cannot ping the the Raspberry Pi. Neither can I make a HTTP GET request from computer -> Raspberry Pi. But I can make a HTTP GET request from esp32 -> Raspberry Pi.
I assume that the access point mode does not implement a routing? If not, is there a way to accomplish this?
Thanks

Re: ESP32 as access point not routing traffic

Posted: Tue Jan 08, 2019 12:22 pm
by kevinkk525
My guess would be that the AP is not intended to replace a router but is just a means of communicating with the device itself.

Re: ESP32 as access point not routing traffic

Posted: Tue Jan 08, 2019 3:11 pm
by q-flyche
Hm probably...
My problem is on the board I am practically walking in the dark. Is there a way to query the DHCP server or any other prosibility to find out which clients are connected and get their IP addresses? using ap.status("station") just returns me the mac addesses.
Thanks

Re: ESP32 as access point not routing traffic

Posted: Wed Jan 09, 2019 6:39 am
by kevinkk525
I don't know. Maybe on loboris port it is possible, at least for the ftp module it is. Haven't done anything similar on the esp32 yet.

Re: ESP32 as access point not routing traffic

Posted: Thu Jan 10, 2019 6:15 pm
by q-flyche
Ok, got it now running as expected.
I had the problem that there was another client connected I was not aware of which clashed the arp table of the access point I guess.

However, I still don't understand why I can't retrieve the client IPs just mac addresses. There are issues open concerning this for quiet a while now. It appears that loboris fork includes that feature. I will go try that fork.

I ran into the next issue - it seems when using sockets and the target is unreachable, the socket cannot be used anymore and a new instance has to be created. I opened an issue, but perhaps I am misunderstanding something.

Re: ESP32 as access point not routing traffic

Posted: Wed Jun 19, 2019 8:27 pm
by jdcrunchman
Thank you very much for this post.... I've been so looking for how to make my esp32 be a hot spot.

John