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.

Debugging CR1000 FTPClient


ChrisL Jul 26, 2011 03:35 PM

I have a CR1000 with the Wavecom Fasttrack modem, as set up by CS. There are two of these loggers which are identical. I have been using one as a local test, and the second as an in-situ test.

I have programmed the loggers to send files every hour using the FTPClient command. On the local logger this works perfectly, and hasn't dropped a single hour for months.

The second logger worked perfectly for about 2/3 weeks, and then it became erratic, sometimes not logging in for 4 or 5 hours, and then catching up when it did finally log in. I had thought this might be a signal issue, but having been to the site, it is very close to the cell tower and the reception is absolutely perfect. I swapped sim card (2G) just to be sure that wasn't the issue too.

The modem is turned on and there is a delay of 30 seconds before PPPOpen is called. This is followed by a further 20 seconds, before FTPClient is called. If it fails once, it gives up until the next hour.

I can manually dial in using a CSD connection to collect the missing data, but this is very irritating!

Sometimes when the logger does succeed, it can take anywhere between 4 and 45 seconds to upload the file (according to my FTP server).

I have two questions:

1) Does anybody have any ideas about why this might be happening, and are my delay times okay?

2) How do I turn on the IP trace over a CSD connection? I can't use Dev Config utility as that requires RS232 connection. Can I even use IP trace over the GSM connection?

here is the key chunk of my program:

Thanks all!

SlowSequence
Do While TRUE

'Time help: 1=year, 2=month, 3=day of month, 4=hour of day, 5=minutes, 6=seconds, 7=microseconds, 8=day of week, 9=day of year
NowMin_11=RTime(4)*60+RTime(5)
If NowMin_11>=540 AND NowMin_11<1440 AND ( (NowMin_11-540) MOD 60<30 OR (NowMin_11-540) MOD 60>53 ) AND batt > 11.5 Then
SW12(1)

If (Queue(1) <> "") Then
Delay (0,45,Sec)
PPP = PPPOpen
Delay (0,20,Sec)
EndIf

Do While (Queue(1) <> "") 'If queue is not empty

LName = Queue(1)
Handle = FileOpen(LName,"r",0)
If FileTime(Handle) > 0 Then 'if file exists
RName = Replace (Queue(1),"USR:","")
Success = FTPClient (Host,User,Pass,LName,RDir + RName,2) 'attempt to ftp
CallTable (TxLog) 'diagnostics table
Delay (1,4,Sec) 'pause after attempt, yes this is a good idea
If Success Then Call QueueRemove() Else ExitDo 'send succeeded or failed, if failed exit and try later
Else 'file does not exist
Call QueueRemove()
EndIf 'end if filetime

FileClose(Handle)

Loop 'end do while queue

PPPClose

Else
SW12(0)
EndIf

Delay (1,10,Sec)'Control SlowSequence Execution Frequency
Loop 'end do while true
EndSequence


aps Jul 26, 2011 04:04 PM

Replied by email, already!

* Last updated by: aps on 7/26/2011 @ 10:05 AM *

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