Hi,

It would appear that at times the driver is getting a response from the 
bloomsky API but that response is empty. I have modified the driver to 
catch the exception, wait for the retry_wait period (10 sec by default) and 
then try again. If it continues to fail after 3 attempts that download is 
skipped. The failures will be logged. this won't fix the problem but the 
driver will now tolerate the error.

Could you replace your current bloomsky driver with the new version. To do 
this:

1. on your WeeWX machine move aside the current bloomsky driver:

$ sudo my /usr/share/weewx/user/bloomsky.py /usr/share/weewx/user/
bloomsky_orig.py

2. download the revised bloomsky driver to your WeeWX machine:

$ wget -P /usr/share/weewx/user https:
//raw.githubusercontent.com/gjr80/weewx-bloomsky/master/bin/user/bloomsky.py

3. restart WeeWX

4. monitor the log for correct operation

I am not sure how often you were seeing the IndexError, but you might want 
to browse your logs every now and then, if the error occurs you will see 
lines similar to:

Jun 23 23:20:34 stretch14 weewx[1001]: bloomsky: bloomsky-client: Invalid 
data received on attempt 1 of 3: list index out of range

Would be good to get some feedback, I have not had this issue raised by 
anyone previously plus I don't use the driver myself other than for 
testing. hopefully not a sign that the Bloomsky API is becoming flaky.

Gary

On Sunday, 23 June 2019 18:09:11 UTC+10, Rick Hewett wrote:
>
> Occasionally I see the BloomSky data collector fail. When it does so I 
> get a traceback like this in user.log: 
>
> Jun 23 03:50:06 duma weewx[19415]: 
> bloomsky: bloomsky-client: Exception: 
>  Traceback (most recent call last): 
>    File "/usr/share/weewx/user/bloomsky.py", line 674, in run 
>      self.client.collect_data() 
>    File "/usr/share/weewx/user/bloomsky.py", line 486, in collect_data 
>      data = ApiClient.extract_data(raw_data) 
>    File "/usr/share/weewx/user/bloomsky.py", line 530, in extract_data 
>      if item in data[0]: 
>  IndexError: list index out of range 
>
> Once this has happened weewx needs to be stopped and re-started before 
> data collection resumes. 
>
> Using bloomsky-1.0.0.tar.gz from github with weewx v3.9.1 
>
> -- 
> 73, Rick, M0LEP 
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/01e5182c-5ae6-43b4-95fd-608907028e93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to