Can't get ftp working after reinstall

141 views
Skip to first unread message

Maarten Weerman

unread,
Apr 15, 2021, 3:03:07 AM4/15/21
to weewx...@googlegroups.com
Hi,

First of all am using weewx in a raspberry Pi 2 environment. When checking my weather data yesterday, i noticed that my raspberry was frozen. So i tried to restart the rp. But with no luck. In the end i had to reinstall raspbian and weewx again and since i only have copy of my database, i also lost track of my configuration in the FTP section. 

My FTP is like this with any passwords and usernames xed out.

User: webXXXXXX (followed by a six digit number)
Pass:'XXXXXXXX'
Path: /html/weewx (there is a leading html folder in my ftp Setup)
Secure FTP: true

The server adress must be somewhat modified. I had already tried combinations like "ftp.rex14.flatbooster.com" but with no success.  

But no matter what combination, i always get an error message like this.
See also the attached message.

Best Records

Georg


N.B. I am using weewx 4.5.1. right now and also made sure to install the required python files before installing weewx.




weewx-Error

Karen K

unread,
Apr 15, 2021, 10:13:55 AM4/15/21
to weewx-user
I learn from the logs that there is a problem with authentication. Could you provide the complete FTP section of weewx.conf? Replace user and password by X, only. But do not replace '=' by ':' etc.

weerman

unread,
Apr 15, 2021, 12:33:38 PM4/15/21
to weewx-user


Hi, 

This is the FTP configuration of my weewx.conf file
    [[FTP]]
        # FTP'ing the results to a webserver is treated as just another report,
        # albeit one with an unusual report generator!
        skin = Ftp

        # If you wish to use FTP, set "enable" to "true", then
        # fill out the next four lines.
        # Use quotes around passwords to guard against parsing errors.
        enable = true
        user = webxxxxxx
        password = 'xxxxxxxx
        server = webxxxxxx.rex14.flatbooster.com    # The ftp server name, e.g, www.myserver.org
        path = /html/weewx    # The destination directory, e.g., /weather

        # Set to True for an FTP over TLS (FTPS) connection. Not all servers
        # support this.
        secure_ftp = true

        # To upload files from something other than what HTML_ROOT is set
        # to above, specify a different HTML_ROOT here.
        #HTML_ROOT = public_html

        # Most FTP servers use port 21
        port = 21

        # Set to 1 to use passive mode, zero for active mode
        passive = 1

Karen K

unread,
Apr 15, 2021, 2:12:58 PM4/15/21
to weewx-user
There is the ' missing at the end of the password line. If that's the same in your original file, that's the problem. Additionally you may want to remove the comments at the end of the lines "server" and "path".

weerman

unread,
Apr 15, 2021, 5:10:11 PM4/15/21
to weewx-user
Hi,

The missing ' wasn't the problem, i forgot to add it in the post.
I tried to remove the comments at the end of server and path, but still no success

Again, here's my copy of FTP section of weewx.conf. 

Edit: Tried again changing the prefix to http but no success. 

    [[FTP]]
        # FTP'ing the results to a webserver is treated as just another report,
        # albeit one with an unusual report generator!
        skin = Ftp

        # If you wish to use FTP, set "enable" to "true", then
        # fill out the next four lines.
        # Use quotes around passwords to guard against parsing errors.
        enable = true
        user = webxxxxxx
        password = 'xxxxxxxx'
        path = /html/weewx

        # Set to True for an FTP over TLS (FTPS) connection. Not all servers
        # support this.
        secure_ftp = true

        # To upload files from something other than what HTML_ROOT is set
        # to above, specify a different HTML_ROOT here.
        #HTML_ROOT = public_html

        # Most FTP servers use port 21
        port = 21

        # Set to 1 to use passive mode, zero for active mode
        passive = 1


Here's my weewx error log file

Apr 15 21:01:13 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Apr 15 21:01:13 raspberrypi weewx[15101] INFO __main__: Initializing weewx version 4.5.1
Apr 15 21:01:13 raspberrypi weewx[15101] INFO __main__: Using Python 3.5.3 (default, Jan 19 2017, 14:11:04) #012[GCC 6.3.0 20170124]
Apr 15 21:01:13 raspberrypi weewx[15101] INFO __main__: Platform Linux-4.9.41-v7+-armv7l-with-debian-9.1
Apr 15 21:01:13 raspberrypi weewx[15101] INFO __main__: Locale is 'de_DE.UTF-8'
Apr 15 21:01:13 raspberrypi weewx[15101] INFO __main__: PID file is /var/run/weewx.pid
Apr 15 21:01:13 raspberrypi weewx[15105] INFO __main__: Using configuration file /home/weewx/weewx.conf
Apr 15 21:01:13 raspberrypi weewx[15105] INFO __main__: Debug is 0
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.engine: Loading station type FineOffsetUSB (weewx.drivers.fousb)
Apr 15 21:01:14 raspberrypi weewx[15090]: Starting weewx weather system: weewx.
Apr 15 21:01:14 raspberrypi systemd[1]: Started LSB: weewx weather system.
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.drivers.fousb: driver version is 1.20
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.drivers.fousb: polling mode is PERIODIC
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.drivers.fousb: polling interval is 60
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.drivers.fousb: found station on USB bus= device=
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.engine: StdConvert target unit is 0x1
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.engine: Archive will use data binding wx_binding
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.engine: Record generation will be attempted in 'software'
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.engine: Using archive interval of 300 seconds (software record generation)
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.restx: StationRegistry: Station will be registered.
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.restx: Wunderground: Posting not enabled.
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.restx: PWSweather: Posting not enabled.
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.restx: CWOP: Posting not enabled.
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.restx: WOW: Posting not enabled.
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.restx: AWEKAS: Posting not enabled.
Apr 15 21:01:14 raspberrypi weewx[15105] INFO __main__: Starting up weewx version 4.5.1
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.manager: Starting backfill of daily summaries
Apr 15 21:01:14 raspberrypi weewx[15105] INFO weewx.manager: Daily summaries up to date
Apr 15 21:01:15 raspberrypi weewx[15105] ERROR weewx.drivers.fousb: unrecognised magic number 0923
Apr 15 21:01:15 raspberrypi weewx[15105] INFO weewx.drivers.fousb: synchronising to the weather station (quality=1)
Apr 15 21:01:59 raspberrypi weewx[15105] INFO weewx.drivers.fousb: unstable read: blocks differ for ptr 0x000000
Apr 15 21:02:00 raspberrypi weewx[15105] INFO weewx.manager: Added record 2021-04-15 23:01:59 CEST (1618520519) to database 'weewx.sdb'
Apr 15 21:02:00 raspberrypi weewx[15105] INFO weewx.manager: Added record 2021-04-15 23:01:59 CEST (1618520519) to daily summary in 'weewx.sdb'
Apr 15 21:02:00 raspberrypi weewx[15105] INFO weewx.engine: Starting main packet loop.
Apr 15 21:02:01 raspberrypi weewx[15105] INFO weewx.restx: StationRegistry: Published record 2021-04-15 23:01:59 CEST (1618520519)
Apr 15 21:02:03 raspberrypi weewx[15105] INFO weewx.drivers.fousb: station status {'rain_overflow': 0, 'unknown': 0, 'lost_connection': 0} (0)
Apr 15 21:06:04 raspberrypi weewx[15105] INFO weewx.manager: Added record 2021-04-15 23:05:00 CEST (1618520700) to database 'weewx.sdb'
Apr 15 21:06:04 raspberrypi weewx[15105] INFO weewx.manager: Added record 2021-04-15 23:05:00 CEST (1618520700) to daily summary in 'weewx.sdb'
Apr 15 21:06:10 raspberrypi weewx[15105] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 5.76 seconds
Apr 15 21:06:16 raspberrypi weewx[15105] INFO weewx.imagegenerator: Generated 30 images for report SeasonsReport in 6.10 seconds
Apr 15 21:06:16 raspberrypi weewx[15105] INFO weewx.reportengine: Copied 5 files to /home/weewx/public_html
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine: ftpgenerator: (0): caught exception '<class 'socket.gaierror'>': [Errno -2] Der Name oder der Dienst ist nicht bekannt
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 331, in run
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      n = ftp_data.run()
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weeutil/ftpupload.py", line 133, in run
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      ftp_server.connect(self.server, self.port)
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.5/ftplib.py", line 153, in connect
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      source_address=self.source_address)
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.5/socket.py", line 694, in create_connection
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      for res in getaddrinfo(host, port, 0, SOCK_STREAM):
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****  socket.gaierror: [Errno -2] Der Name oder der Dienst ist nicht bekannt
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine: ftpgenerator: (1): caught exception '<class 'socket.gaierror'>': [Errno -2] Der Name oder der Dienst ist nicht bekannt
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 331, in run
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      n = ftp_data.run()
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weeutil/ftpupload.py", line 133, in run
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      ftp_server.connect(self.server, self.port)
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.5/ftplib.py", line 153, in connect
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      source_address=self.source_address)
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.5/socket.py", line 694, in create_connection
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      for res in getaddrinfo(host, port, 0, SOCK_STREAM):
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****  socket.gaierror: [Errno -2] Der Name oder der Dienst ist nicht bekannt
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine: ftpgenerator: (2): caught exception '<class 'socket.gaierror'>': [Errno -2] Der Name oder der Dienst ist nicht bekannt
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 331, in run
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      n = ftp_data.run()
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weeutil/ftpupload.py", line 133, in run
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      ftp_server.connect(self.server, self.port)
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.5/ftplib.py", line 153, in connect
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      source_address=self.source_address)
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.5/socket.py", line 694, in create_connection
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      for res in getaddrinfo(host, port, 0, SOCK_STREAM):
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****      for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine:         ****  socket.gaierror: [Errno -2] Der Name oder der Dienst ist nicht bekannt
Apr 15 21:06:17 raspberrypi weewx[15105] ERROR weewx.reportengine: ftpgenerator: Upload failed

Any ideas? 

Garry A Lockyer

unread,
Apr 15, 2021, 5:18:40 PM4/15/21
to weewx...@googlegroups.com
With apologies if you have already done this but I would use the Linux/Raspberry Pi OS FTP utility (sudo apt update / sudo apt install ftp if ftp is not already installed) to get ftp working outside WeeWX and then edit weewx.conf based on what I learned (outside WeeWX).

Regards,

Garry Lockyer
E: Ga...@Lockyer.ca


On Apr 15, 2021, at 14:10, weerman <mweer...@gmail.com> wrote:

Hi,
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/8552bab5-9c87-4e28-a7d4-67627767be39n%40googlegroups.com.

Les Niles

unread,
Apr 15, 2021, 5:26:36 PM4/15/21
to weewx...@googlegroups.com
And, when doing that kind of testing, I copy/paste all the parameters — server name, user name, password and directory name — from weewx.conf to the ftp utility.  Often the cause is a minor typo that is hard to spot, like substituting the letter “O” for the digit “0” or lower-case “l” for upper-case “I”.  More often than I’d like to admit….

  -Les



vince

unread,
Apr 15, 2021, 7:02:56 PM4/15/21
to weewx-user
On Thursday, April 15, 2021 at 12:03:07 AM UTC-7 weerman wrote:
My FTP is like this with any passwords and usernames xed out.

User: webXXXXXX (followed by a six digit number)
Pass:'XXXXXXXX'
Path: /html/weewx (there is a leading html folder in my ftp Setup)
Secure FTP: true

The server adress must be somewhat modified. I had already tried combinations like "ftp.rex14.flatbooster.com" but with no success.  


You can't just make up hostnames and hope to reach a solution.

rex14.flatbooster.com 'does' respond to ftp, but I'm guessing your username/password is incorrect.

Use ftp from the shell ("sudo apt-get install ftp" if you don't have it already) and try the username/password from your weewx.conf WITHOUT the quotes around the password when you try it from the shell.

It is also possible that you have secure ftp enabled in weewx but your server side doesn't support that.   When I try to 'sftp rex14.flatbooster.com' I do not get a response. and it closes the connection after perhaps 3 0seconds.   When I try unencrypted 'ftp rex14.flatbooster.com' then I 'do' get an immediate login prompt looking for username/password.

You need your client side to talk the same protocol(s) as whatever your server side is configured to talk.
 

weerman

unread,
Apr 15, 2021, 7:25:36 PM4/15/21
to weewx-user
Thanks Vince,

Got it finally working. Adding just the server name was sufficient.
Backed up the present weex.conf on a usb stick, just in case something like that ever happens again. 

Apr 16 01:12:01 raspberrypi weewx[17458] INFO weewx.engine: Starting main packet loop.
Apr 16 01:12:01 raspberrypi weewx[17458] INFO weewx.restx: StationRegistry: Published record 2021-04-16 01:12:00 CEST (1618528320)
Apr 16 01:12:03 raspberrypi weewx[17458] INFO weewx.drivers.fousb: station status {'lost_connection': 0, 'rain_overflow': 0, 'unknown': 0} (0)
Apr 16 01:16:04 raspberrypi weewx[17458] INFO weewx.manager: Added record 2021-04-16 01:15:00 CEST (1618528500) to database 'weewx.sdb'
Apr 16 01:16:04 raspberrypi weewx[17458] INFO weewx.manager: Added record 2021-04-16 01:15:00 CEST (1618528500) to daily summary in 'weewx.sdb'
Apr 16 01:16:11 raspberrypi weewx[17458] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 5.70 seconds
Apr 16 01:16:12 raspberrypi weewx[17458] INFO weewx.imagegenerator: Generated 15 images for report SeasonsReport in 1.42 seconds
Apr 16 01:16:12 raspberrypi weewx[17458] INFO weewx.reportengine: Copied 5 files to /home/weewx/public_html
Apr 16 01:16:31 raspberrypi weewx[17458] INFO weewx.reportengine: ftpgenerator: Ftp'd 74 files in 18.26 seconds
Reply all
Reply to author
Forward
0 new messages