Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Unable to call wavecom modem from server


WilsonRimbit Mar 20, 2013 12:44 AM

Hi Sir, there any problem with this program, we cannot call modem from our Trail unit server.
Modem: Wavecom (GSM)
Datalogger: CR850

' == Declare Constants ==
Const ScanInt = 5
Const SlowScanInt= 30
Const LogInt = 15
Const start_time = 480
Const on_time = 600

'== Declare Public Variables ==
PreserveVariables
Public Batt_volt
Public OTTWaterLevel
Public SDIRead As Boolean

' == Define Data Tables ==
DataTable (MainData_R&D,1,-1)
DataInterval (0,LogInt,min,1)
Sample (1,Batt_volt,FP2)
Sample (1,OTTWaterLevel,FP2)
EndTable

' == Define Custom Menu==
DisplayMenu ("MainData_R&D",-4)

SubMenu ("SDI12 Read")
MenuItem ("Read SDI12?",SDIRead)
MenuPick (True)
DisplayValue ("OTTWaterLevel",OTTWaterLevel)
EndSubMenu

EndMenu

Sub Setup_Modem

SerialOpen (COMRS232,115200,0,0,1000)
SerialFlush (COMRS232)
SerialOut (COMRS232,"ATS0=2"+CHR(13),"ok",2,010)
SerialClose (COMRS232)
EndSub

' Main Program
BeginProg
SetStatus ("BaudrateRS232","115200")
SetStatus("RS232Power","True")
Call Setup_Modem
SW12(true)

Scan (ScanInt,Sec,0,0)

Battery (Batt_volt)

If IfTime(LogInt-1,LogInt,min) Then
SDIRead=true
EndIf

' == Modem on off time ==
If TimeIntoInterval(start_time,1440,min) Then
SW12(1)
EndIf
If TimeIntoInterval(start_time + on_time,1440,min) Then
SW12(0)
EndIf

CallTable MainData_R&D

NextScan

SlowSequence

Scan(SlowScanInt,Sec,0,0)

If SDIRead =true Then
SDI12Recorder (OTTWaterLevel,1,0,"M!",1.0,0)
Round(OTTWaterLevel,3)
SDIRead =False
EndIf

Next Scan

EndProg


aps Mar 20, 2013 09:24 AM

The program is basically OK, except for the "ok" should be an "OK" in your setup code. However, that should not stop this working.

Can I suggest you:

a) check the cable - it needs to be a null modem cable.
b) turn off handshaking in the modem
c) check you have the correct DATA number for the SIM card in the modem. This will normally be a separate number to the standard phone number associated with the SIM card.
d) to check the data number, simply dial the number from a phone handset and listen. If it is correct and the SIM card is setup to answer analogue phone calls you should hear analogue modem (a "beeping, buzzing and warbling"). If you have it set up for GSM to GSM calls only you would normally hear a continuous tone. If you get an onobtainable or engaged tone you probably have the wrong number.
e) check the modem baud rate is set to 115200 (most new non-CS modems will be)

Log in or register to post/reply in the forum.