As the title says... Chat on...

User avatar
By KA1WPM
#28867 Hi Folks,

I just started playing with the Adafruit ESP-12 breakout board about 3 days ago. It is loaded with NodeMCU 0.9.5 build 20150318 / Lua 5.1.4.

I have written a listener (server) function with the board in station mode. It listens for certain UDP packets and responds accordingly. It's working, and it handles UDP packets that are addressed to the Broadcast address. I've tested it by sending the packets into the network from my workstation.

The problem is when the listener board talks to another ESP-12 configured as an AP, it isn't responding to the same packets when I broadcast them from the AP board. If I send the packet to the specific IP address, the listener is responding correctly. The server IP is 192.168.4.2, and the broadcast address is 192.168.4.255.

So my question is, can send a broadcast packet from the AP or is something prohibiting that?

Thanks,
-- Dana, KA1WPM
User avatar
By Keith Richardson
#29553 I've been playing with a UDP client with the idea of sending data at fixed intervals. The code below works and broadcasts a single UDP packet

Code: Select alli = 5
status = wifi.sta.status()
print("Status: " .. status)
srv=net.createConnection(net.UDP,0)
srv:connect(9050, "192.168.1.255")
srv:send("Testing: " .. i)
print("Testing: " .. i)
srv:close()
tmr.delay(1000000)


However, if I try to enclose it in a loop:-

Code: Select allfor i = 0, 10 do
    status = wifi.sta.status()
    print("Status: " .. status)
    srv=net.createConnection(net.UDP,0)
    srv:connect(9050, "192.168.1.255")
    srv:send("Testing: " .. i)
    print("Testing: " .. i)
    srv:close()
    tmr.delay(1000000)
end


The printout is as expected but no packets are sent.I am monitoring the LAN with Wireshark so it isn't as if there is a problem at the server end. Very strange. :(