A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By Nora Mhd
#42950 Hi Guys
it's my first time dealing with ESP8266 and Arduino
i need to make a small network for my graduation proj. i have 3 nodes each one is PIR sensor + ESP-01+Arduino
and each node has to send the Data from PIR to the other 2 nodes , and one of them will be connected to PC to show the Data it send and receive
so i have a few questions please first which is easier ( with Arduinos or without it ) ?
and i flashed the ESPs with nodemcu firmware and i have lua loader , and i want to use UDP , i tried this simple code :

IP ="192.168.43.255"
port =9876
sRes=net.createServer(net.UDP)
sRes:on("receive",function(s,pl) print(pl) end)
sRes:listen(port)
sSend=net.createConnection(net.UDP)
sSend:connect(port, ip)
function sendData(id, data)
print("esp send udp data")
sSend:send(id.."##"..data)
end

but its not working , it only sends , but the other ESPs don't receive anything , what's wrong with it ?
or is there any way else i can try to make the ESP send and receive in one code whether its Arduino C code or lua ,, help please