Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some issues with driver 0.3.1 and weewx 4.5.1 #42

Closed
gjr80 opened this issue Jun 11, 2021 · 16 comments
Closed

some issues with driver 0.3.1 and weewx 4.5.1 #42

gjr80 opened this issue Jun 11, 2021 · 16 comments

Comments

@gjr80
Copy link
Owner

gjr80 commented Jun 11, 2021

some issues with driver 0.3.1 and weewx 4.5.1 too.

Jun 10 21:31:43 sandbox python3[5721]: weewx[5721] ERROR user.gw1000:     ****    File "/usr/share/weewx/user/gw1000.py", line 3421, in check_response
Jun 10 21:31:43 sandbox python3[5721]: weewx[5721] ERROR user.gw1000:     ****      if six.indexbytes(response, 2) == six.byte2int(cmd_code):
Jun 10 21:31:43 sandbox python3[5721]: weewx[5721] ERROR user.gw1000:     ****  IndexError: index out of range
Jun 10 21:32:07 sandbox python3[5721]: weewx[5721] ERROR user.gw1000: Unexpected exception occurred while checking response to attempt 1 to send command 'CMD_READ…x out of range
Jun 10 21:32:07 sandbox python3[5721]: weewx[5721] ERROR user.gw1000:     ****  Traceback (most recent call last):
Jun 10 21:32:07 sandbox python3[5721]: weewx[5721] ERROR user.gw1000:     ****    File "/usr/share/weewx/user/gw1000.py", line 3345, in send_cmd_with_retries
Jun 10 21:32:07 sandbox python3[5721]: weewx[5721] ERROR user.gw1000:     ****      self.check_response(response, self.commands[cmd])
Jun 10 21:32:07 sandbox python3[5721]: weewx[5721] ERROR user.gw1000:     ****    File "/usr/share/weewx/user/gw1000.py", line 3421, in check_response
Jun 10 21:32:07 sandbox python3[5721]: weewx[5721] ERROR user.gw1000:     ****      if six.indexbytes(response, 2) == six.byte2int(cmd_code):
Jun 10 21:32:07 sandbox python3[5721]: weewx[5721] ERROR user.gw1000:     ****  IndexError: index out of range

Originally posted by @Zaschii in #41 (comment)

@gjr80
Copy link
Owner Author

gjr80 commented Jun 11, 2021

Am going to need some more information on this.

Is this repeatable (ie does it happen regularly), sporadic (does it happen irregularly) or a one off occurrence? If repeatable can you edit weewx.conf, set debug = 1, save weewx.conf and restart WeeWX and wait for the error to occur. Then post the WeeWX log from when you restarted WeeWX through until the error occurs. Please don't edit the log extract and make sure you include the full WeeWX startup.

Can you post the output from the following commands:

$ PYTHONPATH=/usr/share/weewx python -m user.gw1000 --sensors

and

$ PYTHONPATH=/usr/share/weewx python -m user.gw1000 --live-data

(depending on your system you might need to replace python with python3 in the above commands)

@Zaschii
Copy link

Zaschii commented Jun 11, 2021

Thanks for your quick reply.

Yesterday i restarted the gw1000 device, since this reboot the issue didnt occur again.

I will provide you the details if the issue will popup again.

BR

@Zaschii
Copy link

Zaschii commented Jun 15, 2021

OK errors are back again, so there is a issue with driver 0.3.1 and weewx 4.5.1 and the newest GW1000 firmware.

Error occurs directly after weewx restart, i attached the debug log...

weewx_issue_debug.txt

@gjr80
Copy link
Owner Author

gjr80 commented Jun 15, 2021

Thanks, am going to seen in detail the response from the GW1000. Can you edit weewx.conf, set debug = 3, save weewx.conf and restart WeeWX. This will log the actual hex bytes sent to and received from the GW1000. Hopefully it will misbehave again. Once you get the error again can you post a log extract from startup until the error occurs.

This will put a lot of data in your log so once the error occurs stop WeeWX and revert to debug = 1 (or 0) then restart WeeWX. If the error does not show up let me know and I will give you an instrumented version of the driver that can be left running as it will just log the GW1000 response when the error occurs.

@Zaschii
Copy link

Zaschii commented Jun 15, 2021

ok i will prepare the new debug output.

meanwhile here is the output of...

`root@sandbox:/var/log#PYTHONPATH=/usr/share/weewx python3 -m user.gw1000 --sensors
Using configuration file /etc/weewx/weewx.conf
debug level is '1'

IP address obtained from station config
Port number obtained from station config

Interrogating GW1000 at 192.168.XXX.XXX:45000

Sensor Status
WH65 sensor ID: c3 signal: 4 battery: 0 (OK)
WH68 sensor is registering...
WS80 sensor is registering...
WH40 sensor is registering...
WH26 sensor is registering...
WH31 ch1 sensor ID: 53 signal: 4 battery: 0 (OK)
WH31 ch2 sensor is registering...
WH31 ch3 sensor is registering...
WH31 ch4 sensor is registering...
WH31 ch5 sensor is registering...
WH31 ch6 sensor is registering...
WH31 ch7 sensor is registering...
WH31 ch8 sensor is registering...
WH51 ch1 sensor ID: c7c3 signal: 4 battery: 0 (OK)
WH51 ch2 sensor is registering...
WH51 ch3 sensor is registering...
WH51 ch4 sensor is registering...
WH51 ch5 sensor is registering...
WH51 ch6 sensor is registering...
WH51 ch7 sensor is registering...
WH51 ch8 sensor is registering...
WH41 ch1 sensor is registering...
WH41 ch2 sensor is registering...
WH41 ch3 sensor is registering...
WH41 ch4 sensor is registering...
WH57 sensor ID: d946 signal: 4 battery: 4 (OK)
WH55 ch1 sensor is registering...
WH55 ch2 sensor is registering...
WH55 ch3 sensor is registering...
WH55 ch4 sensor is registering...
WH34 ch1 sensor is registering...
WH34 ch2 sensor is registering...
WH34 ch3 sensor is registering...
WH34 ch4 sensor is registering...
WH34 ch5 sensor is registering...
WH34 ch6 sensor is registering...
WH34 ch7 sensor is registering...
WH34 ch8 sensor is registering...
WH45 sensor is registering...
WH35 ch1 sensor is registering...
WH35 ch2 sensor is registering...
WH35 ch3 sensor is registering...
WH35 ch4 sensor is registering...
WH35 ch5 sensor is registering...
WH35 ch6 sensor is registering...
WH35 ch7 sensor is registering...
WH35 ch8 sensor is registering...
`

@Zaschii
Copy link

Zaschii commented Jun 15, 2021

#PYTHONPATH=/usr/share/weewx python3 -m user.gw1000 --live-data
Using configuration file /etc/weewx/weewx.conf
debug level is '1'

IP address obtained from station config
Port number obtained from station config

Interrogating GW1000 at 192.168.XXX.XXX:45000

GW1000 live sensor data (2021-06-15 08:47:15 CEST (1623739635)): absbarometer: 967.2hPa, daymaxwind: 5kph, gustspeed: 4kph, humid1: 49%, inhumid: 46%, intemp: 24.6°C, light: 46934lx, lightningcount: 1, lightningdettime: 15-Jun-2021 06:22, lightningdist: 27.0km, outhumid: 51%, outtemp: 21.2°C, rainday: 0.0mm, rainevent: 0.0mm, rainmonth: 26.1mm, rainrate: 0.0mm/h, rainweek: 0.0mm, rainyear: 319.4mm, relbarometer: 967.2hPa, soilmoist1: 67%, temp1: 22.7°C, uv: 125W/m², uvi: 3.0, wh31_ch1_batt: 0, wh31_ch1_sig: 4, wh51_ch1_batt: 0, wh51_ch1_sig: 4, wh57_batt: 4, wh57_sig: 4, wh65_batt: 0, wh65_sig: 4, winddir: 136°, windspeed: 3kph

@Zaschii
Copy link

Zaschii commented Jun 15, 2021

debug output with debug = 3

weewx_issue_debug3.txt

@gjr80
Copy link
Owner Author

gjr80 commented Jun 15, 2021

Thank you. Are you running the GW1000 driver simultaneously as both a driver and a service?

@Zaschii
Copy link

Zaschii commented Jun 15, 2021

oh yes, thats possible.... should i remove this line from my conf file:
data_services = user.gw1000.Gw1000Service

or what would be the recommend use case?

@Zaschii
Copy link

Zaschii commented Jun 15, 2021

without this this service line i still have the following errors in the log...

Jun 15 10:01:39 sandbox weewx[24448] DEBUG user.gw1000: Failed to obtain response to attempt 1 to send command 'CMD_READ_SENSOR_ID_NEW': timed out
Jun 15 10:01:50 sandbox weewx[24448] DEBUG user.gw1000: Next update in 60 seconds
Jun 15 10:02:40 sandbox weewx[24448] DEBUG user.gw1000: Failed to obtain response to attempt 1 to send command 'CMD_READ_SENSOR_ID_NEW': timed out
Jun 15 10:02:50 sandbox weewx[24448] DEBUG user.gw1000: Next update in 60 seconds

@gjr80
Copy link
Owner Author

gjr80 commented Jun 15, 2021

The only use case I could think of to use both the driver and service would be if you had two GW1000, but then I would recommend running two instances of WeeWX rather than both the driver and service. I have never tested both the driver and service on a single WeeWX instance.

WeeWX must run with a driver but it can only run one driver. You might chose to run the GW1000 driver as a service if you had two (different) stations, for example an Acurite weather station and a GW1000. You would run the Acurite driver as the WeeWX driver and the GW1000 driver as a service. In this arrangement the Acurite driver creates the loop packets and the GW1000 driver (run as a service) augments those Acurite loop packets with data from the GW1000. Not every driver can be run as a driver or as a service, in fact most can only run as a driver.

In your case if the GW1000 is your only 'station' you should run the GW1000 driver as a driver (only). If you have another station and a GW1000 and want to amalgamate the data from both stations in the one WeeWX instance then you will need to run one driver as a driver and the other driver as a service. If your other station's driver cannot run as a service then you have no choice, it must be run as a driver and the GW1000 driver run as a service.

Hope that makes sense. Bottom line is running the GW1000 driver as a driver and service simultaneously on a single WeeWX instance is an untested configuration.

@gjr80
Copy link
Owner Author

gjr80 commented Jun 15, 2021

without this this service line i still have the following errors in the log...


Jun 15 10:01:39 sandbox weewx[24448] DEBUG user.gw1000: Failed to obtain response to attempt 1 to send command 'CMD_READ_SENSOR_ID_NEW': timed out

Jun 15 10:01:50 sandbox weewx[24448] DEBUG user.gw1000: Next update in 60 seconds

Jun 15 10:02:40 sandbox weewx[24448] DEBUG user.gw1000: Failed to obtain response to attempt 1 to send command 'CMD_READ_SENSOR_ID_NEW': timed out

Jun 15 10:02:50 sandbox weewx[24448] DEBUG user.gw1000: Next update in 60 seconds

I am guessing your GW1000 firmware is up to date? The CMD_READ_SENSOR_ID_NEW command was only implemented in firmware version 1.5.4.

Assuming the firmware is up to date can you show me a startup log with debug = 3. Same procedure as before, need to see the log from startup through until the error hits.

@Zaschii
Copy link

Zaschii commented Jun 15, 2021

Yes GW1000 is up to date, Firmware GW1000A_V1.6.8 is installed.

The last log which i attached "weewx_issue_debug3.txt" should include the startup process, if you look at the line....

Jun 15 08:55:36 sandbox systemd[1]: Starting LSB: weewx weather system...

@gjr80
Copy link
Owner Author

gjr80 commented Jun 15, 2021

Yes, but that log was when you were running both the driver and the service and it showed no Failed to obtain response... log entries. The startup portion of the log gives me detail on the WeeWX/driver config (which has changed) and the portion of the log in the lead up to the Failed to obtain response... will give me the data that was sent to the GW1000 along with any earlier responses that may have been received.

@Zaschii
Copy link

Zaschii commented Jun 15, 2021

At the moment it looks good... no errors

root@sandbox:/home/sasch#/etc/init.d/weewx status
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated)
   Active: active (running) since Tue 2021-06-15 10:07:31 CEST; 5h 43min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 24574 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)
    Tasks: 3 (limit: 2254)
   Memory: 38.3M
   CGroup: /system.slice/weewx.service
           └─24588 python3 /usr/share/weewx/weewxd --daemon --pidfile=/var/run/weewx.pid /etc/weewx/weewx.conf

Jun 15 15:40:44 sandbox python3[24588]: weewx[24588] INFO weewx.imagegenerator: Generated 15 images for report SeasonsReport in 0.39 seconds
Jun 15 15:40:44 sandbox python3[24588]: weewx[24588] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx
Jun 15 15:45:59 sandbox python3[24588]: weewx[24588] INFO weewx.restx: MQTT: Published record 2021-06-15 15:45:00 CEST (1623764700)
Jun 15 15:45:59 sandbox python3[24588]: weewx[24588] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 0.64 seconds
Jun 15 15:46:00 sandbox python3[24588]: weewx[24588] INFO weewx.imagegenerator: Generated 15 images for report SeasonsReport in 0.41 seconds
Jun 15 15:46:00 sandbox python3[24588]: weewx[24588] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx
Jun 15 15:51:02 sandbox python3[24588]: weewx[24588] INFO weewx.restx: MQTT: Published record 2021-06-15 15:50:00 CEST (1623765000)
Jun 15 15:51:02 sandbox python3[24588]: weewx[24588] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 0.64 seconds
Jun 15 15:51:03 sandbox python3[24588]: weewx[24588] INFO weewx.imagegenerator: Generated 15 images for report SeasonsReport in 0.39 seconds
Jun 15 15:51:03 sandbox python3[24588]: weewx[24588] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx

@gjr80
Copy link
Owner Author

gjr80 commented Jun 16, 2021

OK. I will close this. If it recurs you can re-open this issue.

@gjr80 gjr80 closed this as completed Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants