grebleem / weewx-weatherlinkliveudp

Weewx Driver with UDP
6 stars 4 forks source link

Problem with getting data #5

Closed c0by85 closed 4 years ago

c0by85 commented 4 years ago

hi,

got a problem with your weewx driver.

service weewx status
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated; vendor preset: enabled)
   Active: active (exited) since Thu 2020-07-09 14:50:06 CEST; 2min 1s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 13538 ExecStop=/etc/init.d/weewx stop (code=exited, status=0/SUCCESS)
  Process: 13655 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)

Jul 09 14:50:06 pi2 python2[13675]: weewx[13675] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
Jul 09 14:50:06 pi2 python2[13675]: weewx[13675] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 69, in __init__
Jul 09 14:50:06 pi2 python2[13675]: weewx[13675] CRITICAL __main__:     ****      self.setupStation(config_dict)
Jul 09 14:50:06 pi2 python2[13675]: weewx[13675] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 92, in setupStation
Jul 09 14:50:06 pi2 python2[13675]: weewx[13675] CRITICAL __main__:     ****      __import__(driver)
Jul 09 14:50:06 pi2 python2[13675]: weewx[13675] CRITICAL __main__:     ****    File "/usr/share/weewx/user/weatherlinkliveudp.py", line 113
Jul 09 14:50:06 pi2 python2[13675]: weewx[13675] CRITICAL __main__:     ****      logdbg(f'Bucketsize is set at 0.1 in')
Jul 09 14:50:06 pi2 python2[13675]: weewx[13675] CRITICAL __main__:     ****                                          ^
Jul 09 14:50:06 pi2 python2[13675]: weewx[13675] CRITICAL __main__:     ****  SyntaxError: invalid syntax
Jul 09 14:50:06 pi2 python2[13675]: weewx[13675] CRITICAL __main__:     ****  Exiting.
curl -s http://192.168.1.7/v1/current_conditions | jq '.'
{
  "data": {
    "did": "x",
    "ts": x,
    "conditions": [
      {
        "lsid": x,
        "data_structure_type": 1,
        "txid": 1,
        "temp": 68.7,
        "hum": 69.5,
        "dew_point": 58.3,
        "wet_bulb": 61.4,
        "heat_index": 68.7,
        "wind_chill": 68.7,
        "thw_index": 68.7,
        "thsw_index": null,
        "wind_speed_last": 4.31,
        "wind_dir_last": 154,
        "wind_speed_avg_last_1_min": 3.68,
        "wind_dir_scalar_avg_last_1_min": 201,
        "wind_speed_avg_last_2_min": 4.12,
        "wind_dir_scalar_avg_last_2_min": 202,
        "wind_speed_hi_last_2_min": 8,
        "wind_dir_at_hi_speed_last_2_min": 167,
        "wind_speed_avg_last_10_min": 3.56,
        "wind_dir_scalar_avg_last_10_min": 185,
        "wind_speed_hi_last_10_min": 9.37,
        "wind_dir_at_hi_speed_last_10_min": 155,
        "rain_size": 2,
        "rain_rate_last": 0,
        "rain_rate_hi": 0,
        "rainfall_last_15_min": 0,
        "rain_rate_hi_last_15_min": 0,
        "rainfall_last_60_min": 0,
        "rainfall_last_24_hr": null,
        "rain_storm": null,
        "rain_storm_start_at": null,
        "solar_rad": null,
        "uv_index": null,
        "rx_state": 0,
        "trans_battery_flag": 0,
        "rainfall_daily": 0,
        "rainfall_monthly": 0,
        "rainfall_year": 0,
        "rain_storm_last": null,
        "rain_storm_last_start_at": null,
        "rain_storm_last_end_at": null
      },
      {
        "lsid": x,
        "data_structure_type": 4,
        "temp_in": 78.1,
        "hum_in": 51,
        "dew_point_in": 58.5,
        "heat_index_in": 78.2
      },
      {
        "lsid": x,
        "data_structure_type": 3,
        "bar_sea_level": 29.952,
        "bar_trend": null,
        "bar_absolute": 29.668
      }
    ]
  },
  "error": null
}
grebleem commented 4 years ago

Hi, are you running Python 2? The driver works only with Python 3 at the moment. Sorry for the inconvenience.

c0by85 commented 4 years ago

Opps. My fault, sorry, i change the version.

python -V
Python 2.7.13
c0by85 commented 4 years ago

Changed the version, same result.

root@pi2 ~ # lsb_release -a && uname -a && service weewx status
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.11 (stretch)
Release:        9.11
Codename:       stretch
Linux pi2 5.4.47-v7+ #1322 SMP Wed Jun 17 17:52:39 BST 2020 armv7l GNU/Linux
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated; vendor preset: enabled)
   Active: active (exited) since Thu 2020-07-09 15:40:49 CEST; 1min 48s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 371 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/weewx.service

Jul 09 15:40:49 pi2 python2[515]: weewx[515] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
Jul 09 15:40:49 pi2 python2[515]: weewx[515] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 69, in __init__
Jul 09 15:40:49 pi2 python2[515]: weewx[515] CRITICAL __main__:     ****      self.setupStation(config_dict)
Jul 09 15:40:49 pi2 python2[515]: weewx[515] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 92, in setupStation
Jul 09 15:40:49 pi2 python2[515]: weewx[515] CRITICAL __main__:     ****      __import__(driver)
Jul 09 15:40:49 pi2 python2[515]: weewx[515] CRITICAL __main__:     ****    File "/usr/share/weewx/user/weatherlinkliveudp.py", line 113
Jul 09 15:40:49 pi2 python2[515]: weewx[515] CRITICAL __main__:     ****      logdbg(f'Bucketsize is set at 0.1 in')
Jul 09 15:40:49 pi2 python2[515]: weewx[515] CRITICAL __main__:     ****                                          ^
Jul 09 15:40:49 pi2 python2[515]: weewx[515] CRITICAL __main__:     ****  SyntaxError: invalid syntax
Jul 09 15:40:49 pi2 python2[515]: weewx[515] CRITICAL __main__:     ****  Exiting.
root@pi2 ~ # python -V
Python 3.5.3
root@pi2 ~ #
c0by85 commented 4 years ago

Or does it only work with Python 3 when weewx is installed manually? Currently it is installed via package.

grebleem commented 4 years ago

When I start programming I used the new f-strings a lot. These new strings where introduced in Python v3.6 (late 2016). If you are familiar with pyenv it is very easy to change Python versions.

https://realpython.com/intro-to-pyenv/

c0by85 commented 4 years ago

i will change to an new systen with python 3 and debian 10. thanks in advance.