Hi @mohanbp
check this: Device not showing online - #2 by Stefan_Witschel
and this: Device connection and status - #2 by Reuben_Miller2
Basically you need to remove the X-Cumulocity-Application-Key
header from the request or sending additional empty PUT requests (without the header) to update the status manually.