The invention discloses a gateway WiFi failover method, device, equipment, and a medium. The method comprises the steps of monitoring a connection state of a gateway and a server, when monitoring thatthe network connection is abnormal, replacing the current network configuration file with a target configuration file of the target AP hotspot, wherein the target AP hotspot is any other AP hotspot except the AP hotspot which cannot be normally connected with the gateway at present, restarting the network service, and judging whether the connection between the gateway and the server is re-established or not, and if the connection between the gateway and the server is not re-established, skipping to the step of replacing the current network configuration file with the target configuration fileof the target AP hotspot. Thus, network switching is automatically realized under multiple AP hotspots, the network problem can be repaired in time, the stability of data uploading of the gateway isimproved, and frequent manual configuration is avoided.