OK - haven't tried Python3 yet - back on the rain issue.   We've had some 
rain this morning, and it is NOT picking up in WeeWx; captured some debug 
this morning; but will not be able to look at it until later today or 
perhaps over the weekend.   As I recall, this happened when I upgraded to 
4.2 and one of  fix (in addition to changes in sdr) was to add the "rain = 
prefer_hardware" line.

Will try to do some debugging over the weekend and let you know.  Working 
on a Pi based Snow Depth detector as well, since we're getting snow now.

Clay

On Monday, January 18, 2021 at 9:47:00 AM UTC-8 tke...@gmail.com wrote:

> If you're on buster, then it's simple enough to switch to Python 3. 
> Basically, just follow the directions in the Debian guide 
> <http://www.weewx.com/docs/debian.htm>:
>
> wget -qO - https://weewx.com/apt/weewx-python3.list | sudo tee 
> /etc/apt/sources.list.d/weewx.list
> sudo apt-get update
> sudo apt-get install weewx
>
>
>
> On Mon, Jan 18, 2021 at 9:33 AM Clay Jackson <radio...@gmail.com> wrote:
>
>> Don't know WHERE I got Squeeze - just checked and confirmed; it's Buster, 
>> so would definitely like to at least try to get rid of python 2.   
>>
>> On the rain = prefer_hardware, I looked at my old config files, and it 
>> seems it's "bounced" back and forth, probably depending on what version of 
>> sdr I had..   I honestly can't remember why.
>>
>> On Sunday, January 17, 2021 at 6:12:24 AM UTC-8 tke...@gmail.com wrote:
>>
>>> The type 'totalRain' has been in the code for a long time. What I'm 
>>> wondering about is where did the line
>>>
>>> rain = prefer_hardware
>>>
>>> come from. 
>>>
>>> If you are still on squeeze, you're best off staying with Python 2. Not 
>>> all of the Python 3 pre-requisites are available through the repositories.
>>>
>>> -tk
>>>
>>> On Sat, Jan 16, 2021 at 8:31 PM Clay Jackson <radio...@gmail.com> wrote:
>>>
>>>> OK - thanks.  Had a bit of a scare when I corrupted my config file and 
>>>> NOTHING would start.   I commented rain and rainRate out of StdWXCaiculate 
>>>> and looks good now.  I AM getting an N/A in RanRate om the disp;lay, but 
>>>> that's OK for the time being.   Will check when we  next get rain to see 
>>>> what happens.  
>>>>
>>>>  It would be nice to know where totalRain came from - I tried grep'ing 
>>>> for it in all the .py files and only found it in accum and units.  Before 
>>>> I 
>>>> posted, I actually commented those lines out and that did NOT work. Any 
>>>> thoughts on that?
>>>>
>>>> Also, I notice from the log I'm still using Python 2, which is what 
>>>> /usr/bin/python points to by default on squeeze, which is what I'm running 
>>>> right now.  Are there notes on how to force weewx to use python3?
>>>>
>>>> Thanks!
>>>>
>>>>
>>>>
>>>>
>>>> On Sat, Jan 16, 2021 at 5:36 PM Tom Keffer <tke...@gmail.com> wrote:
>>>>
>>>>> Try removing the line 
>>>>>
>>>>> rain = prefer_hardware
>>>>>
>>>>> It's what's causing the StdWXCalculate service to try and calculate a 
>>>>> value.
>>>>>
>>>>> I wonder where that line came from. I don't recall it ever being part 
>>>>> of weewx.conf
>>>>>
>>>>> -tk
>>>>>
>>>>> On Sat, Jan 16, 2021 at 4:58 PM Clay Jackson <radio...@gmail.com> 
>>>>> wrote:
>>>>>
>>>>>> I'm using an Accurite 5n1 - this has been working since early 3.x; 
>>>>>> just stopped in 4.3,  I AM using my 4.2 config files and skins.
>>>>>>
>>>>>> [StdWXCalculate]
>>>>>>
>>>>>>     [[Calculations]]
>>>>>>         # Derived quantities are calculated by this service. Possible 
>>>>>> values are:
>>>>>>         #  hardware        - use the value provided by hardware
>>>>>>         #  software        - use the value calculated by weewx
>>>>>>         #  prefer_hardware - use value provide by hardware if 
>>>>>> available,
>>>>>>         #                      otherwise use value calculated by weewx
>>>>>>
>>>>>>         pressure = prefer_hardware
>>>>>>         barometer = prefer_hardware
>>>>>>         altimeter = software
>>>>>>         windchill = software
>>>>>>         heatindex = software
>>>>>>         dewpoint = software
>>>>>>         inDewpoint = prefer_hardware
>>>>>>         rainRate = prefer_hardware
>>>>>>         rain = prefer_hardware
>>>>>>         ET = software
>>>>>>         maxSolarRad = prefer_hardware
>>>>>>         cloudbase = prefer_hardware
>>>>>>         humidex = prefer_hardware
>>>>>>         appTemp = prefer_hardware
>>>>>>         windrun = prefer_hardware
>>>>>>
>>>>>>
>>>>>> On Sat, Jan 16, 2021 at 4:45 PM Tom Keffer <tke...@gmail.com> wrote:
>>>>>>
>>>>>>> Normally, the driver does it, but if asked, WeeWX can calculate 
>>>>>>> 'rain' from cumulative quantities such as totalRain, by taking a 
>>>>>>> difference. 
>>>>>>>
>>>>>>> Your configuration file seems to be asking to do so, but totalRain 
>>>>>>> is not available. As for why it's asking, that's not clear.
>>>>>>>
>>>>>>> What does the section [StdWXCalculate] in your file weewx.conf look 
>>>>>>> like?
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Jan 16, 2021 at 4:17 PM Clay Jackson <radio...@gmail.com> 
>>>>>>> wrote:
>>>>>>>
>>>>>>>> I just upgraded (through apt update, using raspbian) to 4.3.0 and 
>>>>>>>> am seeing the following error. 
>>>>>>>> Jan 16 15:59:12 Weather weewx[17287] INFO __main__: PID file is 
>>>>>>>> /var/run/weewx.pid
>>>>>>>> Jan 16 15:59:12 Weather weewx[17275]: Starting weewx weather 
>>>>>>>> system: weewx.
>>>>>>>> Jan 16 15:59:12 Weather weewx[17291] INFO __main__: Using 
>>>>>>>> configuration file /etc/weewx/weewx.conf
>>>>>>>> Jan 16 15:59:12 Weather weewx[17291] INFO __main__: Debug is 0
>>>>>>>> Jan 16 15:59:12 Weather weewx[17291] INFO weewx.engine: Loading 
>>>>>>>> station type SDR (user.sdr)
>>>>>>>> Jan 16 15:59:12 Weather weewx[17291] INFO user.sdr: driver version 
>>>>>>>> is 0.78
>>>>>>>> Jan 16 15:59:12 Weather weewx[17291] INFO user.sdr: sensor map is 
>>>>>>>> {u'windDir': u'wind_dir.04C9.Acurite5n1PacketV2', u'windSpeed': 
>>>>>>>> u'wind_speed.04C9.Acurite5n1PacketV2', u'outTemp': 
>>>>>>>> u'temperature.04C9.Acurite5n1PacketV2', u'outHumidity': 
>>>>>>>> u'humidity.04C9.Acurite5n1PacketV2', u'rain_total': 
>>>>>>>> u'rain_total.04C9.Acurite5n1PacketV2', u'txBatteryStatus': 
>>>>>>>> u'battery.04C9.Acurite5n1PacketV2', u'inTemp': 
>>>>>>>> u'temperature.4:0.AmbientF007THPacket', u'inHumidity': 
>>>>>>>> u'humidity.4:0.AmbientF007THPacket', u'lightning_distance': 
>>>>>>>> u'distance.002B.AcuriteLightningPacket', u'soilTemp1': 
>>>>>>>> u'temperature_probe.0F66.Acurite00275MPacket', u'extraTemp5': 
>>>>>>>> u'temperature.0F66.Acurite00275MPacket', u'extraHumid3': 
>>>>>>>> u'humidity.0F66.Acurite00275MPacket', u'extraTemp1': 
>>>>>>>> u'temperature.002B.AcuriteLightningPacket', u'extraHumid1': 
>>>>>>>> u'humidity.002B.AcuriteLightningPacket', u'strikes_total': 
>>>>>>>> u'strikes_total.002B.AcuriteLightningPacket', u'extraTemp2': 
>>>>>>>> u'temperature.1:0.AmbientF007THPacket', u'extraTemp3': 
>>>>>>>> u'temperature.2:0.AmbientF007THPacket', u'extraTemp4': 
>>>>>>>> u'temperature.3:0.AmbientF007THPacket', u'extraHumid2': 
>>>>>>>> u'humidity.3:0.AmbientF007THPacket'}
>>>>>>>> Jan 16 15:59:12 Weather weewx[17291] INFO user.sdr: deltas is 
>>>>>>>> {u'lightning_strike_count': u'strikes_total', u'rain': u'rain_total'}
>>>>>>>> Jan 16 15:59:12 Weather weewx[17291] INFO user.sdr: startup process 
>>>>>>>> 'rtl_433 -M utc -F json'
>>>>>>>> Jan 16 15:59:12 Weather weewx[17291] INFO weewx.engine: StdConvert 
>>>>>>>> target unit is 0x1
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO weewx.engine: Archive 
>>>>>>>> will use data binding wx_binding
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO weewx.engine: Record 
>>>>>>>> generation will be attempted in 'hardware'
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO weewx.engine: Using 
>>>>>>>> archive interval of 300 seconds (specified in weewx configuration)
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO weewx.restx: 
>>>>>>>> Wunderground-PWS: Data for station KWAPROSS22 will be posted
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO weewx.restx: CWOP: Data 
>>>>>>>> for station N7QNM-13 will be posted
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO user.mqtt: service 
>>>>>>>> version is 0.23
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO user.mqtt: binding to 
>>>>>>>> archive
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO user.mqtt: topic is temps
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO user.mqtt: data will be 
>>>>>>>> uploaded to mqtt://@localhost:1883/
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO __main__: Starting up 
>>>>>>>> weewx version 4.3.0
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO weewx.engine: Using 
>>>>>>>> binding 'wx_binding' to database 'weewx'
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO weewx.manager: Starting 
>>>>>>>> backfill of daily summaries
>>>>>>>> Jan 16 15:59:13 Weather weewx[17291] INFO weewx.engine: Starting 
>>>>>>>> main packet loop.
>>>>>>>> Jan 16 15:59:34 Weather weewx[17291] INFO weewx.engine: Main loop 
>>>>>>>> exiting. Shutting engine down.
>>>>>>>> Jan 16 15:59:34 Weather weewx[17291] INFO user.sdr: shutdown 
>>>>>>>> process rtl_433 -M utc -F json
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] ERROR user.sdr: process did 
>>>>>>>> not respond to kill, shutting down anyway
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__: Caught 
>>>>>>>> unrecoverable exception:
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****  
>>>>>>>> 'totalRain'
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****  
>>>>>>>> Traceback (most recent call last):
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>> File "/usr/share/weewx/weewxd", line 154, in main
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>>   engine.run()
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>> File "/usr/share/weewx/weewx/engine.py", line 210, in run
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>>   self.dispatchEvent(weewx.Event(weewx.NEW_LOOP_PACKET, packet=packet))
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>> File "/usr/share/weewx/weewx/engine.py", line 245, in dispatchEvent
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>>   callback(event)
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>> File "/usr/share/weewx/weewx/wxservices.py", line 45, in 
>>>>>>>> new_loop_packet
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>>   self.do_calculations(event.packet)
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>> File "/usr/share/weewx/weewx/wxservices.py", line 66, in 
>>>>>>>> do_calculations
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>>   new_value = weewx.xtypes.get_scalar(obs_type, data_dict, 
>>>>>>>> self.db_manager)
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>> File "/usr/share/weewx/weewx/xtypes.py", line 71, in get_scalar
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>>   return xtype.get_scalar(obs_type, record, db_manager)
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>> File "/usr/share/weewx/weewx/wxxtypes.py", line 594, in get_scalar
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****    
>>>>>>>>   delta = weewx.wxformulas.calculate_delta(record[total_key],
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****  
>>>>>>>> KeyError: 'totalRain'
>>>>>>>> Jan 16 15:59:45 Weather weewx[17291] CRITICAL __main__:     ****  
>>>>>>>> Exiting.
>>>>>>>>
>>>>>>>> I'm using sdr to get data from an accurite 5n1. Tried some 
>>>>>>>> debugging  on my own and can't even see where totalRain is coming from 
>>>>>>>> - 
>>>>>>>> rtl_433 uses "rain_in, and sdr returns  rain_total
>>>>>>>>
>>>>>>>> Here's peces of my config
>>>>>>>> [SDR]
>>>>>>>>     # This section is for the software-defined radio driver.
>>>>>>>>
>>>>>>>>     # The driver to use
>>>>>>>>     driver = user.sdr
>>>>>>>>     path = /usr/local/bin
>>>>>>>>     #    log_unknown_sensors = True
>>>>>>>>     #    log_unmapped_sensors = True
>>>>>>>>     [[sensor_map]]
>>>>>>>>         windDir = wind_dir.04C9.Acurite5n1PacketV2
>>>>>>>>         windSpeed = wind_speed.04C9.Acurite5n1PacketV2
>>>>>>>>         outTemp = temperature.04C9.Acurite5n1PacketV2
>>>>>>>>         outHumidity = humidity.04C9.Acurite5n1PacketV2
>>>>>>>>         rain_total = rain_total.04C9.Acurite5n1PacketV2
>>>>>>>>         txBatteryStatus = battery.04C9.Acurite5n1PacketV2
>>>>>>>>         inTemp = temperature.4:0.AmbientF007THPacket
>>>>>>>>         inHumidity = humidity.4:0.AmbientF007THPacket
>>>>>>>>         lightning_distance = distance.002B.AcuriteLightningPacket
>>>>>>>>         # Garden Bed
>>>>>>>>         soilTemp1 = temperature_probe.0F66.Acurite00275MPacket
>>>>>>>>         extraTemp5 = temperature.0F66.Acurite00275MPacket
>>>>>>>>         extraHumid3 = humidity.0F66.Acurite00275MPacket
>>>>>>>>         # GreenHouse
>>>>>>>>         extraTemp1 = temperature.002B.AcuriteLightningPacket
>>>>>>>>         extraHumid1 = humidity.002B.AcuriteLightningPacket
>>>>>>>>         strikes_total = strikes_total.002B.AcuriteLightningPacket
>>>>>>>>         # Upright Freezer
>>>>>>>>         extraTemp2 = temperature.1:0.AmbientF007THPacket
>>>>>>>>         # Chest Freezer
>>>>>>>> .
>>>>>>>> .  [[deltas]]
>>>>>>>>         lightning_strike_count = strikes_total
>>>>>>>>         rain = rain_total
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> -- 
>>>>>>>> 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+...@googlegroups.com.
>>>>>>>> To view this discussion on the web visit 
>>>>>>>> https://groups.google.com/d/msgid/weewx-user/98c1d6db-d7ed-443e-ad5f-1fd3a10cb343n%40googlegroups.com
>>>>>>>>  
>>>>>>>> <https://groups.google.com/d/msgid/weewx-user/98c1d6db-d7ed-443e-ad5f-1fd3a10cb343n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> -- 
>>>>>>> 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+...@googlegroups.com.
>>>>>>> To view this discussion on the web visit 
>>>>>>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEBHeWpbLeLyt-AYrfYiyN1gmV8w%3DT0ekxNwbQfR4tDpzg%40mail.gmail.com
>>>>>>>  
>>>>>>> <https://groups.google.com/d/msgid/weewx-user/CAPq0zEBHeWpbLeLyt-AYrfYiyN1gmV8w%3DT0ekxNwbQfR4tDpzg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> -- 
>>>>>> 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+...@googlegroups.com.
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/weewx-user/CAF3aohRbMnz%3D1LAA%3DWPVux7TSh%2BBKCTAtTY3qmY_7%2B7_1sB4RQ%40mail.gmail.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/weewx-user/CAF3aohRbMnz%3D1LAA%3DWPVux7TSh%2BBKCTAtTY3qmY_7%2B7_1sB4RQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> -- 
>>>>> 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+...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEAssb9AnqG930Eeb7bVzCSOnn2dw-5Der30HipWSpL%2BhA%40mail.gmail.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/weewx-user/CAPq0zEAssb9AnqG930Eeb7bVzCSOnn2dw-5Der30HipWSpL%2BhA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>>> 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+...@googlegroups.com.
>>>>
>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/weewx-user/CAF3aohSnG3BDkL0t6J4Q7d%2BCBwaUtcnf5eGGuNfJpqTqRsQ%3DBQ%40mail.gmail.com
>>>>  
>>>> <https://groups.google.com/d/msgid/weewx-user/CAF3aohSnG3BDkL0t6J4Q7d%2BCBwaUtcnf5eGGuNfJpqTqRsQ%3DBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/0ec2aad4-4d67-4f35-8795-55d630209899n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/0ec2aad4-4d67-4f35-8795-55d630209899n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/fc4ed8cb-9b21-4d26-a810-4c2418d7575en%40googlegroups.com.

Reply via email to