Sending UDP to the Wifi link from an Arduino

  • January 18, 2013 at 01:21 #4149

    Hi there,

    The title says it all really – i’m trying to send a UDP string from an arduino with an ethernet shield.

    My code for the string is:


    if (livingrm < 200)


    Serial.println(“Light too dark”);

    Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());

    //check this as I have made it up on a stoned roll





    I’m just not getting anything at the moment. No lights, and no prompt on the wifilink.

    Has anybody got this working successfully?

    Thanks in advance! Glad I found this forum!

    January 18, 2013 at 09:42 #4150

    Try using a number other than 000. I thought I read somewhere that 000 doesn’t work – at least not for the initial packet. I believe the only purpose of this number is to give you some reference that the packet has been received – the Wi-Fi link will broadcast back with an OK and the same number.

    In all the code I have written, I’ve used a random number and it seems to work fine.

    Since the packet is a broadcast, you should be able to see it on all other devices connected to the network. Have you tried running Wireshark on a computer to check that the packets are being sent to the network?

    Chris Mills
    Founder and Editor - LightwaveRF Community

    January 29, 2013 at 22:45 #4419

    yes working here, not using 000

    12 rooms automated, time to stop now... API + more at

You must be logged in to reply to this topic.