Problem with Python function Weeutil

59 views
Skip to first unread message

Florentin Prevost

unread,
Mar 17, 2020, 4:28:17 PM3/17/20
to weewx-development
Hi,

I try to used a WeatherLink Live driver shared on github and ported to Weewx beta 4 but I've got an error with the weeutil function and I don't think if it remplaced by another function:

CRITICAL __main__: Caught unrecoverable exception:
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****  invalid syntax (wlldriver.py, line 216)
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****  Traceback (most recent call last):
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****    File "/home/weewx/bin/weewxd", line 148, in main
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 69, in __init__
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****      self.setupStation(config_dict)
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 92, in setupStation
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****      __import__(driver)
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****    File "/home/weewx/bin/user/wlldriver.py", line 216
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****      print weeutil.timestamp_to_string(packet['dateTime']), packet
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****                  ^
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****  SyntaxError: invalid syntax
Mar 16 19:12:49 DRSRV1 weewx[2232] CRITICAL __main__:     ****  Exiting.

You can view the full code on the attachment.

Thank you,
wlldriver.py

Florentin Prevost

unread,
Mar 17, 2020, 4:38:47 PM3/17/20
to weewx-development
EDIT: this is the true log : I've tested with others functions : 

INFO __main__: Using configuration file /home/weewx/weewx.conf
Mar 16 19:11:02 DRSRV1 weewx[2152] INFO weewx.engine: Loading station type WeatherLinkLive (user.wlldriver)
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__: Caught unrecoverable exception:
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****  invalid syntax (wlldriver.py, line 215)
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****  Traceback (most recent call last):
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****    File "/home/weewx/bin/weewxd", line 148, in main
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 69, in __init__
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****      self.setupStation(config_dict)
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 92, in setupStation
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****      __import__(driver)
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****    File "/home/weewx/bin/user/wlldriver.py", line 215
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****      print weeutil.weeutil.timestamp_to_string(packet['dateTime']), packet
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****                  ^
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****  SyntaxError: invalid syntax
Mar 16 19:11:02 DRSRV1 weewx[2152] CRITICAL __main__:     ****  Exiting.

John Kline

unread,
Mar 17, 2020, 6:29:14 PM3/17/20
to Florentin Prevost, weewx-development
The print statement at issue in the stack trace will not run under python 3.  The WeatherLinkLive driver you are using is not updated for python 3.  I do not know if there is an update to the driver that will run in WeeWX4/Python 3.  If not, you can always run WeeWX4 under Python 2.

On Mar 17, 2020, at 1:38 PM, Florentin Prevost <flor...@pre-vost.fr> wrote:


--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/7c4d7730-07b1-475f-8064-05da3d9ed899%40googlegroups.com.

Florentin Prevost

unread,
Mar 19, 2020, 5:07:27 AM3/19/20
to weewx-development
Allright, thank you for your answer. If it not possible, can we use another function or lib with python3 ? The code block just at this print line.

Thank you, 
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages