Upgrading firmware with FOTA fails

did you explicitly select the -G on the server?

Yes.

I am not sure what is happening but the device is no longer able to communicate with the server even though I got OK after AT+WDSS=1,1.

After setting at+wdsi=8191, I got the following:
+WDSI: 4
+WDSI: 7