matthewwall / weewx-influx

uploader for influxdb
GNU General Public License v3.0
45 stars 22 forks source link

weewx failed to start with influx extension #23

Closed knackko closed 4 years ago

knackko commented 4 years ago

Since updating my raspbian to buster, it seems that influx extension for weewx can not start anymore even after reinstalling the module, it seems to be a syntax error from influx extension script:

May 08 14:40:32 knadock python3[6539]: weewx[6539] CRITICAL __main__:     ****      self.loadServices(config_dict)
May 08 14:40:32 knadock python3[6539]: weewx[6539] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 138, in loadServices
May 08 14:40:32 knadock python3[6539]: weewx[6539] CRITICAL __main__:     ****      obj = weeutil.weeutil.get_object(svc)(self,config_dict)
May 08 14:40:32 knadock python3[6539]: weewx[6539] CRITICAL __main__:     ****    File "/usr/share/weewx/weeutil/weeutil.py", line 1093, in get_object
May 08 14:40:32 knadock python3[6539]: weewx[6539] CRITICAL __main__:     ****      mod = __import__(module)
May 08 14:40:32 knadock python3[6539]: weewx[6539] CRITICAL __main__:     ****    File "/usr/share/weewx/user/influx.py", line 249
May 08 14:40:32 knadock python3[6539]: weewx[6539] CRITICAL __main__:     ****      except KeyError, e:
May 08 14:40:32 knadock python3[6539]: weewx[6539] CRITICAL __main__:     ****                     ^
May 08 14:40:32 knadock python3[6539]: weewx[6539] CRITICAL __main__:     ****  SyntaxError: invalid syntax
May 08 14:40:32 knadock python3[6539]: weewx[6539] CRITICAL __main__:     ****  Exiting.
mdallaire commented 4 years ago

I am seeing the same behavior with my install after upgrading to weewx 4. The extension probably needs to be updated for python3.

knackko commented 4 years ago

Yes, Found part of the solution in /usr/share/weewx/user/influx.py:

Instead of except KeyError, name: try except KeyError as name:

knackko commented 4 years ago

I succeed to make it work with python3, but it miss influx auth part, working on it.

knackko commented 4 years ago

Here is /usr/share/weewx/user/influx.py for python3, to test. Influx auth does not work.

influx.py.zip

knackko commented 4 years ago

I am seeing the same behavior with my install after upgrading to weewx 4. The extension probably needs to be updated for python3.

You should look at the work already done in this pull request: https://github.com/matthewwall/weewx-influx/pull/22

Gonna test it.

matthewwall commented 4 years ago

please try weewx-influx v0.14