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.

CR1000 w/ cell modem (TCPOpen instruction doesn't work?)


District9RWIS Feb 7, 2014 05:04 PM

We have 2 remote sites with each having a CR1000 unit and a AT&T cell modem (CTEK Z4400) connected through serial (PPP connection) for communication back to our office computer (using Loggernet). Each site broadcasts a standard html website displaying the wind/temp info.

Each site also has a RF401 unit with yagi antenna pointing at each other to transfer data (wind info) back and forth(datalogger to datalogger) by using GetVariables instructions. The dataloggers has been flawless at grabbing these data from one another.

We have since installed a third site (CR1000 connected serially (PPP connection) to AT&T Cell Modem also) where there's no line of site to either of the other 2 locations (hence, no RF401 unit at 3rd site). We tried using the TCPOpen instructions to get the 3rd location datalogger to grab data from the other the 2 locations and vice versa but have been unsuccessful.

Below is the CRBasic program we've created for each site.
-------------------------------------------------------------

Public BattV,PTemp_C,PTemp_F,WS_mph,WindDir,AirTF,RH
Units BattV=Volts
Units PTemp_C=Deg C
Units PTemp_F=Deg F
Units WS_mph=miles/hour
Units WindDir=degrees
Units AirTF=Deg F
Units RH=%
'***Variables for comparison purposes
Public Gustcount,PortStat,RCStat
Public CSsampMPH,NBsampMPH,SBsampMPH,Gust(600),NBiGust(600),SBiGust(600)
Public CSavgWind,NBavgWind,SBavgWind
Public CSaWind,NBaWind,SBaWind
Public CSpeakGust,NBpeakGust,SBpeakGust
'**** Retrieve Remote pakbus data variables
Public RXResponse1W,RXResponse2W
Public CShiGust(2),NBhiGust(2),SBhiGust(2)
'***Define Data Tables
DataTable(USER_DATA_2hr,True,-1)
DataInterval(0,2,hr,10)
Sample(1,CSpeakGust,FP2)
Sample(1,CSavgWind,FP2)
Sample(1,NBpeakGust,FP2)
Sample(1,NBavgWind,FP2)
Sample(1,SBpeakGust,FP2)
Sample(1,SBavgWind,FP2)
Sample(1,AirTF,FP2)
Sample(1,RH,FP2)
EndTable
DataTable(USER_DATA_5min,True,-1)
DataInterval(0,5,Min,10)
Sample(1,CSpeakGust,FP2)
Sample(1,CSavgWind,FP2)
Sample(1,NBpeakGust,FP2)
Sample(1,NBavgWind,FP2)
Sample(1,SBpeakGust,FP2)
Sample(1,SBavgWind,FP2)
Sample(1,AirTF,FP2)
Sample(1,RH,FP2)
EndTable
DataTable (Data_3sec,True,-1)
DataInterval (0,3,Sec,10)
Sample(1,CShiGust,FP2)
Sample(1,NBhiGust,FP2)
Sample(1,SBhiGust,FP2)
Sample(1,CSsampMPH,FP2)
Sample(1,NBsampMPH,FP2)
Sample(1,SBsampMPH,FP2)
EndTable
DataTable(CSHealth,True,-1)
DataInterval(0,30,Min,10)
Sample(1,BattV,FP2)
Minimum(1,BattV,FP2,False,False)
Sample(1,PTemp_F,FP2)
EndTable

'Main Program
BeginProg
'***Initialize variable
GustCount = 1
'Main Scan
Scan(3,Sec,1000,0)
'Default Datalogger Battery Voltage measurement 'BattV'
Battery(BattV)
'Default Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp(PTemp_C,_60Hz)
'05103 Wind Speed & Direction Sensor measurements 'WS_mph' and 'WindDir'
PulseCount(WS_mph,1,1,1,1,0.2192,0)
BrHalf(WindDir,1,mV2500,1,1,1,2500,True,0,_60Hz,355,0)
If WindDir>=360 Then WindDir=0
'HMP155 (constant power) Temperature & Relative Humidity Sensor measurements 'AirTF' and 'RH'
'VoltSe(AirTF,1,mV2500,2,0,0,_60Hz,0.252,-112)
VoltSe(RH,1,mV2500,3,0,0,_60Hz,0.1,0)
If RH>100 AND RH<108 Then RH=100
PTemp_F=PTemp_C*9/5+32
RH=Round(RH,0)
CSsampMPH=Round(WS_mph,1)
'***Email Alarm get port info and set sendemail to true to send alarm
PortGet(PortStat, 1)
If Gustcount < 600 Then
Gust(Gustcount) = CSsampMPH
NBiGust(Gustcount) = NBSampMPH
SBiGust(Gustcount) = SBsampMPH
Gustcount = Gustcount + 1
Else
Gustcount = 1
EndIf
'Finding the HiGust for M,NB,SB in last 30min and store
MaxSpa (CShiGust(),600,Gust())
MaxSpa (NBhiGust(),600,NBiGust())
MaxSpa (SBhiGust(),600,SBiGust())
'Calculating Average Wind for M,NB,and SB and store
AvgRun(CSaWind,1,CSsampMPH,100)
AvgRun(NBaWind,1,NBsampMPH,100)
AvgRun(SBaWind,1,SBsampMPH,100)
NextScan

SlowSequence
Scan(3,Sec,10000,0)
'**** Retreive Remote data
GetVariables(RXResponse1W,ComSDC7,0,2,0,0,"Public","WS_mph",NBsampMPH,1)
GetVariables(RXResponse2W,TCPOpen("166.131.22.34",6785,0),0,1,0,0,"Public","WS_mph",SBsampMPH,1)
'***Call Data Tables and Store Data
CallTable(Data_3sec)
NextScan

SlowSequence
Scan(5,Min,1000,0)
CSavgWind=Round(CSaWind,1)
NBavgWind=Round(NBaWind,1)
SBavgWind=Round(SBaWind,1)
CSpeakGust = CShiGust
NBpeakGust = NBhiGust
SBpeakGust = SBhiGust
'***Call Data Tables and Store Data
CallTable(USER_DATA_5min)
NextScan

SlowSequence
Scan(30,Min,1000,0)
'***Call Data Tables and Store Data
CallTable(CSHealth)
CallTable(USER_DATA_2hr)
NextScan

EndProg
-----------------------------------------------------------
Through our research, there's mention of logger's integrated IP functionality like TCPOpen() is enable when you have a NL120, NL115, NL200, NL240, or a device that serves as a PPP Host connected. Wouldn't our current setup above (CR1000<-->PPP serial<-->cell modem) be equivalent to "a device that serves as PPP Host connected"? If TCPOpen functionality is indeed disabled with our current setup, is there another set of function/instruction we can use to not have to add a NL120 unit, etc? We greatly appreciate any inputs and help. Thanks.

* Last updated by: District9RWIS on 2/7/2014 @ 10:39 AM *


tmecham Feb 7, 2014 05:41 PM

We have a note on our LoggerLink mobile app that may be applicable to what you are trying to do here.

Note: AT&T's default security settings do not allow mobile-to-mobile connections on the AT&T network. This affects connections from a mobile phone or tablet on the AT&T network attempting to connect to a cellular modem on the AT&T network. If your mobile device and cellular modem are both on the AT&T network, please contact Campbell Scientific for configuration information before purchasing LoggerLink. This does not affect connections where the phone and/or the modem are on another network (for instance, a Verizon phone connecting to an AT&T cellular modem or visa versa, or a Verizon phone to Verizon cellular modem connection).


District9RWIS Mar 5, 2014 11:41 PM

Just got a Verizon service for cell modem...you're absolutely right. We were able to get them to communicate with each other successfully now. Thank you much tmecham.

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