that send to a database some information every 5 minutes.
6 seconds != 5 minutes. There is nothing in your code that suggests that stuff is sent every 5 minutes.
There is nothing in your post that defines how your WiFi device is connected to the Arduino. I don't think I've ever seen a Serial based WiFi device.