matthewwall / weewx-netatmo

weewx driver for netatmo weather station
GNU General Public License v3.0
7 stars 16 forks source link

Doesn't work on WeeWX 4.0.0 #15

Open hapklaar opened 4 years ago

hapklaar commented 4 years ago

Installed the driver using the provided instructions, however not option to choose Netatmo driver after running wee_config --reconfigure. When manually setting the driver, the following is shown in syslog:

May 12 23:44:14 HapPiHyper weewx[996] INFO __main__: Initializing weewx version 4.0.0
May 12 23:44:14 HapPiHyper weewx[996] INFO __main__: Using Python 3.7.3 (default, Dec 20 2019, 18:57:59) #012[GCC 8.3.0]
May 12 23:44:14 HapPiHyper weewx[996] INFO __main__: Platform Linux-4.19.97-v7+-armv7l-with-debian-10.4
May 12 23:44:14 HapPiHyper weewx[996] INFO __main__: Locale is 'en_US.UTF-8'
May 12 23:44:14 HapPiHyper weewx[996] INFO __main__: PID file is /var/run/weewx.pid
May 12 23:44:14 HapPiHyper weewx[1000] INFO __main__: Using configuration file /etc/weewx/weewx.conf
May 12 23:44:14 HapPiHyper weewx[1000] INFO weewx.engine: Loading station type netatmo (user.netatmo)
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__: Caught unrecoverable exception:
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****  Missing parentheses in call to 'print'. Did you mean print("Specify the mode for obtaining data, either 'cloud' or 'sniff'")? (netatmo.py, line 101)
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****  Traceback (most recent call last):
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****    File "/usr/share/weewx/weewxd", line 148, in main
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 69, in __init__
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****      self.setupStation(config_dict)
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 92, in setupStation
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****      __import__(driver)
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****    File "/usr/share/weewx/user/netatmo.py", line 101
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****      print "Specify the mode for obtaining data, either 'cloud' or 'sniff'"
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****                                                                           ^
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****  SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Specify the mode for obtaining data, either 'cloud' or 'sniff'")?
May 12 23:44:14 HapPiHyper weewx[1000] CRITICAL __main__:     ****  Exiting.
May 12 23:44:14 HapPiHyper weewx[984]: Starting weewx weather system: weewx.
May 12 23:44:14 HapPiHyper systemd[1]: Started LSB: weewx weather system.

This is on a Rpi 3 with Buster release and WeeWX installed using these instruction:

   12  wget -qO - http://weewx.com/keys.html | sudo apt-key add -
   13  wget -qO - http://weewx.com/apt/weewx-python3.list | sudo tee /etc/apt/sources.list.d/weewx.list
   14  sudo apt update
   15  sudo apt install weewx
thk70 commented 4 years ago

+1 (also issue in Ubuntu 20.04)

kwalker05 commented 4 years ago

I ran into the same issue with a fresh Ubuntu 20.04/WeeWX4 install. Until there's an update, I band-aided using lib2to3 to convert bin/user/netatmo.py to Python3. There was one more edit I had to manually make on line 521 because it was barking about the params being a str; just added .encode("utf-8") after the urlencode.

EcstaticMark commented 4 years ago

Same issue, Ubuntu 20.04 LTS.

jult commented 4 years ago

Same same in Debian 10, still, unfortunately.


Jun 30 10:45:34 sugar weewx[7137] INFO __main__: Using Python 3.7.3 (default, Dec 20 2019, 18:57:59) #012[GCC 8.3.0]
Jun 30 10:45:34 sugar weewx[7137] INFO __main__: Platform Linux-4.19.0-9-amd64-x86_64-with-debian-10.4
Jun 30 10:45:34 sugar weewx[7137] INFO __main__: Locale is 'en_US.UTF-8'
Jun 30 10:45:34 sugar weewx[7137] INFO __main__: PID file is /var/run/weewx.pid
Jun 30 10:45:34 sugar weewx[7141] INFO __main__: Using configuration file /etc/weewx/weewx.conf
Jun 30 10:45:34 sugar weewx[7141] INFO __main__: Debug is 0
Jun 30 10:45:34 sugar weewx[7141] INFO weewx.engine: Loading station type netatmo (user.netatmo)
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__: Caught unrecoverable exception:
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****  Missing parentheses in call to 'print'. Did you mean print("Specify the mode for obtaining data, either 'cloud' or 'sniff'")? (netatmo.py, line 101)
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****  Traceback (most recent call last):
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****    File "/usr/share/weewx/weewxd", line 148, in main
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 69, in __init__
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****      self.setupStation(config_dict)
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 92, in setupStation
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****      __import__(driver)
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****    File "/usr/share/weewx/user/netatmo.py", line 101
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****      print "Specify the mode for obtaining data, either 'cloud' or 'sniff'"
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****                                                                           ^
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****  SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Specify the mode for obtaining data, either 'cloud' or 'sniff'")?
Jun 30 10:45:34 sugar weewx[7141] CRITICAL __main__:     ****  Exiting.
Jun 30 10:45:34 sugar weewx[7126]: Starting weewx weather system: weewx.
Jun 30 10:45:34 sugar systemd[1]: Started LSB: weewx weather system.```
EB5TC commented 4 years ago

+1 Not option to choose Netatmo driver after running wee_config --reconfigure Doesn't works 😢

bricebou commented 4 years ago

I ran into the same issue with a fresh Ubuntu 20.04/WeeWX4 install. Until there's an update, I band-aided using lib2to3 to convert bin/user/netatmo.py to Python3. There was one more edit I had to manually make on line 521 because it was barking about the params being a str; just added .encode("utf-8") after the urlencode.

Try this workaround but the netatmo driver dosen't show in the drivers list while reconfiguring weewx...

Anyway, I "force" the driver and after some minor modifications with the print statements (parenthesis needed), I have this error:

$ tail -f /var/log/syslog
Aug 22 11:17:01 pidubrac weewx[14274] CRITICAL __main__:     ****      self.setupStation(config_dict)
Aug 22 11:17:01 pidubrac weewx[14274] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 92, in setupStation
Aug 22 11:17:01 pidubrac weewx[14274] CRITICAL __main__:     ****      __import__(driver)
Aug 22 11:17:01 pidubrac weewx[14274] CRITICAL __main__:     ****    File "/usr/share/weewx/user/netatmo.py", line 321
Aug 22 11:17:01 pidubrac weewx[14274] CRITICAL __main__:     ****      except (socket.error, socket.timeout, urllib2.HTTPError, urllib2.URLError), e:
Aug 22 11:17:01 pidubrac weewx[14274] CRITICAL __main__:     ****                                                                                ^
Aug 22 11:17:01 pidubrac weewx[14274] CRITICAL __main__:     ****  SyntaxError: invalid syntax
Aug 22 11:17:01 pidubrac weewx[14274] CRITICAL __main__:     ****  Exiting.

Any idea ? Thanks in advance !

Korvenwin commented 4 years ago

I'm having the same issue. It appears that the project is forgotten. :(

bricebou commented 4 years ago

One "solution" is to use the latest 3.x version of WeeWX as described in this post I've wrote (in french) : https://momh.fr/blog/station-meteo-netatmo-and-weewx

bricebou commented 4 years ago

Hey ! Using 2to3 tool, I've managed to "upgrade" this netatmo driver to Python 3 and to make it work with weewx 4.*.

Here is the fork I've made : https://github.com/bricebou/weewx-netatmo

kwalker05 commented 4 years ago

Nice. You've done the exact same thing I did back with my May 14th response with lib2to3 and that extra fix.

Why fork versus a pull request? I should have done that at the time, but time was limited.

bricebou commented 4 years ago

Hum... My first attempt at using 2to3 was not a success... so I've used a version 3 .9 of WeeWX... I forked because I wasn't sure of what I wanted to achieve... and I'm not really familiar with Git and pull requests... :-/