Hello to everybody,
I am trying to send the table of the CR800--->GRPS ModemWavecom via FTP with no luck.
This is my code:
------------------------------------------------------------
'Declare Public Variables
Public PTemp, batt
'FTP Variables
Public FTPSuccess As Boolean
Public OutStat As Boolean
Public LastFileName As String * 25
'FTP Information
Const IPAddress="xx.xx.xx.xx.xx"
Const User="rrr"
Const Password="yyy"
Const Filename = "FTPdata.dat"
'Define Data Tables
DataTable (FTP,1,-1)
TableFile ("USR:FTP",12,5,1,0,Min,OutStat,LastFileName)
Sample (1,PTemp,FP2)
Sample (1,batt,FP2)
EndTable
'Main Program
BeginProg
'Set up USR drive to write data
SetStatus ("USRDriveSize",31744)
'Scan every hour
Scan (1,Min,0,0)
'Measure Panel Temperature
PanelTemp (PTemp,250)
'Measure Battery Voltage
Battery (batt)
'Call Data Table
CallTable (FTP)
'FTP Data
If Outstat Then
FTPSuccess = FTPClient (IPAddress,User,Password,LastFileName,Filename,0)
EndIf
NextScan
EndProg
------------------------------------------------------------I have enable the FTP from the Device Configuration Utility.
I set up for test an FTP server using FILEZILLA.
The data status of the FTP get TRUE (portable keyboard CR100D) but in the FTP Server I have the following message with no transfer file-table
Connected, sending welcome message...
220-Hello
220-WELCOME FTP
220 Nikos Geronikolos
USER w
331 Password required for w
PASS *
230 Logged on
PORT 192,168,1,100,5,140
200 Port command successful
STOR USR_FTP1.dat
150 Opening data channel for file transfer.
425 Can't open data connection.
I am trying to solve the problem for 3 days.Do you have any idea where is the problem??
Regards
Nikos
* Last updated by: oldnick on 8/30/2010 @ 9:05 AM *
That looks like a firewall issue. If you read up on ftp protocols you will see that standard ftp opens several ports one of which many firewalls do not like.
You could try to fathom out where this blockage is (it could be your PC, a router, or the GPRS network) or alternatively and more simply make sure Filezilla is set up to allow passive mode and then try the passive option in the ftpclient instruction.
I have setup the FTP server to work in passive mode.Is the ftpclient instruction by default in passive mode??
Thanks
Nikos
Did you mean in the FTPclient instruction
Variable = FTPClient ( IPAddress, User, Password, LocalFileName, RemoteFileName, PutGetOption )
PutGetOption = 2 Send a file to the remote, passive mode
Nikos
Yes
I have got the some error using passive mode in the FTPclient instruction <<425 Can't open data connection.>>
I have test my FTP server using FTP clients in passive mode with no problem...
Please advice
Nikos
Tests:
a) are you able to login to the ftp server of your PC from the internet.
b) if you are, can you see the connection attempt from the logger in the logs of the ftp server - what do they look like in passive mode.
c) is the SIM you are using a standard one or one with a public fixed IP. If the latter you should check with your SIM provider whether there is a firewall between the GPRS modem and the internet (many fixed IP SIMs do have). If there is one check that ftp is allowed.
Suggestion:
If you have access to the Logger
1. Connect with Device Config
2. Click on Settings Editor Tab and scroll to the bottom
3. Select IP Trace COM Port and select any port you are not using.
4. Select IP Trace code and enter 8192 for FTP.
Click Apply.
Open the connect screen, select the logger then select datalogger, then terminal emulator. Open the terminal emulator, hit a few CR to get the CR800 prompt, type W which lets you watch communications, select the port you set up in IP Trace, set a timeout period, Y to the ASCII prompt and you can watch all the ftp handshaking to see what the problem is.
I used this to debug an FTP problem I was having with a Raven modem sending files.
Good Luck
Thanks Dave for the useful advice.
I will try it tommorow and I'll let you know the reselts...
Thanks
Nikos Geronikolos
Can someone upload the configuration file for me
(I need it for example untitled.CR8)