Problem with FTP upload weather station data

147 vues
Accéder directement au premier message non lu

scaram...@gmail.com

non lue,
23 févr. 2022, 11:45:0923/02/2022
à weewx-user
I am installing a new server at my station, always made with raspberry and weewx, but I do not suffer to overcome a problem: I can not load the data on my public site and as soon as I activate the service I am returned this error:
Feb 23 17:35:25 Raspberry weewx[6382] ERROR weewx.reportengine:         ****  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 104: invalid continuation byte
Feb 23 17:35:25 Raspberry weewx[6382] ERROR weewx.reportengine:         ****  Generator terminated
Feb 23 17:35:27 Raspberry weewx[6382] INFO weewx.restx: PWSWeather: Published record 2022-02-23 17:35:00 CET (1645634100)
Feb 23 17:35:35 Raspberry weewx[6382] ERROR weewx.restx: AWEKAS: Failed to publish record 2022-02-23 17:35:00 CET (1645634100): Failed upload after 3 tries
Feb 23 17:40:28 Raspberry weewx[6382] INFO weewx.manager: Added record 2022-02-23 17:40:00 CET (1645634400) to database 'weewx.sdb'
Feb 23 17:40:28 Raspberry weewx[6382] INFO weewx.manager: Added record 2022-02-23 17:40:00 CET (1645634400) to daily summary in 'weewx.sdb'
Feb 23 17:40:29 Raspberry weewx[6382] INFO weewx.restx: Windy: Published record 2022-02-23 17:40:00 CET (1645634400)
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine: Caught unrecoverable exception in generator 'weewx.reportengine.FtpGenerator'
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****  'utf-8' codec can't decode byte 0xe8 in position 104: invalid continuation byte
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 197, in run
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****      obj.start()
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 378, in start
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****      self.run()
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 429, in run
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****      n = ftp_data.run()
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weeutil/ftpupload.py", line 165, in run
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****      ftp_server.connect(self.server, self.port)
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.9/ftplib.py", line 160, in connect
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****      self.welcome = self.getresp()
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.9/ftplib.py", line 242, in getresp
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****      resp = self.getmultiline()
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.9/ftplib.py", line 228, in getmultiline
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****      line = self.getline()
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.9/ftplib.py", line 210, in getline
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****      line = self.file.readline(self.maxline + 1)
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.9/codecs.py", line 322, in decode
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****      (result, consumed) = self._buffer_decode(data, self.errors, final)
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 104: invalid continuation byte
Feb 23 17:40:29 Raspberry weewx[6382] ERROR weewx.reportengine:         ****  Generator terminated

No it's the first station I prepare... maybe the twentieth... but it's the first time I've stopped at this problem.... moment of personal stupidity.
The only difference with the past is that the operating system is raspbian bullseye
I don't understand.
Grazie

Tom Keffer

non lue,
23 févr. 2022, 12:04:2223/02/2022
à weewx-user
This has come up before. The problem is that your FTP server is returning results using the 'latin-1' encoding, instead of the far more common 'utf-8'.

The fix is to set option ftp_encoding in the [[FTP]] section.

[[FTP]]
    # (Other options as before)
    ftp_encoding = latin-1



--
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/14815a60-0651-4c38-abbc-e824be739e4an%40googlegroups.com.

scaram...@gmail.com

non lue,
23 févr. 2022, 17:28:2923/02/2022
à weewx-user
I had read, from the guide on weewx.com, that you could change the encoding of the characters with latin-1, but I did not take into account the need to change coding because I already have several other weather stations that publish on the same server and with the same encoding.
Thank you immensely Tom for the help
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message