ArduServer and UDP Receiver Sender combined

SimonWakley

Active member
Hi,

I have a program running on a Teensy 4.1 that receives a packet over UDP and re-sends it to a number of IPs and Ports on an interrupt.

I can configure the IPs and Ports over Serial but it is a little clunky, I figured I could use ArduServer and write a simple form page that could allow the user to access the data and change the destination I/Ps and Ports.

I basically copied the ArduServer code into my program but I do not get anything on my web page, it just says 192.168.1.221 didn't send any data. My server code is in my loop()

// If the user is trying to configure over a browser+ handle that!
client = server.available();

if (client)
{
Serial.print("CL.");
if (client.connected())
{
Serial.print("CN.");
if (client.available())
{
Serial.print("CA.");
ProcessClientRequest();
}
}
}

delay(30);

} // End of loop()

Could it be that the UDP server is conflicting with the ArduServer. ?
I do get: CL.CN.CA.Got string: GET / HTTP/1.1
So the client was created, was connected and was available and received the expected string, but the client.println did not get back through even though the (almost) identical code in ArduServer does work!

I will keep digging but any suggestions? Configuring over the serial port is super easy for me but not the average user... Many devices have a "web page" !

Server.ino which contains ProcessClientRequest() is attached.

Thanks
Simon
 

Attachments

  • Server.ino
    5.3 KB · Views: 23
Back
Top