Please make sure your WiFi network is configured in a way that allows gateways to communicate with Kontakt.io servers. Detailed requirements are available in this article: Internet access requirements for Kontakt.io Gateways.
Pending configuration with incorrect WiFi settings
It's quite common that someone tries to manually configure a gateway by editing the config.txt file. After providing a valid configuration and WiFi credentials this way, gateway reboots, connects to a WiFi network, but drops the connections few seconds after that (its LED turns Orange).
This might be caused by a pending configuration for that gateway being kept on Kontakt.io backend. It's possible that someone had initially tried to create a WiFi configuration for a Gateway via Kontakt.io Panel, but since gateway didn't have any Internet connectivity set up, it wasn't able to download this pending config.
Now, after configuring the gateway via the config.txt file, it has Internet connectivity, but one of the first thing it does is to download and apply that pending configuration, that might no longer valid. Because of that, if it looks like gateway connects properly to your WiFi network and Interned (LED is Green), but it drops it really quickly, please make sure there are no pending configurations for this Gateway on Kontakt.io backend and then try to configure it once again.