Server UDP extension (Paid Extension)

Buenas Tardes comparto que he creado la extensión de UDP server

esta extension puede abrir un puerto y recibir mensajes UDP de forma asincrona desde arduino , esp8266 y dispositivos IOT , pc movil.

solo debes compartir la ip de tu dispositivo y el puerto que esta habilitado para recibir los mensajes.
Programa de pruebas packetsender


Paid 15 USD including support

muchas gracias por apoyar mis extensiones






Hello Andre!

Your UDP server makes serious mistakes.
After 24 hours of troubleshooting I have concrete results.

The server responds correctly when the TCPIP address is called.
As expected, your UDP server responds by calling the address

Big mistake:
If you send a call from your extension to all other UDP stations (XXX.XXX.XXX.255), the extension sends the destination address and the send port as response address and port.
If you set Broatcast to false, the extension does not send anything.

Slight error:
The extension reacts, even if you separate send and receive ports, to your own sent UDP messages, if you use the IP “XXX.XXX.XXX.255”.

Please make sure to follow the protocol when composing the send string!

Thus, the expansion is worthless.

I know that it does not work for you economically. Therefore, I do not ask for the money back.
However, I am forced to make this mistake public. As no operation is possible.

Sincerely, Johannes Schreiner

1 Like

Thank you very much for your review, please can you indicate an example where you can understand the configuration you want to make

please if you can check this too to identify faults to correct them too

Hello, I’m referring to an example like these where I can read the code

Servus Andres!
Enjoy me, that you take up the suggestions. A powerful UPD Toll for the App Inventor is certainly a win for many. Unfortunately, I can hardly help you, because I have no idea about Java. I work with microcontolers. There is C or C ++ going on. Although many things are very peculiar, since you usually have to spend more time with storage.

I can act as a beta tester for you.
Since I have basically paid for the software, I really only have an interest in you creating a extension working great.

I tested your client this afternoon.
For 5 hours my app and my ESP8266 were connected. Distance: 110 m through 3 walls. Clock rate 250 ms.
Lost Packages 36. What I think is a pretty good cut on UDP?
Unfortunately, it also has problems responding via XXX.XXX.XXX.255.
For both tools, you need to allow the input port to be configured independent of the output port and to have the header written correctly.

As soon as the connection is established the Client UPD Extension works very sable.

Greetings from Austria, Johannes

hello these 2 classes are those used in the protocol please if you can review the documentation I have indicated me which are the correct methods to build the header and that is functional


Can we start with the client to clarify what it’s all about?

You have to read out the IP address of the Hanyd. WiFi mind you!
You need that later to make it clear to the class who (I) is sending.
We can not change these. So a “set” does not make sense here.

Then we open a receiver. It’s always online and waiting for events. A simple client application does not need access to open or shit.

public class UDPServer
public static void main (String [] args) throws IOException
DatagramSocket socket = new DatagramSocket (*****);

The top of the stars must be set by the user of your extension!
This is the port we open. To my knowledge

Then we wait for the message
That should look like that in wtwas. Unfortunately no Java can not.

while (true)
  // wait on request

  DatagramPacket packet = new DatagramPacket (new byte [1024], 1024);
  socket.receive (packet);

  // read receiver

  InetAddress address = packet.getAddress ();
  int port = packet.getPort ();
  int len ​​= packet.getLength ();
  byte [] data = packet.getData ();

From “packet.getLength ();” and “packet.getData ();” then you have to send the message as a string to the extension. That already worked well.
“Packet.getPort ();” and “packet.getAddress ();” mus be offered to the user, because otherwise he will not know where his possible answer should be spoken.
!!! These details are time critical. !!!
You have to hang her on that one event.
They belong to the one message.
You have no guarantee that in the meantime a new package does not arrive during processing. Maybe create an Arrey with a buffer?
5 to 10 messages should be enough.
Then maybe close the server and open it again, if the buffer has room in your Arrey. The “programmer” will therefore hardly want to worry or can. (See broadcast!)

This is the event that should be used in the “programs” in the App Inventor.
This mus must now read and process. Whatever he does with it?

The recipient usually stays always open.


InetAddress ia = ****************. GetByName ("localhost");

while (true)
  String s = MESSAGE
  byte [] raw = s.getBytes ();

  DatagramPacket packet = new DatagramPacket (raw, raw.length, ia, *****);

  DatagramSocket dSocket = new DatagramSocket ();

  dSocket.send (packet);

  Thread.sleep (1000);


For the stars in turn the port is specified, which is open at the recipient.
As well as the IP address of the recipient.
Where you see localhost, the open IP address of your own recipient must be specified!
In the case of broadcast this triggers a collapse of the network because you are using the recipient’s address here.

If that’s zero, just ignore it.
Much is not waiting for an answer. Much about UPD just goes out without waiting for an answer.

You can just leave the false / true away.
You read the recipient’s address and notice the last group of the IP.
If it’s 255, it’s broadcast. Yue make the “true” then just yourself.

Note that Java may have 2 IP address as localhost!
How these differ ???
In any case, we want that from the WiFi, because over the Interent of our data provider via UDP not much will go what we do.

Hope you understand my bad English?
Otherwise just ask again.

Regards Johannes

hello Andres Cotes
I paid € 13 (USD 15) for UDP extension server when and where I can download it
thank you

Hi I already sent files and examples

Saludos amigo quiero saber si estan ok tus extensiones para poder ayudarte con el pago pero son funcionales o no ?

Si sabes trabajar con el protocolo funsiona está la versión cliente free

El link de Paypal es

Hi Andres ,
I’d like to buy your extension but I need to know a thing before.
I have to send some bytes to my UDP clients including some 0 bytes (00 in hex, first char of ASCII table), I was not able to do it with your UDP client and ASCII to char extension.
Is it possible with this extension to send Hex messages?
And will I be able to retrieve all connected clients IP that sending status messages to the server?

With this Extension I fits all my need with UDP communication.
It allows you even to send and receive Data in binary mode so using arrays of integer or HEX value instead of a text message.

Please create the corresponding thread and teach it to the user

hello @Andres_Cotes
I paid (USD 15) for UDP extension server when and where I can download it
thank you

hello Andres Cotes
Could you decompress the password

1 Like