Weewx won't run after fileparse install

102 views
Skip to first unread message

Ron Walker

unread,
Mar 20, 2024, 10:18:30 PM3/20/24
to weewx-user
Fresh install of weewx 5.02 on Raspberry Pi running buster.  I attempted to instll the fileparse driver manually according to readme in the direcory.  When I attempt to start weewx, this the result:

ron@WeatherPi5:~ $ sudo systemctl status weewx
* weewx.service - WeeWX
     Loaded: loaded (/lib/systemd/system/weewx.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2024-03-20 22:11:04 EDT; 4s ago
       Docs: https://weewx.com/docs
    Process: 1638 ExecStart=weewxd /etc/weewx/weewx.conf (code=exited, status=1/FAILURE)
   Main PID: 1638 (code=exited, status=1/FAILURE)
        CPU: 567ms

Mar 20 22:11:04 WeatherPi5 weewxd[1638]:           ^
Mar 20 22:11:04 WeatherPi5 weewxd[1638]: SyntaxError: invalid syntax
Mar 20 22:11:04 WeatherPi5 weewxd[1638]: CRITICAL __main__:     ****      __import__(driver)
Mar 20 22:11:04 WeatherPi5 weewxd[1638]: CRITICAL __main__:     ****    File "/etc/weewx/bin/user/fileparse.py", line 131
Mar 20 22:11:04 WeatherPi5 weewxd[1638]: CRITICAL __main__:     ****      print weeutil.weeutil.timestamp_to_string(packet['dateTime']), packet
Mar 20 22:11:04 WeatherPi5 weewxd[1638]: CRITICAL __main__:     ****            ^
Mar 20 22:11:04 WeatherPi5 weewxd[1638]: CRITICAL __main__:     ****  SyntaxError: invalid syntax
Mar 20 22:11:04 WeatherPi5 weewxd[1638]: CRITICAL __main__:     ****  Exiting.
Mar 20 22:11:04 WeatherPi5 systemd[1]: weewx.service: Main process exited, code=exited, status=1/FAILURE
Mar 20 22:11:04 WeatherPi5 systemd[1]: weewx.service: Failed with result 'exit-code'.

Any help would be greatly appreciated!

gjr80

unread,
Mar 20, 2024, 11:30:17 PM3/20/24
to weewx-user
Where did you get the fileparse.py that you manually installed? If the 'readme in the direcory' you referred to is the readme in the fileparse directory then it has a mistake. For a manual install under a WeeWX v5.x package install you should copy fileparse.py as follows:

cd /etc/weewx/examples/flippers
sudo cp bin/user/fileparse.py /etc/weewx/bin/user

The fileparse.py that you are using is different to the version distributed with v5.0.2; the line that is throwing the error uses a python2 syntax for the print statement. Under python3 print is a function that requires the uses of brackets (hence the error). Have a look in /etc/weewx/examples/fileparse/bin/user, that directory contains the fileparse.py you should be using. The version number should be 0.9. If /etc/weewx/examples/fileparse/bin/user/fileparse.py contains a python2 print statement (rather than the python3 print function) then that is a bug. Interestingly, the last version of fileparse.py to include python2 print statements was included with WeeWX v4.0.0a3 (and it only had 120 lines); I have no idea how you have ended up with the fileparse.py that you have.

Gary 

Ron Walker

unread,
Mar 22, 2024, 8:43:22 AM3/22/24
to weewx-user
Gary,

You are correct.  I'm not sure how I got the older one, unless it came over with the customizations like extensions when I copied from my backup of previous version.  All is well!  Thank you for the hints!

Ron

--
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/23296f47-f46a-4539-9393-7a7ad083d479n%40googlegroups.com
.
Reply all
Reply to author
Forward
0 new messages