themoosman / weewx-ambientweatherapi-json

An AmbientWeather API driver for the weewx weather software using JSON.
14 stars 0 forks source link

Error on startup #1

Closed cyberralf83 closed 4 years ago

cyberralf83 commented 4 years ago

Hey, Thank you so much for making this driver. It could be useful to a lot of people. I am getting an error when starting it up. I've installed it through "pip install ambient_api" and then added the two .py files to /usr/share/weewx/user and also edited the /etc/weewx/weewx.conf file with the api key and user.ambientweatherapi. Thanks again.

Here is the log. May 25 01:26:05 PiBridge systemd[1]: Starting LSB: weewx weather system... May 25 01:26:05 PiBridge weewx[5467] INFO main: Initializing weewx version 4.0.0 May 25 01:26:05 PiBridge weewx[5467] INFO main: Using Python 3.7.3 (default, Dec 20 2019, 18:57:59) #012[GCC 8.3.0] May 25 01:26:05 PiBridge weewx[5467] INFO main: Platform Linux-4.19.97-v7l+-armv7l-with-debian-10.4 May 25 01:26:05 PiBridge weewx[5467] INFO main: Locale is 'en_US.UTF-8' May 25 01:26:05 PiBridge weewx[5467] INFO main: PID file is /var/run/weewx.pid May 25 01:26:05 PiBridge weewx[5471] INFO main: Using configuration file /etc/weewx/weewx.conf May 25 01:26:05 PiBridge weewx[5471] INFO weewx.engine: Loading station type ambientweatherapi (user.ambientweatherapi) May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: Caught unrecoverable exception: May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: invalid syntax (ambientweatherapi.py, line 266) May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: Traceback (most recent call last): May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: File "/usr/share/weewx/weewxd", line 148, in main May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: engine = weewx.engine.StdEngine(config_dict) May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: File "/usr/share/weewx/weewx/engine.py", line 69, in init May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: self.setupStation(config_dict) May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: File "/usr/share/weewx/weewx/engine.py", line 92, in setupStation May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: import(driver) May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: File "/usr/share/weewx/user/ambientweatherapi.py", line 266 May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: print weeutil.weeutil.timestamp_to_string(packet['dateTime']), packet May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: ^ May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: SyntaxError: invalid syntax May 25 01:26:05 PiBridge weewx[5471] CRITICAL main: **** Exiting.

Thanks again.

themoosman commented 4 years ago

Huh, so I wasn't aware that Weewx 4.0 with Python3 support got released. Let me upgrade my instance and submit a fix for this issue.