Am currently experimenting with ESPs in a kind of tree topology network (where each ESP is both a client and an AP). As an early proof-of-concept I was trying to get them to talk to one another using simple UDP sockets. Unfortunately I've hit something of a snag and was wondering if it's a bug/limitation of the library or whether I'm not doing something properly.
The setup:
I have 1 ESP as an AP broadcasting a 192.168.4.x network. It's STA_IF is inactive. We'll call this the 'parent'
I have 1 ESP as a client connected to that network (its address is 192.168.4.2). We'll call this the 'child'
I created a socket on both the parent and the child with
Code: Select all
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
While I can use s.sendto() to send FROM the child TO the parent, I cannot send from the parent to the child.
Child:
Code: Select all
s.sendto("hello!", ('192.168.4.1', 50000))
Parent:
Code: Select all
s.sendto("hello!", ('192.168.4.2', 50000))
At this point I thought it best to post here, see what the experts suggest (especially as I'm not an expert in network programming in any way).
(As clarification, I did also test with the parent STA_IF active and disconnected and active and connected to another network)