MC60 can't open MQTT after 28 times opening

Hi there

I use MC60 (with MC60CAR01A15 firmware) in Open-CPU mode with SDK1.8 and send data to server with MQTT protocol in simple mode and not config SSL. I continuous with a 30sec timer active GPRS and open MQTT, then send data to server and disconnect GPRS. everything is fine but after 28 times that i execute this process, MQTT can’t open and URC return 4 that means (Failed to parse domain name). I should Reset the module to solving this problem for opening MQTT. I test the MQTT-server and everything is OK.

  1. How can i solved this problem and open MQTT after 28 times without reset Module? (main question and problem)

  2. In general, Is there a way to change definition the default status of every pin after system is powered on? (For example, I need one of the GPIOs to be in the pull-down status when the module is turned on, while it is normally in the pull-up position when the module is turned on)

you can see my program Log in below:
after a while can’t open MQTT and return number 4 and i should reset the module.

[2021-12-12_11:47:13:087]//<Network State:cgreg = 1
[2021-12-12_11:47:13:087]START SEND TO SERVER
[2021-12-12_11:47:13:120]<-- Set GPRS APN, ret=0 -->
[2021-12-12_11:47:13:867]<-- Open PDP context, ret=0 -->
[2021-12-12_11:47:14:965]<-- stack Timer_handler, param:7 -->
[2021-12-12_11:47:14:984]//<Select version 3.1.1 successfully
[2021-12-12_11:47:15:971]<-- stack Timer_handler, param:8 -->
[2021-12-12_11:47:15:991]//<Start opening a MQTT client
[2021-12-12_11:47:16:973]<-- stack Timer_handler, param:9 -->
[2021-12-12_11:47:17:911]Received URC: type: 11
[2021-12-12_11:47:17:911]//<Open a MQTT client successfully
[2021-12-12_11:47:17:970]<-- stack Timer_handler, param:0 -->
[2021-12-12_11:47:17:982]//<Start connect to MQTT server
[2021-12-12_11:47:18:170]Received URC: type: 12
[2021-12-12_11:47:18:170]//<Connect to MQTT server successfully
[2021-12-12_11:47:18:976]<-- stack Timer_handler, param:1 -->
[2021-12-12_11:47:18:994]//<Start subscribe topic
[2021-12-12_11:47:19:292]Received URC: type: 13
[2021-12-12_11:47:19:292]//<Subscribe topics successfully
[2021-12-12_11:47:19:983]<-- stack Timer_handler, param:2 -->
[2021-12-12_11:47:20:397]RMC Data:
[2021-12-12_11:47:20:397]+QGNSSRD: $GNRMC,081721.321,V,0.00,0.00,121221,N*5D
[2021-12-12_11:47:20:423].
[2021-12-12_11:47:20:423]Data is Invalid.
[2021-12-12_11:47:20:998]<-- Getting module location… -->
[2021-12-12_11:47:21:017]<-- Getlocation succeed ret=0–>
[2021-12-12_11:47:21:017]<–Module location with BTS: latitude=35.517223, longitude=51.161007 -->
[2021-12-12_11:47:21:049]msg is----> {“latitude”:35.5172234,“longitude”:51.1610069}
[2021-12-12_11:47:21:049]//<Start publish a message to MQTT server
[2021-12-12_11:47:21:049]Received URC: type: 14
[2021-12-12_11:47:21:049]//<Publish messages to MQTT server successfully
[2021-12-12_11:47:22:022]<-- stack Timer_handler, param:3 -->
[2021-12-12_11:47:22:042]<-- Disconnecting Client from MQTT Server was Successful, retMQTT=0 -->
[2021-12-12_11:47:22:042]Received URC: type: 18
[2021-12-12_11:47:22:042]//<Disconnect MQTT successfully
[2021-12-12_11:47:23:030]<-- stack Timer_handler, param:4 -->
[2021-12-12_11:47:23:190]<-- Close PDP context, ret=0 -->
[2021-12-12_11:47:23:208]<-- Enter to SLEEP-Mode -->
[2021-12-12_11:47:34:199]<-- stack Timer_handler, param:6 -->
[2021-12-12_11:47:34:213]//<Network State:cgreg = 1
[2021-12-12_11:47:34:213]START SEND TO SERVER
[2021-12-12_11:47:34:255]<-- Set GPRS APN, ret=0 -->
[2021-12-12_11:47:34:687]<-- Open PDP context, ret=0 -->
[2021-12-12_11:47:35:788]<-- stack Timer_handler, param:7 -->
[2021-12-12_11:47:35:809]//<Select version 3.1.1 successfully
[2021-12-12_11:47:36:798]<-- stack Timer_handler, param:8 -->
[2021-12-12_11:47:36:812]//<Start opening a MQTT client
[2021-12-12_11:47:37:806]<-- stack Timer_handler, param:9 -->
[2021-12-12_11:47:38:802]<-- stack Timer_handler, param:0 -->
[2021-12-12_11:47:39:798]<-- stack Timer_handler, param:1 -->
[2021-12-12_11:47:40:795]<-- stack Timer_handler, param:2 -->
[2021-12-12_11:47:41:792]<-- stack Timer_handler, param:3 -->
[2021-12-12_11:47:42:789]<-- stack Timer_handler, param:4 -->
[2021-12-12_11:47:43:786]<-- stack Timer_handler, param:5 -->
[2021-12-12_11:47:44:783]<-- stack Timer_handler, param:6 -->
[2021-12-12_11:47:45:779]<-- stack Timer_handler, param:7 -->
[2021-12-12_11:47:46:776]<-- stack Timer_handler, param:8 -->
[2021-12-12_11:47:47:772]<-- stack Timer_handler, param:9 -->
[2021-12-12_11:47:48:771]<-- stack Timer_handler, param:0 -->
[2021-12-12_11:47:49:767]<-- stack Timer_handler, param:1 -->
[2021-12-12_11:47:50:764]<-- stack Timer_handler, param:2 -->
[2021-12-12_11:47:50:801]Received URC: type: 11
[2021-12-12_11:47:50:801]//<Open a MQTT client failure,error = 4
[2021-12-12_11:47:51:761]<-- stack Timer_handler, param:3 -->
[2021-12-12_11:47:52:147]<-- Close PDP context, ret=0 -->
[2021-12-12_11:47:52:162]<-- Enter to SLEEP-Mode -->
[2021-12-12_11:48:03:154]<-- stack Timer_handler, param:5 -->
[2021-12-12_11:48:03:170]//<Network State:cgreg = 1
[2021-12-12_11:48:03:170]START SEND TO SERVER
[2021-12-12_11:48:03:170]<-- Set GPRS APN, ret=0 -->
[2021-12-12_11:48:03:668]<-- Open PDP context, ret=0 -->
[2021-12-12_11:48:04:767]<-- stack Timer_handler, param:6 -->
[2021-12-12_11:48:04:779]//<Select version 3.1.1 successfully
[2021-12-12_11:48:05:772]<-- stack Timer_handler, param:7 -->
[2021-12-12_11:48:05:793]//<Start opening a MQTT client
[2021-12-12_11:48:06:773]<-- stack Timer_handler, param:8 -->
[2021-12-12_11:48:07:770]<-- stack Timer_handler, param:9 -->
[2021-12-12_11:48:08:767]<-- stack Timer_handler, param:0 -->
[2021-12-12_11:48:09:764]<-- stack Timer_handler, param:1 -->
[2021-12-12_11:48:10:763]<-- stack Timer_handler, param:2 -->
[2021-12-12_11:48:11:759]<-- stack Timer_handler, param:3 -->
[2021-12-12_11:48:12:754]<-- stack Timer_handler, param:4 -->
[2021-12-12_11:48:13:751]<-- stack Timer_handler, param:5 -->
[2021-12-12_11:48:14:748]<-- stack Timer_handler, param:6 -->
[2021-12-12_11:48:15:745]<-- stack Timer_handler, param:7 -->
[2021-12-12_11:48:16:741]<-- stack Timer_handler, param:8 -->
[2021-12-12_11:48:17:738]<-- stack Timer_handler, param:9 -->
[2021-12-12_11:48:18:736]<-- stack Timer_handler, param:0 -->
[2021-12-12_11:48:19:737]<-- stack Timer_handler, param:1 -->
[2021-12-12_11:48:19:770]Received URC: type: 11
[2021-12-12_11:48:19:770]//<Open a MQTT client failure,error = 4
[2021-12-12_11:48:20:737]<-- stack Timer_handler, param:2 -->
[2021-12-12_11:48:21:107]<-- Close PDP context, ret=0 -->
[2021-12-12_11:48:21:122]<-- Enter to SLEEP-Mode -->