Hi.  From time to time, it seems like my GW1000 disappears.  It looks like 
the code is trying to rediscover it, but in the process hits a bug in the 
code and crashes.  This is with weewx 4.5.1 with python 3.7.3 and GW1000 
0.41.  The syslog looks like:

Mar 15 04:14:45 raspberrypi weewx[1374] ERROR user.gw1000: Failed to obtain 
response to command 'CMD_READ_SENSOR_ID_NEW' after 3 attempts

Mar 15 04:14:45 raspberrypi weewx[1374] INFO user.gw1000: Attempting to 
re-discover GW1000...

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****  
Traceback (most recent call last):

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****    
File "/usr/share/weewx/user/gw1000.py", line 3587, in get_sensor_id

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****      
return self.send_cmd_with_retries('CMD_READ_SENSOR_ID_NEW')

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****    
File "/usr/share/weewx/user/gw1000.py", line 3740, in send_cmd_with_retries

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****      
raise GW1000IOError(_msg)

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****  
user.gw1000.GW1000IOError: Failed to obtain response to command 
'CMD_READ_SENSOR_ID_NEW' after 3 attempts

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****  

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****  
During handling of the above exception, another exception occurred:

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****  

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****  
Traceback (most recent call last):

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****    
File "/usr/share/weewx/user/gw1000.py", line 3024, in run

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****      
self.client.collect_sensor_data()

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****    
File "/usr/share/weewx/user/gw1000.py", line 2476, in collect_sensor_data

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****      
queue_data = self.get_live_sensor_data()

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****    
File "/usr/share/weewx/user/gw1000.py", line 2525, in get_live_sensor_data

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****      
self.update_sensor_id_data()

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****    
File "/usr/share/weewx/user/gw1000.py", line 2538, in update_sensor_id_data

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****      
sensor_id_data = self.station.get_sensor_id()

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****    
File "/usr/share/weewx/user/gw1000.py", line 3591, in get_sensor_id

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****      
if not self.rediscover():

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****    
File "/usr/share/weewx/user/gw1000.py", line 3928, in rediscover

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****      
gw1000_str = ', '.join([':'.join(['%s:%d' % b]) for b in device_list])

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****    
File "/usr/share/weewx/user/gw1000.py", line 3928, in <listcomp>

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****      
gw1000_str = ', '.join([':'.join(['%s:%d' % b]) for b in device_list])

Mar 15 04:15:05 raspberrypi weewx[1374] CRITICAL user.gw1000:     ****  
TypeError: not enough arguments for format string

I *think* the bug is on line 3928 in rediscover(self):

gw1000_str = ', '.join([':'.join(['%s:%d' % b]) for b in device_list])

This looks like a copy of the similar line further up in the code where the 
GW1000 is first discovered.  I'm a complete python newbie, but it looks 
like the second join in the above line wants two fields but is only getting 
one.  Shouldn't it be ".join(['%s' % (b['ip_address'],b['port'])])"? 
 That's the way the first version of gw1000_str is formed.

Cheers,

Bob Clare 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/1dc836dd-f2ba-4754-99c1-a86d7ba3f6bcn%40googlegroups.com.

Reply via email to