Sending UDP to the Wifi link from an Arduino

LightwaveRF Communi… > Forum > LightwaveRF Hackers > Sending UDP to the…

LightwaveRF Community: Welcome Forums LightwaveRF Hackers Sending UDP to the Wifi link from an Arduino

This topic contains 2 replies, has 3 voices, and was last updated by  pauly 5 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4149
     velkrosmaak says:

    velkrosmaak
    Participant

    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:

    <code>

    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

    Udp.write(“000!R1D1F1|”);

    Udp.endPacket();

    }

    </code>

    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!

    #4150
     Chris says:

    Chris
    Key Master

    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 http://cpmills.com/ http://lightwaverfcommunity.org.uk
    #4419
     pauly says:

    pauly
    Participant

    yes working here, not using 000 https://github.com/pauly/robot-butler/

    12 rooms automated, time to stop now... API + more at https://github.com/pauly/lightwaverf
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.