Support Forums
Modem and FTP

Hi All,

I am currently working on a D T80 project which involves numerous DT80s uploading data to a web server via a GPRS modem. I think I can transfer the data by opening an ftp connection to the server and then unloading using 'U' directly into a text file on the server.

Is there any reason to think that this might not work? Also, is there any way that the DT80 can handle strings received on the RS232 port like it can on the serial sensor port? I would really like to log the GPRS/GSM signal quality which the modem will return in response to the AT+CSQ command.

Thanks,
Robin

Hi All, I am currently working on a D T80 project which involves numerous DT80s uploading data to a web server via a GPRS modem. I think I can transfer the data by opening an ftp connection to the server and then unloading using 'U' directly into a text file on the server. Is there any reason to think that this might not work? Also, is there any way that the DT80 can handle strings received on the RS232 port like it can on the serial sensor port? I would really like to log the GPRS/GSM signal quality which the modem will return in response to the AT+CSQ command. Thanks, Robin

You can have the DT80 run the FTP using an ALARM (for sure), IF (I think) or DO as part of the program. This can be an UNLOAD for text or COPY/MOVE for binary.

Best bet is to have a look inside the logger on the DT weather station program. I lifted this line from one of the schedules.

DO{UC "ftp://publicftp:datataker@www.datataker.com/weather/Fixed/"}

If you are comfortable with the text programming, the direct program link is:

ftp://dt80.datataker.com.au/b:/JOBS/WEATHER/PROGRAM.DXC

The RS232 port can be a Host port or a Serial Sensor port, not both. You need fairly recent firmware for either of these items.

You can have the DT80 run the FTP using an ALARM (for sure), IF (I think) or DO as part of the program. This can be an UNLOAD for text or COPY/MOVE for binary. Best bet is to have a look inside the logger on the DT weather station program. I lifted this line from one of the schedules. ```` DO{UC "ftp://publicftp:datataker@www.datataker.com/weather/Fixed/"} ```` If you are comfortable with the text programming, the direct program link is: ```` ftp://dt80.datataker.com.au/b:/JOBS/WEATHER/PROGRAM.DXC ```` The RS232 port can be a Host port or a Serial Sensor port, not both. You need fairly recent firmware for either of these items.

Hi Robin,

Here's a Program that I have used for FTP.

'=====================================================================
' DT80 FTP - Version 1.0
' Application: FTP data to a website.
' DataTaker: DT80/85
' Program written by Michael Hampson - Lontek
' Contact: 02 4739 8400 - www.lontek.com.au
' Date: Wednesday, 10 October 2007
'=====================================================================

H    'Halt the DT80/85 before sending the program.
H

DELDATA*    'Delete all data from the dataTaker.
DELALARMS*    'Delete all alarms from the dataTaker.
DELJOB*    'Delete all jobs from the dataTaker.
DELONRESET    'Delete the Onreset job.

'PROFILE "ETHERNET" "IP_ADDRESS"="192.168.0.20"
'PROFILE "ETHERNET" "SUBNET_MASK"="255.255.255.0"
'PROFILE "ETHERNET" "GATEWAY"="192.168.0.1"
'PROFILE"NETWORK","DNS_SERVER_1"="192.168.0.1" 
'PROFILE"NETWORK","DNS_SERVER_2"="192.168.0.1" 
'PROFILE "FTP_SERVER" "USER"="User"
'PROFILE "FTP_SERVER" "PASSWORD"="Password"
'SINGLEPUSH

BEGIN"LONTEK1"
CATTN    'Clear the Attn light.

FUNCTION1="FTP ARCH"{ARCHIVE"LONTEK1" "ftp://Username:Password@lontek.com.au/public_html/lontek/"}
FUNCTION2="FTP CSV"{/h/R/n/c/u P22=44 P24=13 P33=0 U"LONTEK1" "ftp://Username:Password@lontek.com.au/public_html/lontek/"}

RA("B:",ALARMS:OV:100KB,DATA:OV:20R)1S LOGONA GA
1TK("Thermocouple")
VBAT("Battery Volts")

RB("B:",ALARMS:OV:100KB,DATA:OV:1MB)1M LOGONB GB

DO"Unload"{/D/T/h/R/n/c/u P22=44 P24=13 P33=0 U"LONTEK1" "ftp://Username:Password@lontek.com.au/public_html/lontek/"}

END

Don't forget to un-comment the Profile settings when you first send the program to the logger.

Note "20R" on schedule A.

Regards,
Michael Hampson

Hi Robin, Here's a Program that I have used for FTP. ```` '===================================================================== ' DT80 FTP - Version 1.0 ' Application: FTP data to a website. ' DataTaker: DT80/85 ' Program written by Michael Hampson - Lontek ' Contact: 02 4739 8400 - www.lontek.com.au ' Date: Wednesday, 10 October 2007 '===================================================================== H 'Halt the DT80/85 before sending the program. H DELDATA* 'Delete all data from the dataTaker. DELALARMS* 'Delete all alarms from the dataTaker. DELJOB* 'Delete all jobs from the dataTaker. DELONRESET 'Delete the Onreset job. 'PROFILE "ETHERNET" "IP_ADDRESS"="192.168.0.20" 'PROFILE "ETHERNET" "SUBNET_MASK"="255.255.255.0" 'PROFILE "ETHERNET" "GATEWAY"="192.168.0.1" 'PROFILE"NETWORK","DNS_SERVER_1"="192.168.0.1" 'PROFILE"NETWORK","DNS_SERVER_2"="192.168.0.1" 'PROFILE "FTP_SERVER" "USER"="User" 'PROFILE "FTP_SERVER" "PASSWORD"="Password" 'SINGLEPUSH BEGIN"LONTEK1" CATTN 'Clear the Attn light. FUNCTION1="FTP ARCH"{ARCHIVE"LONTEK1" "ftp://Username:Password@lontek.com.au/public_html/lontek/"} FUNCTION2="FTP CSV"{/h/R/n/c/u P22=44 P24=13 P33=0 U"LONTEK1" "ftp://Username:Password@lontek.com.au/public_html/lontek/"} RA("B:",ALARMS:OV:100KB,DATA:OV:20R)1S LOGONA GA 1TK("Thermocouple") VBAT("Battery Volts") RB("B:",ALARMS:OV:100KB,DATA:OV:1MB)1M LOGONB GB DO"Unload"{/D/T/h/R/n/c/u P22=44 P24=13 P33=0 U"LONTEK1" "ftp://Username:Password@lontek.com.au/public_html/lontek/"} END ```` Don't forget to un-comment the Profile settings when you first send the program to the logger. Note "20R" on schedule A. Regards, Michael Hampson

Michael Hampson Lontek https://www.lontek.com.au/

Michael, SuperMono,

Thank you both very much for your replies - very helpful.

However, what I actually hope to do is ftp via the RS232 port and the modem through a GPRS data connection. I think that the ftp takes place via the Ethernet connection in both of the examples which is great but not quite what I need to do...my datatakers will be some way from a decent wired connection, unfortunately.

Regarding the datataker handling strings from the modem (i.e: communicating with the modem itself rather than just using it as a conduit), I think what I might do is piggyback the RX and TX lines from the RS232 port to the serial sensor port - anything returned by the modem to the host port will then go to the serial sensor port as well, and I can then do what I like with the data whilst retaining the host port.

I haven't tried this yet, but I am quietly confident....and prepared to be shot down if it is a foolish plan. Any thoughts?

Cheers,
Robin

Michael, SuperMono, Thank you both very much for your replies - very helpful. However, what I actually hope to do is ftp via the RS232 port and the modem through a GPRS data connection. I think that the ftp takes place via the Ethernet connection in both of the examples which is great but not quite what I need to do...my datatakers will be some way from a decent wired connection, unfortunately. Regarding the datataker handling strings from the modem (i.e: communicating with the modem itself rather than just using it as a conduit), I think what I might do is piggyback the RX and TX lines from the RS232 port to the serial sensor port - anything returned by the modem to the host port will then go to the serial sensor port as well, and I can then do what I like with the data whilst retaining the host port. I haven't tried this yet, but I am quietly confident....and prepared to be shot down if it is a foolish plan. Any thoughts? Cheers, Robin

Hi Robin,

On page 135 of the DT80 manual(UM-0085-A5) it mentions PPP. This might be an option if you can get the server to connect to the DT80. Here's a link to the forum with some extra information on PPP.
https://datatakerforum.com/index.php?u=/topic/652/

SuperMono, can you confirm if this is possible.

Regards,
Michael Hampson

Hi Robin, On page 135 of the DT80 manual(UM-0085-A5) it mentions PPP. This might be an option if you can get the server to connect to the DT80. Here's a link to the forum with some extra information on PPP. https://datatakerforum.com/index.php?u=/topic/652/ SuperMono, can you confirm if this is possible. Regards, Michael Hampson

Michael Hampson Lontek https://www.lontek.com.au/

Good morning Michael and Robin,

I know you can FTP via a PPP connection. It is used, in our case, to transfer data between a computer and a dataTaker. I know you can use any dial up modem or direct connection with an cable to the RS232 command port (No it can't be done via USB).

We do have some people who are using NextG router modems and VPN's to communicate with their DT80's

Cheers,
Roger

Good morning Michael and Robin, I know you can FTP via a PPP connection. It is used, in our case, to transfer data between a computer and a dataTaker. I know you can use any dial up modem or direct connection with an cable to the RS232 command port (No it can't be done via USB). We do have some people who are using NextG router modems and VPN's to communicate with their DT80's Cheers, Roger

Gee, being asked to confirm something instead of just making it up as I go, that will be a challenge smile

I think the issue is getting the PPP established in the first place. When you are starting from the PC end, then that is certainly possible. But if I understand this application you will want the PPP to be established from out in the field.

DT80 can't do that as far as I know, you would need a clever modem that can establish the PPP conection between the modem and the DT80, plus the outside world.

Back to the don't know the best answer in this case (at the moment). Failure smile how I dread it.....

Gee, being asked to confirm something instead of just making it up as I go, that will be a challenge :smile: I think the issue is getting the PPP established in the first place. When you are starting from the PC end, then that is certainly possible. But if I understand this application you will want the PPP to be established from out in the field. DT80 can't do that as far as I know, you would need a clever modem that can establish the PPP conection between the modem and the DT80, plus the outside world. Back to the don't know the best answer in this case (at the moment). Failure :sad: how I dread it.....

Hi All,

I am making steady progress here - I think that using the correct modem is the key.

On my modem (a Fargo Maestro 100) it is possible to use extended AT commands to set up ftp via GPRS. Sending FTP file to a server is then just a case of sending the appropriate setup commands to the modem (e.g: AT#FTPSERV="xxx.xxx.xxx.xxx", AT#FTPPUTFILENAME="example.txt" and so on, and then sending AT#FTPPUT to open the filename "example.txt" on the server.

Everything that is then sent through the modem then ends up in the file on the remote server, until the appropriate termination character is encountered. The problem I now have is this...

I have modified the RS232 cable to fool the dataTaker into thinking that it is connected to something other than a modem. This is because, as far as I can tell, there is no way to send AT commands to the modem if it is configured as the host port (which is automatic if a normal RS232 cable is used, since the modem pulls DSR high).

That means that "U" doesn't unload data via the RS232 port, as I think this only works with a modem attached. I can unload via the rs232 port only if I send "U" to that port...

I have two questions:

  1. Is it possible to send AT commands to a normal modem during the course of the program rather than as part of the initialization string?

  2. Is it possible to unload via the serial sensor port or host port using a program? Am I missing something basic?

OK - that's three questions.

Thanks,
Robin

Hi All, I am making steady progress here - I think that using the correct modem is the key. On my modem (a Fargo Maestro 100) it is possible to use extended AT commands to set up ftp via GPRS. Sending FTP file to a server is then just a case of sending the appropriate setup commands to the modem (e.g: AT#FTPSERV="xxx.xxx.xxx.xxx", AT#FTPPUTFILENAME="example.txt" and so on, and then sending AT#FTPPUT to open the filename "example.txt" on the server. Everything that is then sent through the modem then ends up in the file on the remote server, until the appropriate termination character is encountered. The problem I now have is this... I have modified the RS232 cable to fool the dataTaker into thinking that it is connected to something other than a modem. This is because, as far as I can tell, there is no way to send AT commands to the modem if it is configured as the host port (which is automatic if a normal RS232 cable is used, since the modem pulls DSR high). That means that "U" doesn't unload data via the RS232 port, as I think this only works with a modem attached. I can unload via the rs232 port only if I send "U" to that port... I have two questions: 1. Is it possible to send AT commands to a normal modem during the course of the program rather than as part of the initialization string? 2. Is it possible to unload via the serial sensor port or host port using a program? Am I missing something basic? OK - that's three questions. Thanks, Robin

It would appear that I am...

In the manual: The DT80 can output...via the active communications port.

So I guess the key is to make the RS232 port the active one...I have been experimenting with this using DeTransfer to send commands to the DT80. I guess I will now try from within a program...will report back with progress!

Regards,
Robin

It would appear that I am... In the manual: The DT80 can output...via the active communications port. So I guess the key is to make the RS232 port the active one...I have been experimenting with this using DeTransfer to send commands to the DT80. I guess I will now try from within a program...will report back with progress! Regards, Robin

Hmmm....
Another block in the road.

The difficulty is in unloading ("U") through the RS232 port from within a program. When I try do{U}, nothing happens.

I thought of trying to use "TYPE", but that seems to require a text file to unload.

If I use something like DO'Send text on RS232 port', then "Send text on RS232 port" is sent successfully through the port. However, no datataker commands return anything through the port (SHOWPROG for example).

Any ideas? What I really need to do is convince the DT80 to send the results of commands to the RS232 port. Is it even possible?

I have read that the RS232 port can be configured as a host port or a serial sensor port - is this automatic using the DSR line, or and it be done in code? If so, would this help? How would I communicate with it in serial sensor mode - would it just be the same as with the other serial sensor port, using 1SERIAL commands?

So many questions...

Regards,
Robin

Hmmm.... Another block in the road. The difficulty is in unloading ("U") through the RS232 port from within a program. When I try do{U}, nothing happens. I thought of trying to use "TYPE", but that seems to require a text file to unload. If I use something like DO'Send text on RS232 port', then "Send text on RS232 port" is sent successfully through the port. However, no datataker commands return anything through the port (SHOWPROG for example). Any ideas? What I really need to do is convince the DT80 to send the results of commands to the RS232 port. Is it even possible? I have read that the RS232 port can be configured as a host port or a serial sensor port - is this automatic using the DSR line, or and it be done in code? If so, would this help? How would I communicate with it in serial sensor mode - would it just be the same as with the other serial sensor port, using 1SERIAL commands? So many questions... Regards, Robin

Not sure about using with a DO, but try putting the U into an ALARM or IF that you know will be true.

That should work.

Not sure about using with a DO, but try putting the U into an ALARM or IF that you know will be true. That should work.

Foot in mouth again, it does work with a DO for FTP, I don't know about a straight unload, never tried that.

Foot in mouth again, it does work with a DO for FTP, I don't know about a straight unload, never tried that.

Hi Robin,

Is it possible to send AT commands to a normal modem during the course of the program rather than as part of the initialization string?

You can send text out the RS232 host port using an alarm. Here's an example I have used with the SMSX GSM modem.

ALARM(1CV>0.5)'ET-SMS=0|Cool Room Temperature problem @ #|P1|30^M'{[1CV=0]}

Note the single quotes. See page 76 of the DT80 User's Manual UM-0085-A5.

"If, however, the action text is instead enclosed in 'single quotes', the actionText is sent exclusively to the RS232 Host Port on the logger. This is useful for communicating with modems when they are in command mode and when the host port is used for other purposes."

Regards,
Michael Hampson
Lontek

Hi Robin, > Is it possible to send AT commands to a normal modem during the course of the program rather than as part of the initialization string? You can send text out the RS232 host port using an alarm. Here's an example I have used with the SMSX GSM modem. ```` ALARM(1CV>0.5)'ET-SMS=0|Cool Room Temperature problem @ #|P1|30^M'{[1CV=0]} ```` Note the single quotes. See page 76 of the DT80 User's Manual UM-0085-A5. > "If, however, the action text is instead enclosed in 'single quotes', the actionText is sent exclusively to the RS232 Host Port on the logger. This is useful for communicating with modems when they are in command mode and when the host port is used for other purposes." Regards, Michael Hampson Lontek

Michael Hampson Lontek https://www.lontek.com.au/

146
12
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft