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.

FTP setting for begginers


okourkoulos Sep 30, 2013 09:19 AM

This my first post, so be gentle!

I am using a CR800 with a Multiplexer 16/32, an AVW200 interface and a FasTrack Xtend modem. In the modem there is a SIM card with a dynamic IP.

On the Mux there are 13 sensors installed.

I was given a CR program from the manufactuer of the sensors and was told that it's set only for measuring and not for FTP.
It just opens a port for sending.

Can I use only LoggerNet and DevConfig Utility to configure the modem or I need an amended program in order to send the data to FTP every hour?

I have tried to do so because I have no knowledge of such programming. In DevCOnfig the PPP state shows only "dialing" and at just once I saw: "authenticating". I tried many different approaches having read the manual for GPRS connectivity many times.

Below, is the program used. It is working fine and values are taken localy.

'CR800 Series Datalogger:Program for 16 VW+Th sensors with one 16/32 MUX using AVW200

'Declare Public Variables

Public PTemp, batt_volt
Dim Result1, x
Public MUX1_VW(16,1)
Dim tmpavw200(6)


'Sensor tags
Alias MUX1_VW(1,1)=VW_1
Alias MUX1_VW(2,1)=VW_2
Alias MUX1_VW(3,1)=VW_3
Alias MUX1_VW(4,1)=VW_4
Alias MUX1_VW(5,1)=VW_5
Alias MUX1_VW(6,1)=VW_6
Alias MUX1_VW(7,1)=VW_7
Alias MUX1_VW(8,1)=VW_8
Alias MUX1_VW(9,1)=VW_9
Alias MUX1_VW(10,1)=VW_10
Alias MUX1_VW(11,1)=VW_11
Alias MUX1_VW(12,1)=VW_12
Alias MUX1_VW(13,1)=VW_13
Alias MUX1_VW(14,1)=VW_14
Alias MUX1_VW(15,1)=VW_15
Alias MUX1_VW(16,1)=VW_16

Dim C1(16),B1(16),A1(16)


'Define Data Tables
DataTable (DAS_DATA,1,-1) 'stores data from both sensors into a table named DAS_DATA

DataInterval (0,0,Sec,10)

Sample (1,batt_volt,FP2)

Sample (1,PTemp,FP2)

Sample (16,MUX1_VW(),IEEE4)

EndTable


'Main Program

BeginProg
SerialOpen (Com2,38400,0,0,10000)
Scan (60,Min,0,0) 'scan interval
PanelTemp (PTemp,250)
Battery (batt_volt)

'For polynomial expressions
A1(1)=0: B1(1)=1:C1(1)=0 'for linear expression B1= gage factor in engineering units.
A1(2)=0: B1(2)=1:C1(2)=0 ' C1= IR in engineering units.
A1(3)=0: B1(3)=1:C1(3)=0
A1(4)=0: B1(4)=1:C1(4)=0
A1(5)=0: B1(5)=1:C1(5)=0
A1(6)=0: B1(6)=1:C1(6)=0
A1(7)=0: B1(7)=1:C1(7)=0
A1(8)=0: B1(8)=1:C1(8)=0
A1(9)=0: B1(9)=1:C1(9)=0
A1(10)=0: B1(10)=1:C1(10)=0
A1(11)=0: B1(11)=1:C1(11)=0
A1(12)=0: B1(12)=1:C1(12)=0
A1(13)=0: B1(13)=1:C1(13)=0
A1(14)=0: B1(14)=1:C1(14)=0
A1(15)=0: B1(15)=1:C1(15)=0
A1(16)=0: B1(16)=1:C1(16)=0


'Code to read sensors
PortSet(1, 1) ' Reset High Mux On
Delay(1, 50, mSec) ' before clocking
For x = 1 To 16
'Delay (0,1,Sec)
PulsePort(2, 2000) 'Clock pulse
AVW200(Result1,Com2,200,200,tmpavw200(1),1,1,1,500,3500,2,_50Hz,1,0)
If tmpavw200(2)= 0 Then tmpavw200(1)="NAN"
Move(MUX1_VW(x,1),1,tmpavw200(1),1) ' now copy tmp value to the Ds
'change into freq^2
MUX1_VW(x,1)=(MUX1_VW(x,1)*MUX1_VW(x,1))/1000

MUX1_VW(x,1)=(MUX1_VW(x,1)*MUX1_VW(x,1))*A1(x)+MUX1_VW(x,1)*B1(x)+C1(x)

Next x
PortSet(1, 0)


CallTable DAS_Data

NextScan

EndProg


Please help!


okourkoulos Oct 10, 2013 06:46 AM

Can anyone help me on this?

Does anybody know if this modem is suitable for this job?
Can it send data to an FTP address?


GTProdMgr Oct 10, 2013 03:41 PM

The SerialOpen command on Com2 opens a communications channel between the datalogger and the AVW200 device. That channel is unrelated to the "datalogger to modem" connection channel, which should be the center of your focus for now.

The connection between the datalogger and modem needs to establish what is called a PPP (Point-to-Point protocol) connection.

The instruction you want to add in to your program is called
"FTPClient". You should open the CRBasic editor in your LoggerNet or PC400 program, find the FTPClient instruction on the list of available instructions and then press the Help button to see instructions for how to use this command and add it to your CRBasic program. A brief overview is included at the end of this message. I think everything else is working in your program (as certified by the manufacturer and my brief review), you just need to get the FTP part added in to the program.

The CR800 datalogger can only use "Internet-enabled" commands such as the FTPClient instruction (and email related instructions, etc.) when it has a successful internet connection. We often refer to that as "enabling the web stack" of the datalogger. For the CR800 that is only accomplished by making a successful PPP connection to an internet enabled modem (or by using an NL201 device).

Your modem sounds like it is able to obtain an IP address, so I think it is capable of internet activity. The real issue you must work out is how to get a properly working PPP connection going between that modem and the datalogger.

A PPP state of "dialing" or "authenticating" should appear only temporarily when the system is first powered up. You should eventually see a state of "CONNECT" or similar, otherwise your PPP connection is not working.

There are a few folks at Campbell Scientific who can help you make a PPP connection using some IP Cell Modems that we are familiar with and which we re-sell. However, since your modem is different it will be harder. Unless another forum user has done this before with this exact modem and provides detailed instructions, then I don't think this forum is going to be the most effective way for you to get the problem solved. It may be possible to get your modem working (it seems possible), but this will definitely be an advanced exercise. I recommend that you open a support case by calling your local Campbell Scientific support rep.


FTPClient datalogger instruction
----------------------------------
The FTPClient function is used to send or retrieve a file via FTP.

Syntax :
Variable = FTPClient ( IPAddress, User, Password, LocalFileName, RemoteFileName, PutGetOption )

The FTPClient function opens an FTP socket to a remote machine. The remote machine can be either a datalogger or a computer, but it must have an FTP server running. FTPClient can be used to monitor the success/failure of transferring a file. The function returns True if successful or False if it fails.

The datalogger waits up to 40 seconds for FTPClient to return a result; thus, it can hold up the scan. However, it can be placed in a slow sequence scan. In a slow sequence, it will run in the background and will not hold up the main program waiting for the transaction to be completed.

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