I have an Arduino Mega ADK board and have stacked WiFi shield, GSM shield 2 and RoyalTek GPS shield on it. I need to send GPS coordinates to my server, preferably using wifi if in range else gprs. When I run sample examples to use individual shields, it works perfectly fine. But when I want to use both GSM and Wifi together none of them sends data.
PROBLEM 1:
Initially I don't initialize GSM and only connect through wifi shield and it works perfect. The time I switch off my wifi network, my program tries to switch to GSM. It initializes GSM, gsm.begin connects properly, but gprs.attachGPRS never connects and stays in connecting mode only.
PROBLEM 2:
If GPRS does not connect in few attempts, I search for Wifi again. If wifi is detected, it connects to wifi network successfully. But when it comes to connect to the URL to send my request, wificlient.connect(server,port) method fails.