If you use Cumulus, please donate Image

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Struggling with SFTP

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderators: daj, TNETWeather

RichieW13
Posts: 1
Joined: Mon May 22, 2017 6:30 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10

Struggling with SFTP

Postby RichieW13 » Mon May 22, 2017 7:39 am

My web host has no required me to start using SFTP, so my Cumulus 1 uploads are no longer working.

I walked through the steps in the Wiki: http://wiki.sandaysoft.com/a/SFTP

But I'm still struggling.

I created the .bat and .txt files as described. But nothing seems to happen. (Can I still force an update by clicking File> Web Update?)

How am I supposed to the final step in the Wiki:

Code: Select all

To upload the 'standard web site' that ships with Cumulus, you will need to copy the following files:

    index.htm
    today.htm
    yesterday.htm
    record.htm
    trends.htm
    gauges.htm
    thismonth.htm
    thisyear.htm
    monthlyrecord.htm


I've been searching through the forums, and haven't been able to find a solution.

This post here, seem thorough, but it looks like he's doing something different altogether - including a backup script that I'm not interested in.

I see he added the above files into his script.

viewtopic.php?t=8098#p68100

User avatar
steve
Cumulus Author
Posts: 26193
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: None
Operating System: None
Location: On tour in France
Contact:

Re: Struggling with SFTP

Postby steve » Mon May 22, 2017 9:06 am

You upload a file by including a 'put' command in your WinSCP command file, like the example in the wiki:

put "localpath\realtime.txt" /remotepath

and like the lines in the Webpages_Upload.txt script in the post you linked to, e.g.

put "index.htm" index.html

Note that these are examples; you will need to change the paths to match your server.

If that doesn't help, it would be useful to show what you have done so far.

The File -> Web Update action does not cause the periodic command to be executed.
Steve
-----
Hosting available for Cumulus web sites. See http://sandaysoft.com/forum/viewtopic.php?f=2&t=11876

Like Cumulus and want to support it? Please donate! Image

meteozusterhof
Posts: 13
Joined: Wed Jul 13, 2011 2:14 pm
Weather Station: WS-4000
Operating System: Windows 7
Location: Leiden, the Netherlands
Contact:

Re: Struggling with SFTP

Postby meteozusterhof » Mon Aug 14, 2017 1:51 pm

I am running into the same issues as Richie. I followed the CumulusWiki example, but it does not seem to work.

- I installed WinSCP
- I created C:\Cumulus\sftp-cmds.txt
- I created C:\cumulus\sftp.bat
- I added the extra "put" lines for the various files
- In Cumulus, under "configuration ---> internet", I blanked the host name and filled in C:\Cumulus\sftp.bat under "External Programs" behind both "program"and "realtime program"

The website (www.meteozusterhof.nl) however does not update.
-----
Weatherstation Zusterhof, Leiden, the Netherlands
http://www.meteozusterhof.nl

User avatar
Toxic17
Posts: 526
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: Struggling with SFTP

Postby Toxic17 » Mon Aug 14, 2017 6:42 pm

I would suggest turning on logging for Winscp and see what is happening when it runs.

add the following to the winscp commandline:

/log="C:\Cumulus\winscp.log" /loglevel=2

it will turn on logging create a logfile called winscp and log at debug2 level.(as much info as possible.)

once it has run, check the logfile and post its contents in a coded quote. please remove/change any sensitive IP/pwds

you could also run the command in a command prompt from C:\cumulus and see what output the command gives,
Regards Simon
https://www.conligwx.org
https://www.conligwx.org/pws/
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

meteozusterhof
Posts: 13
Joined: Wed Jul 13, 2011 2:14 pm
Weather Station: WS-4000
Operating System: Windows 7
Location: Leiden, the Netherlands
Contact:

Re: Struggling with SFTP

Postby meteozusterhof » Wed Aug 16, 2017 10:03 pm

I have no idea how to do that.
-----
Weatherstation Zusterhof, Leiden, the Netherlands
http://www.meteozusterhof.nl

User avatar
Toxic17
Posts: 526
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: Struggling with SFTP

Postby Toxic17 » Wed Aug 16, 2017 10:16 pm

meteozusterhof wrote:I have no idea how to do that.


then how are you using winscp to connect to the ftp server?

within one of your batch files you call winscp.com or winscp.exe

add the parameters on the end of that commandline.

upload your batch files here we can then take a look.
Regards Simon
https://www.conligwx.org
https://www.conligwx.org/pws/
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

meteozusterhof
Posts: 13
Joined: Wed Jul 13, 2011 2:14 pm
Weather Station: WS-4000
Operating System: Windows 7
Location: Leiden, the Netherlands
Contact:

Re: Struggling with SFTP

Postby meteozusterhof » Wed Aug 16, 2017 10:47 pm

The text in the sftp.bat file is now:

Code: Select all

winscp.exe /script=c:\cumulus\sftp-cmds.txt /log="C:\Cumulus\winscp.log" /loglevel=2


...but nothing happens, also when manually running the bat file. No log, nothing.

I seldom use command lines and scripting, so basically I have no idea what I am doing.

The text I currently have in the script file sft-cmds.txt is:

Code: Select all

option batch abort
option confirm off
open[myusername]:[mypassword]@sftp.xs4all.nl
put "C:\Cumulus\realtime.txt" /WWW/weer
put "C:\Cumulus\web\index.htm" /WWW/weer
put "C:\Cumulus\web\gauges.htm" /WWW/weer
put "C:\Cumulus\web\today.htm" /WWW/weer
put "C:\Cumulus\web\yesterday.htm" /WWW/weer
put "C:\Cumulus\web\record.htm" /WWW/weer
put "C:\Cumulus\web\trends.htm" /WWW/weer
put "C:\Cumulus\web\thismonth.htm" /WWW/weer
put "C:\Cumulus\web\thisyear.htm" /WWW/weer
put "C:\Cumulus\web\monthlyrecord.htm" /WWW/weer
put "C:\Cumulus\web\images\compass.png" /WWW/weer/images
put "C:\Cumulus\web\images\hum.png" /WWW/weer/images
put "C:\Cumulus\web\images\humsm.png" /WWW/weer/images
put "C:\Cumulus\web\images\intemp.png" /WWW/weer/images
put "C:\Cumulus\web\images\intempsm.png" /WWW/weer/images
put "C:\Cumulus\web\images\moon.bmp" /WWW/weer/images
put "C:\Cumulus\web\images\press.png" /WWW/weer/images
put "C:\Cumulus\web\images\presssm.png" /WWW/weer/images
put "C:\Cumulus\web\images\rain.png" /WWW/weer/images
put "C:\Cumulus\web\images\rainsm.png" /WWW/weer/images
put "C:\Cumulus\web\images\raind.png" /WWW/weer/images
put "C:\Cumulus\web\images\raindsm.png" /WWW/weer/images
put "C:\Cumulus\web\images\raint.png" /WWW/weer/images
put "C:\Cumulus\web\images\raintsm.png" /WWW/weer/images
put "C:\Cumulus\web\images\temp.png" /WWW/weer/images
put "C:\Cumulus\web\images\tempsm.png" /WWW/weer/images
put "C:\Cumulus\web\images\tempm.png" /WWW/weer/images
put "C:\Cumulus\web\images\tempmsm.png" /WWW/weer/images
put "C:\Cumulus\web\images\wind.png" /WWW/weer/images
put "C:\Cumulus\web\images\windd.png" /WWW/weer/images
put "C:\Cumulus\web\images\windsm.png" /WWW/weer/images
put "C:\Cumulus\web\images\windgauge.png" /WWW/weer/images
put "C:\Cumulus\web\images\windrose.png" /WWW/weer/images
put "C:\Cumulus\web\images\winddsm.png" /WWW/weer/images
exit
-----
Weatherstation Zusterhof, Leiden, the Netherlands
http://www.meteozusterhof.nl

User avatar
Toxic17
Posts: 526
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: Struggling with SFTP

Postby Toxic17 » Wed Aug 16, 2017 11:51 pm

you need to run winscp most likely in console mode.

winscp.exe will run default in GUI mode (ie windows application) and the script values need to be in " " quotes

try the following:

Code: Select all

winscp.exe /console /script="c:\cumulus\sftp-cmds.txt" /log="C:\Cumulus\winscp.log" /loglevel=2


also where is winscp located on the c drive?

you can use winscp.com too. this is the console version.

Code: Select all

winscp.com /script="c:\cumulus\sftp-cmds.txt" /log="C:\Cumulus\winscp.log" /loglevel=2
Regards Simon
https://www.conligwx.org
https://www.conligwx.org/pws/
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

meteozusterhof
Posts: 13
Joined: Wed Jul 13, 2011 2:14 pm
Weather Station: WS-4000
Operating System: Windows 7
Location: Leiden, the Netherlands
Contact:

Re: Struggling with SFTP

Postby meteozusterhof » Thu Aug 17, 2017 11:03 am

Tried your suggestions: nothing seems to happen. No logfiles generated either.

winscp is in C:\Program Files\WinSCP

with the winscp.exe version in the bat file I see a DOS screen pop-up for a while (second or 5), displaying the line from the bat file, when manually running the bat file.

With the winspc.com version in the bat file, I see very briefly flash a DOS window but too brief to read.

When leaving it to Cumulus, I see nothing at all happening.

EDIT: the line shown in the DOS box is actually not that in the bat file, but:

Code: Select all

C:\Cumulus>winscp.exe /console /script="C:\cumulus\sftp-cmds.txt" /log="C:\Cumulus\winscp.log" /loglevel=2
-----
Weatherstation Zusterhof, Leiden, the Netherlands
http://www.meteozusterhof.nl

meteozusterhof
Posts: 13
Joined: Wed Jul 13, 2011 2:14 pm
Weather Station: WS-4000
Operating System: Windows 7
Location: Leiden, the Netherlands
Contact:

Re: Struggling with SFTP

Postby meteozusterhof » Thu Aug 17, 2017 11:30 am

So, that last bit suggested to me that it looks for winscp in the C:/Cumulus directory. So as a test, I installed winscp directly to the C:/Cumulus directory.

Upon manually running the bat file, it opens a DOS screen with the line specified above, and after a while it says:

Code: Select all

Cannot open file "C:\Cumulus|sftp-cmds.txt". The system cannot find the file specified


..and then closes.

Which is weird because the specified file sftp-cmds.txt is in fact in C:/Cumulus.
-----
Weatherstation Zusterhof, Leiden, the Netherlands
http://www.meteozusterhof.nl

User avatar
Toxic17
Posts: 526
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: Struggling with SFTP

Postby Toxic17 » Thu Aug 17, 2017 11:33 am

Ok so you cannot run

Code: Select all

C:\Cumulus>winscp.exe /console /script="C:\cumulus\sftp-cmds.txt" /log="C:\Cumulus\winscp.log" /loglevel=2


since winscp does not reside in C:\Cumulus

in your sftp.bat file create the following lines:

Code: Select all

@echo off
cd "C:\Program Files\WinSCP"
winscp.exe /console /script="C:\cumulus\sftp-cmds.txt" /log="C:\Cumulus\winscp.log" /loglevel=2


This will mean you can run that batch file from anywhere on your C: drive and it will change directory to where WinSCP is and run that command.

now before we run this sftp.bat we need to bring up a command prompt window and "test" the commandline is correct.

bring up your "run" field (Windows Key + R)

type in "cmd" (without quotes)

a dos prompt window will appear, showing you a prompt and the directory you are in. most likely windows/system32 or something like that.

type the following.

cd C:\Program Files\WinSCP <enter key>

you now should be in the WinSCP folder where winscp.exe and winscp.com are.

type:

dir

this will list the files and folder within that folder.

the type in the winscp.exe command line exactly as it is in the sftp.bat

Code: Select all

winscp.exe /console /script="C:\cumulus\sftp-cmds.txt" /log="C:\Cumulus\winscp.log" /loglevel=2


this will hopefully show output. what output do you get?

btw my Winscp is installed in "C:\Program Files (x86)\WinSCP" so if you dont find winscp.com or winscp.exe first of all change to that folder instead.

let me know how you get on.

if no output, then you need to read the C:\Cumulus\winscp.log file


meteozusterhof wrote:Tried your suggestions: nothing seems to happen. No logfiles generated either.

winscp is in C:\Program Files\WinSCP

with the winscp.exe version in the bat file I see a DOS screen pop-up for a while (second or 5), displaying the line from the bat file, when manually running the bat file.

With the winspc.com version in the bat file, I see very briefly flash a DOS window but too brief to read.

When leaving it to Cumulus, I see nothing at all happening.

EDIT: the line shown in the DOS box is actually not that in the bat file, but:

Code: Select all

C:\Cumulus>winscp.exe /console /script="C:\cumulus\sftp-cmds.txt" /log="C:\Cumulus\winscp.log" /loglevel=2
Regards Simon
https://www.conligwx.org
https://www.conligwx.org/pws/
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

meteozusterhof
Posts: 13
Joined: Wed Jul 13, 2011 2:14 pm
Weather Station: WS-4000
Operating System: Windows 7
Location: Leiden, the Netherlands
Contact:

Re: Struggling with SFTP

Postby meteozusterhof » Thu Aug 17, 2017 12:52 pm

Nothing happens. In the command line box, I did the things as you described, and all I get in return is the prompt again:

Code: Select all

C:\Program Files\WinSCP>


For the rest nothing seems to happen. No winscp.log file is created in C:/Cumulus, nor in the WinSCP directory.

the notebook in question runs Windows 7 Enterprise by the way.
-----
Weatherstation Zusterhof, Leiden, the Netherlands
http://www.meteozusterhof.nl

User avatar
Toxic17
Posts: 526
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: Struggling with SFTP

Postby Toxic17 » Thu Aug 17, 2017 1:50 pm

meteozusterhof wrote:Nothing happens. In the command line box, I did the things as you described, and all I get in return is the prompt again:

Code: Select all

C:\Program Files\WinSCP>


For the rest nothing seems to happen. No winscp.log file is created in C:/Cumulus, nor in the WinSCP directory.

the notebook in question runs Windows 7 Enterprise by the way.


and if you type winscp.exe on its own? if nothing happens then WINSCP is NOT installed.

did you list the folder contents? is winscp.exe or winscp.com there?

you should see something like this:

Code: Select all

 Volume in drive C is OS
 Volume Serial Number is 6AE6-64FF

 Directory of C:\Program Files (x86)\WinSCP

20/02/2017  09:12    <DIR>          .
20/02/2017  09:12    <DIR>          ..
22/07/2016  10:56           484,136 DragExt64.dll
20/02/2017  09:12    <DIR>          Extensions
02/02/2017  16:42            37,854 license.txt
20/02/2017  09:12    <DIR>          PuTTY
20/02/2017  09:12           714,690 unins000.dat
20/02/2017  09:12         1,277,728 unins000.exe
20/02/2017  09:12            22,727 unins000.msg
15/02/2017  16:45           282,960 WinSCP.com
15/02/2017  16:45        18,904,272 WinSCP.exe
15/02/2017  16:44        10,516,179 WinSCP.map
15/02/2017  16:45           151,424 WinSCPnet.dll
               9 File(s)     32,391,970 bytes
               4 Dir(s)  141,988,859,904 bytes free
Regards Simon
https://www.conligwx.org
https://www.conligwx.org/pws/
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

User avatar
Toxic17
Posts: 526
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: Struggling with SFTP

Postby Toxic17 » Thu Aug 17, 2017 1:55 pm

failing this download the portable version of winscp.

https://winscp.net/download/WinSCP-5.9.6-Portable.zip

extract the files into your winscp folder.
Regards Simon
https://www.conligwx.org
https://www.conligwx.org/pws/
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

meteozusterhof
Posts: 13
Joined: Wed Jul 13, 2011 2:14 pm
Weather Station: WS-4000
Operating System: Windows 7
Location: Leiden, the Netherlands
Contact:

Re: Struggling with SFTP

Postby meteozusterhof » Thu Aug 17, 2017 2:03 pm

Code: Select all

C:\Program Files\WinSCP>dir
 
 Directory of C:\Program Files\WinSCP

08/14/2017  15:20    <DIR>          .
08/14/2017  15:20    <DIR>          ..
06/21/2017  11:10           210,832 DragExt.dll
08/14/2017  15:20    <DIR>          Extensions
06/20/2017  17:51            37,854 license.txt
08/14/2017  15:20    <DIR>          PuTTY
08/14/2017  15:20           141,174 unins000.dat
08/14/2017  15:20         1,277,728 unins000.exe
08/14/2017  15:20            22,727 unins000.msg
06/21/2017  11:10           282,960 WinSCP.com
06/21/2017  11:10        18,915,536 WinSCP.exe
06/21/2017  11:09        10,517,644 WinSCP.map
06/21/2017  11:10           151,424 WinSCPnet.dll
               9 File(s)     31,557,879 bytes
               4 Dir(s)  38,429,888,512 bytes free

C:\Program Files\WinSCP>


If I type winscp.exe in the prompt, it opens the GUI of winscp.

So WinSCP appears to be properly installed. It is the scripting part that does not seem to work.
-----
Weatherstation Zusterhof, Leiden, the Netherlands
http://www.meteozusterhof.nl


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 4 guests