I wanted to parse and read the packet like it is done in the UDPSendReceiveString example.
Don´t know exactly what you mean by method names. I send the message via Vector Canoe and I don´t use a shield but only a Transceiver.
parsePacket() and read() are method names, since they belong to a class.
I send the message via Vector Canoe
I have no idea what Vector Canoe is.
I don´t use a shield but only a Transceiver.
OK. I still don't have a clue about your hardware, or a way to find the library you are using, to see if there are pin conflicts that would explain your problem, since you are having a hard time doing it.
Are you failing to get a second packet, or are you failing to transmit that packet?
I don´t think that it´s a Hardware Problem because the first packet is received and sent back as it should.
When I send a second Packet the Rx LED blinks but there is no Response. So there must be an error in the code. It works again for one Packet when I unplug the Arduino and plug it.
You should only call 'read()' if 'packetSize' is larger than 0.
(That's how the example you refer to does it.)
void loop()
{
// if there's data available, read a packet
int packetSize = Udp.parsePacket();
if (packetSize)
{
Serial.print("Received packet of size ");
Serial.println(packetSize);
Serial.print("From ");
IPAddress remote = Udp.remoteIP();
for (int i = 0; i < 4; i++)
{
Serial.print(remote[i], DEC);
if (i < 3)
{
Serial.print(".");
}
}
Serial.print(", port ");
Serial.println(Udp.remotePort());
// read the packet into packetBufffer
Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
Serial.println("Contents:");
Serial.println(packetBuffer);
// send a reply to the IP address and port that sent us the packet we received
Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
Udp.write(ReplyBuffer);
Udp.endPacket();
}
delay(10);
}
Okay my mistake was in Udp.read(packetBuffer,packetSize) when I put in UDP_TX_PACKET_MAX_SIZE instead of packetSize it works fine but the size of the packets I send is more limited. A quick Explanation for this behavior would be nice.