Gary - regarding the ssh point - which option would you recommend - change the user that runs weewx to pi, or create ssh keys for the root user (which I believe currently runs weewx)?
David. On Fri, 5 Oct 2018 at 07:10, gjr80 <[email protected]> wrote: > I presume that your working passwordless ssh is from your WeatherPi > machine. Which user on WeatherPi has passwordless ssh? If it is, for > example, user pi and WeeWX is being run as root then I expect WeeWX rsync > will fail with the error shown. You need to make sure that the account that > runs WeeWX has passwordless ssh access. So you may need to change the user > that runs WeeWX or give the account that runs WeeWX (likely root unless you > explicitly changed it) passwordless ssh access. > > Regarding pysftp, what did you do? what error did you come across? I just > tried installing with pip on my RPI running raspbian stretch: > > $ sudo pip install pysftp > > and received a dependency error on package libffi. Installed libffi using: > > $ sudo ap-get install libffi-dev > > then ran the pysftp install again and it installed without error, it was > slow but eventually it got there. If that does not solve your pysftp > issue post the command you used to install it and the output you receive. > > Gary > > On Friday, 5 October 2018 03:03:44 UTC+10, [email protected] wrote: >> >> I have recently signed up to 1&1 to host my weather website and want to >> get weewx to upload files to it, allowing for the fact that they now use >> SFTP, not plain FTP, so I can't use the FTP weewx facility. I tried to use >> Matthew Wall's weew-sftp extension, but couldn't manage to get the python >> pysftp module installed, so I thought I would try Rsync. I followed the >> steps below and can successfully ssh to my 1&1 FTP account without needing >> to type in a password. >> >> However, when I amend Rysc configuration in weewx.conf as per below, >> Rsync seems to fail. My syslog is below. The Rsync error is at the end, >> but I included earlier errors in the syslog, but not sure if they are >> related to the Rsync issue or not. >> >> Any ideas on what is going wrong? >> >> Many Thanks >> >> David. >> >> Oct 4 17:51:17 WeatherPi weewx[10224]: manager: Daily summary version is >> 2.0 >> Oct 4 17:51:17 WeatherPi weewx[10224]: reportengine: Caught >> unrecoverable exception in generator weewx.cheetahgenerator.CheetahGenerator >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** No module named >> forecast >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** Traceback (most >> recent call last): >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/share/weewx/weewx/reportengine.py", line 239, in run >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** obj.start() >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/share/weewx/weewx/reportengine.py", line 273, in start >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** self.run() >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/share/weewx/weewx/cheetahgenerator.py", line 155, in run >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** >> self.initExtensions(gen_dict[section_name]) >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/share/weewx/weewx/cheetahgenerator.py", line 197, in initExtensions >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** class_ = >> weeutil.weeutil._get_object(x) >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/share/weewx/weeutil/weeutil.py", line 1132, in _get_object >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** mod = >> __import__(module) >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** ImportError: No >> module named forecast >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** Generator terminated >> Oct 4 17:51:17 WeatherPi weewx[10224]: reportengine: Caught >> unrecoverable exception in generator weewx.imagegenerator.ImageGenerator >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** 'skin' >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** Traceback (most >> recent call last): >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/share/weewx/weewx/reportengine.py", line 239, in run >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** obj.start() >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/share/weewx/weewx/reportengine.py", line 273, in start >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** self.run() >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/share/weewx/weewx/imagegenerator.py", line 31, in run >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** self.setup() >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/share/weewx/weewx/imagegenerator.py", line 44, in setup >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** >> self.skin_dict['skin'])) >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/lib/python2.7/dist-packages/configobj.py", line 567, in __getitem__ >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** val = >> dict.__getitem__(self, key) >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** KeyError: 'skin' >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** Generator terminated >> Oct 4 17:51:17 WeatherPi weewx[10224]: reportengine: Caught >> unrecoverable exception in generator weewx.reportengine.CopyGenerator >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** 'skin' >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** Traceback (most >> recent call last): >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/share/weewx/weewx/reportengine.py", line 239, in run >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** obj.start() >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/share/weewx/weewx/reportengine.py", line 273, in start >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** self.run() >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/share/weewx/weewx/reportengine.py", line 417, in run >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** >> self.skin_dict['skin'])) >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** File >> "/usr/lib/python2.7/dist-packages/configobj.py", line 567, in __getitem__ >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** val = >> dict.__getitem__(self, key) >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** KeyError: 'skin' >> Oct 4 17:51:17 WeatherPi weewx[10224]: **** Generator terminated >> Oct 4 17:51:17 WeatherPi weewx[10224]: reportengine: Running report RSYNC >> Oct 4 17:51:17 WeatherPi weewx[10224]: reportengine: Found configuration >> file /etc/weewx/skins/Rsync/skin.conf for report RSYNC >> Oct 4 17:51:17 WeatherPi weewx[10224]: rsyncupload: [['rsync', >> '--archive', '--stats', '-e ssh', '/var/www/html/weewx/', >> '[email protected]:.']] reported errors: Host key >> verification failed.. rsync: connection unexpectedly closed (0 bytes >> received so far) [sender]. rsync error: error in rsync protocol data stream >> (code 12) at io.c(605) [sender=3.0.9] >> Oct 4 17:51:17 WeatherPi weewx[10224]: rsyncupload: rsync executed in >> 0.41 seconds >> >> >> On Monday, 23 October 2017 14:13:14 UTC+1, Geoff Cusick wrote: >>> >>> Apologies that (a) I didn't post the solution immediately I found it, >>> and (b) it's taken me a while to respond. But I did sort this out. >>> >>> The critical step is to set up passwordless SSH access to your FTP >>> account on 1and1. To do this, you need to know: >>> >>> >>> - The server address for your FTP account. In my case, this is >>> something like: >>> >>> homexxxxxxxx.1and1-data.host >>> >>> - The user name for this account, something like uXXXXXX >>> - The password for the account. >>> >>> The next step is to generate an SSH key pair for your local machine, and >>> upload the public part to the 1and1 server. There's a helpful article at >>> https://linuxconfig.org/passwordless-ssh that sets out the series of >>> steps. The location for the ssh-copy-id command is >>> [email protected] >>> >>> >>> Once you've completed this bit, and verified that you can sss to >>> [email protected] with no password request, you can >>> set up weewx to use rsync to transfer the relevant files from weewx to >>> 1and1. >>> >>> >>> The relevant part of weewx.conf is: >>> >>> >>> ****************** >>> >>> >>> [[RSYNC]] >>> # rsync'ing to a webserver is treated as just another report >>> skin = Rsync >>> >>> # If you wish to use rsync, you must configure passwordless ssh >>> using >>> # public/private key authentication from the user account that >>> weewx >>> # runs as to the user account on the remote machine where the >>> files >>> # will be copied. >>> # >>> # The following three lines determine where files will be sent. >>> #server = replace with the rsync server name, e.g, >>> www.threefools.org >>> server = homexxxxxxxx.1and1-data.host >>> #path = replace with the rsync destination directory (e.g., >>> /weather) >>> path = webroot/weather/ >>> #user = replace with the rsync username >>> user = uXXXXXXX >>> >>> # Rsync can be configured to remove files from the remote server >>> if >>> # they don't exist under HTML_ROOT locally. USE WITH CAUTION: if >>> you >>> # make a mistake in the remote path, you could could >>> unintentionally >>> # cause unrelated files to be deleted. Set to 1 to enable remote >>> file >>> # deletion, zero to allow files to accumulate remotely. >>> delete = 0 >>> >>> >>> >>> *********** >>> >>> Just to explain, the root for my web server is at /webroot on the1and1 >>> server, and all the weewx files are under weather, below that. I found >>> that I had to omit the leading '/' on /webroot. >>> >>> >>> Then you need to stop and restart weewx to implement the change to >>> weewx.conf. >>> >>> >>> Good luck!! >>> >>> >>> Geoff >>> On Sunday, 22 October 2017 20:42:12 UTC+1, Robert Isbell wrote: >>>> >>>> Andy and Geoff, >>>> I too am in the same position as Geoff. Is there a "Howto" somewhere >>>> for setting up rsync to work with 1&1. >>>> >>>> On Friday, October 6, 2017 at 3:18:29 PM UTC-7, Geoff Cusick wrote: >>>>> >>>>> Andy, >>>>> >>>>> I know this was a while back, but can you give me any pointers to >>>>> setting up rsync between weewx and a 1and1 server - they’ve recently >>>>> disabled ‘ordinary’ ftp, and my website is stuck on 24 September. >>>>> >>>>> Any hints much appreciated. >>>>> >>>>> Thanks >>>>> Geoff >>>> >>>> >>> -- > You received this message because you are subscribed to a topic in the > Google Groups "weewx-user" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/weewx-user/lC5wFBhg2g8/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
