Samsung devices going offline randomly

Hey guys. So i have a few samsung devices that randomly go offline, like my smartthings tv, and i want to know, if there’s some command that i could send to the device to stop that. Like refresh or ping every so often. And how would i write it?