harlequin-tech / WiFlyHQ

WiFly RN-XV Arduino Library
Other
110 stars 68 forks source link

ERR 2few Args with sendto() #36

Closed mrst0n3 closed 4 years ago

mrst0n3 commented 10 years ago

Hello, first a thanks for making this library, When i tried to copy you udpclientexample with the sendto method instead of the print() in your example, i get the Message ERR 2few Args whenever the Wifly Board sends a Message. The UDP Packet still gets send and i can receive it, but it bugs me as to why this error should even occur. Here's the code im using:

uint32_t lastSend = 0;
uint32_t count=0;

void loop()
{
    if ((millis() - lastSend) > 1000) {
        count++;
    Serial.print("Sending message ");
    Serial.println(count);
        wifly.sendto("Hello", "192.168.1.112" , 1337);

    lastSend = millis();
    }
}

The setup() is the same as in the udpclient example with the exception that i commented out the line:

wifly.setHost("192.168.1.112", 1337);   // Send UPD packets to this server and port

And this is the output i'm getting on my Serial Monitor:

Sending message 1
ERR: 2few Args
Sending message 2
ERR: 2few Args

So as i was saying the packets still get send but its bugging me as to what might cause this error message, which is one the WiflyBoard itself is sending if my research is correct

anshul119 commented 9 years ago

i get the same error on using sentto() function but in my case it doesn't even do its job.