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

User avatar
By JPM06
#92954 Hi, all,

I meet a problem using an ESP8266 in SoftAP mode.

I want to receive UDP packets on the AP size, and send other UDP packets on the station size (after some processing).

Using examples found on the net, I have written a small program, and my ESP-01 now connecs as both a station and an access point, with correct addresses.

But I dont know what to do next: in some programs I have written, I use the "readPacket" and "sendPacket" functions to receive and send UDP packets, but how can I distinguish between both networks? (f.i. send a packet on one network and not the other).

I have tried to duplicate the instanciation of UDP (WiFiUDP udp) but I get an error messages from the IDE.

Could you please help me? Thanks!
User avatar
By JurajA
#92978 the two network interfaces (STA and AP) have a different IP address range. LwIP TCP/IP stack of the esp8266 arduino core will use the right interface based on the remote IP you use to send the UDP message
User avatar
By JPM06
#92980 Nice, thank you!
But how can I define the address range for each interface? At this point in time I only define the 8266 own addresses on each network.