There are 10 CR1000 datalogger stations that we use with GSM modem.
We reset the Dataloggers every 24 hours in case the connection is lost due to a jammer or other signal interrupting device.
Thanks to GSM modems, we can access the data remotely. But at the end of the 24 hour period, when the devices are automatically reset, it do not receive IP again.
We cannot connect to the station again without going there and manually turning the CR1000 off and on. When we start it manually, the station receives IP again, but at the end of the 24 hour cycle, we encounter the same problem again.
I am sharing the modem codes below. If anyone has similar experiences, I would like to ask for your support to solve the problem. Thanks in advance.
Modem Codes:
Public GSMSTR As String * 50
Public Modem_reset
Sub GSM_AC 
           SW12 (1 ) 
EndSub 
Sub GSM_KAPA 
           SW12 (0) 
EndSub
Sub modem_init  
   PPPClose  
   SerialOpen (ComRS232,115200,0,0,500)  
   Call gsm_kapa  
   Delay (0,2,Sec)  
   Call gsm_ac  
   Delay (0,5,Sec) 
          GSMSTR="ATS0=2"+CHR (13)+CHR (10)  
   Delay (0,2,Sec)  
   SerialOut (ComRS232,GSMSTR,"",0,0) 
          GSMSTR="AT&C0"+CHR (13)+CHR (10)  
   Delay (0,2,Sec) 
          SerialOut (ComRS232,GSMSTR,"",0,0) 
          Delay (0,2,Sec) 
          GSMSTR="AT&W"+CHR (13)+CHR (10) 
          SerialOut (ComRS232,GSMSTR,"",0,0) 
          Delay (0,2,Sec) 
          SerialClose (ComRS232) 
          Delay (0,2,Sec)
 SetSetting("pppinterface",ComRS232)     SetSetting("pppusername","900000000000@xxxx.xxxx")   SetSetting("ppppassword","*********")
 ## SetSetting("BaudRateComRS232",115200)  
  SetSetting("pppDial","*99**1#")  
EndSub
  Sub modem_init2  
  PPPClose  
  SerialOpen (ComRS232,115200,0,0,10000)  
  Call gsm_kapa  
  Delay (0,2,Sec)  
  Call gsm_ac  
  Delay (0,5,Sec) 
         GSMSTR="AT+IPR=115200"+CHR (13)+CHR (10)  
  SerialOut (ComRS232,GSMSTR,"",0,0)  
  Delay (0,2,Sec)       GSMSTR="AT+CGDCONT=1,"+CHR$(34)+"IP"+CHR$(34)+","+CHR$(34)+APN+CHR$(34)+CHR$(13)+CHR$(10) 
         SerialOut (ComRS232,GSMSTR,"",0,0)  
  Delay (0,2,Sec)  
         GSMSTR="ATS0=2"+CHR (13)+CHR (10)  
  Delay (0,2,Sec)  
  SerialOut (ComRS232,GSMSTR,"",0,0) 
          GSMSTR="AT&C0"+CHR (13)+CHR (10)  
  Delay (0,2,Sec) 
          SerialOut (ComRS232,GSMSTR,"",0,0) 
          Delay (0,2,Sec) 
          GSMSTR="AT&W"+CHR (13)+CHR (10) 
          SerialOut (ComRS232,GSMSTR,"",0,0) 
          Delay (0,2,Sec) 
          SerialClose (ComRS232)
EndSub 
BeginProg     
SW12 (1)     
          Call Modem_init
 
                 If IfTime (1430,1440,Min) Then Call gsm_kapa 
                 If IfTime (1431,1440,Min) Then Call gsm_ac
NextScan  
  SlowSequence
  Scan (10,Sec,3,0)  
          If IfTime (5,1440,Min) OR Modem_reset=1 Then       
              Call modem_init2      
              Modem_reset=0    
              EndIf
NextScan
EndProg
This post is under review.