HID Keyboard serial listening issue

Hello,

After supplying power through the VIN, i need to connect and read strings from a keyboard through the USB and send the read data to an MQTT broker through WIFI.

Whenever i try a while loop for serial monitoring or using if serial.available the unit just freeze. any idea how to solve this?

Many thanks.

You need to post your code & schematic / wiring set up.

No one can help without that.