Interactive UDP send receive string

Hello all knowing Forum,

My set up is a Mega 2560 with the EtherShieldSD. I have the EtherShieldSD hard wired to my WiFi Router. My Iphone has a UDP test tool on it and it is WiFi tethered to my LAN. I am using the Arduino 22 IDE. The Router is a Linksys wrt54g with open source DDWRT Bin files. It is operating in Client-Bridge mode to my main router which is a stock Linksys.

The next step is to get the Iphone off my LAN, but it needs to be solid before I start worrying about NAT traversal!

** **udp.send("Hello World", remoteIp, remotePort );   // the message to send** **
What would be the line of code to send a message that is not 'pre prepared" from the Serial Monitor???
I have it working so I can SEND any message from my Iphone UDP tool TO the Arduino… but typing into the Serial Monitor to send a Message BACK to the Iphone UDP tool, I get nada…
Thank you!
The whole sketch for reference- a slightly modified version of the original UDPsendreceivestring:
```
*/
 UDPSendReceive.pde:
This sketch receives UDP message strings, prints them to the serial port
and sends an “acknowledge” string back to the sender

A Processing sketch is included at the end of file that can be used to send
and received messages for testing with a computer.

created feb 15 2011
by Will Foster
based on the original

created 21 Aug 2010
by Michael Margolis

This code is in the public domain.
*/

#include <SPI.h>         // needed for Arduino versions later than 0018
#include <Ethernet.h>
#include <Udp.h>         // UDP library from: bjoern@cs.stanford.edu 12/30/2008

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac = { 0x90, 0xa2, 0xda, 0x00, 0x1d, 0xb8 };
byte ip = { 10, 10 , 10 , 122 };

unsigned int localPort = 8888;      // local port to listen on

// the next two variables are set when a packet is received
byte remoteIp[4];        // holds received packet’s originating IP
unsigned int remotePort; // holds received packet’s originating port

// buffers for receiving and sending data
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,
char  ReplyBuffer = “acknowledged”;       // a string to send back

void setup() {
 // start the Ethernet and UDP:
 Ethernet.begin(mac,ip);
 Udp.begin(localPort);

Serial.begin(9600);
}

void loop() {
 
 char packetBuffer = "                                     "; //Clear the buffers so as not to leave text behind from one messag to the next

// if there’s data available, read a packet
 int packetSize = Udp.available(); // note that this includes the UDP header
 if(packetSize)
 {
   packetSize = packetSize - 8;      // subtract the 8 byte header
   Serial.print("Received packet of size ");
   Serial.println(packetSize);

// read the packet into packetBufffer and get the senders IP addr and port number
   Udp.readPacket(packetBuffer,UDP_TX_PACKET_MAX_SIZE, remoteIp, remotePort);
   Serial.println(“Contents:”);
   Serial.println(packetBuffer);

Udp.sendPacket( ReplyBuffer, remoteIp, remotePort);
 }
 delay(10);
}**
```

I try to keep my UDP messages multiples of EIGHT (8) bytes -- try that.