ESP01 send integer UDP

Hi, after i have searched a time, i haven´t find a result of my problem. I hope that i am right here.
I just want to send an integer Value from an ESP01 to my pc with UDP over Wifi. My Code:

//Wifi connection. The Ports and the IP is all right
//UDP connection. Is all right.

void loop()
if (Serial.available() > 0)
int a =;
udp.beginPacket(udp.remoteIP(), udp.remotePort());
udp.write(a); //Send one bit to PC

In this Code i receive on my computer just 1 bit.
Can someone help me??


Hi spycatcher2k,
i get the same result when i change it to " byte a =;".
Have you other ideas?

I have the result.

int value =;
char data[20];
sprintf(data, "Integer (d): %d ", value);

udp.beginPacket(udp.remoteIP(), udp.remotePort());

i hope it can help someone