The entire log for the restart of weewx to the error follows.  Yes, I 
restarted weewx. The rtgd.py file is located in /etc/weewx/bin/user

Started weewx.service - WeeWX.
INFO __main__: Initializing weewxd version 5.2.0
INFO __main__: Command line: /usr/share/weewx/weewxd.py 
/etc/weewx/weewx.conf
INFO __main__: Using Python: 3.13.5 (main, Jun 25 2025, 18:55:22) [GCC 
14.2.0]
INFO __main__: Located at:   /usr/bin/python3
INFO __main__: Platform:     Linux-6.12.47+rpt-rpi-v8-aarch64-with-glibc2.41
INFO __main__: Locale:       'en_US'
INFO __main__: Entry path:   /usr/share/weewx/weewxd.py
INFO __main__: WEEWX_ROOT:   /etc/weewx
INFO __main__: Config file:  /etc/weewx/weewx.conf
INFO __main__: User module:  /etc/weewx/bin/user
INFO __main__: Debug:        1
INFO __main__: User:         weewx
INFO __main__: Group:        weewx
INFO __main__: Groups:       weewx
DEBUG __main__: loop_on_init: False
DEBUG __main__: Initializing engine
INFO weewx.engine: Loading station type FileParse (user.fileparse)
INFO user.fileparse: Data file is /var/tmp/weewx/data.csv
INFO user.fileparse: Polling interval is 10.0
INFO user.fileparse: Label map is {'pressure': 'pressure', 'outTemp': 
'outTemp', 'inTemp': 'inTemp', 'outHumidity': 'outHumidity', 'inHumidity': 
'inHumidity', 'windSpeed': 'windSpeed', 'windDir': 'windDir', 'windGust': 
'windGust', 'windGustDir': 'windGustDir', 'supplyVoltage': 'supplyVoltage', 
'lightLevel': 'radiation', 'rain': 'rain'}
DEBUG weewx.engine: Loading service weewx.engine.StdTimeSynch
DEBUG weewx.engine: Finished loading service weewx.engine.StdTimeSynch
DEBUG weewx.engine: Loading service weewx.engine.StdConvert
INFO weewx.engine: StdConvert target unit is 0x1
DEBUG weewx.engine: Finished loading service weewx.engine.StdConvert
DEBUG weewx.engine: Loading service weewx.engine.StdCalibrate
DEBUG weewx.engine: Finished loading service weewx.engine.StdCalibrate
DEBUG weewx.engine: Loading service weewx.engine.StdQC
DEBUG weewx.engine: Finished loading service weewx.engine.StdQC
DEBUG weewx.engine: Loading service weewx.wxservices.StdWXCalculate
INFO weewx.wxservices: StdWXCalculate will use data binding wx_binding
DEBUG weewx.manager: Daily summary version is 4.0
DEBUG weewx.engine: Finished loading service weewx.wxservices.StdWXCalculate
DEBUG weewx.engine: Loading service weewx.wxxtypes.StdWXXTypes
DEBUG weewx.engine: Finished loading service weewx.wxxtypes.StdWXXTypes
DEBUG weewx.engine: Loading service weewx.wxxtypes.StdPressureCooker
DEBUG weewx.engine: Finished loading service 
weewx.wxxtypes.StdPressureCooker
DEBUG weewx.engine: Loading service weewx.wxxtypes.StdRainRater
DEBUG weewx.engine: Finished loading service weewx.wxxtypes.StdRainRater
DEBUG weewx.engine: Loading service weewx.wxxtypes.StdDelta
DEBUG weewx.engine: Finished loading service weewx.wxxtypes.StdDelta
DEBUG weewx.engine: Loading service weewx.engine.StdArchive
INFO weewx.engine: Archive will use data binding wx_binding
INFO weewx.engine: Record generation will be attempted in 'hardware'
INFO weewx.engine: Using archive interval of 300 seconds (specified in 
weewx configuration)
DEBUG weewx.engine: Use LOOP data in hi/low calculations: 1
DEBUG weewx.engine: Finished loading service weewx.engine.StdArchive
DEBUG weewx.engine: Loading service weewx.restx.StdStationRegistry
INFO weewx.restx: StationRegistry: Registration not requested.
DEBUG weewx.engine: Finished loading service weewx.restx.StdStationRegistry
DEBUG weewx.engine: Loading service weewx.restx.StdWunderground
INFO weewx.restx: Wunderground: Posting not enabled.
DEBUG weewx.engine: Finished loading service weewx.restx.StdWunderground
DEBUG weewx.engine: Loading service weewx.restx.StdPWSweather
INFO weewx.restx: PWSweather: Posting not enabled.
DEBUG weewx.engine: Finished loading service weewx.restx.StdPWSweather
DEBUG weewx.engine: Loading service weewx.restx.StdCWOP
INFO weewx.restx: CWOP: Posting not enabled.
DEBUG weewx.engine: Finished loading service weewx.restx.StdCWOP
DEBUG weewx.engine: Loading service weewx.restx.StdWOW
INFO weewx.restx: WOW: Posting not enabled.
DEBUG weewx.engine: Finished loading service weewx.restx.StdWOW
DEBUG weewx.engine: Loading service weewx.restx.StdWOWBE
INFO weewx.restx: WOW-BE: Posting not enabled.
DEBUG weewx.engine: Finished loading service weewx.restx.StdWOWBE
DEBUG weewx.engine: Loading service weewx.restx.StdAWEKAS
INFO weewx.restx: AWEKAS: Posting not enabled.
DEBUG weewx.engine: Finished loading service weewx.restx.StdAWEKAS
DEBUG weewx.engine: Loading service weewx.engine.StdPrint
DEBUG weewx.engine: Finished loading service weewx.engine.StdPrint
DEBUG weewx.engine: Loading service weewx.engine.StdReport
INFO weewx.engine: 'pyephem' detected, extended almanac data is available
DEBUG weewx.engine: Finished loading service weewx.engine.StdReport
DEBUG weewx.engine: Loading service user.rtgd.RealtimeGaugeData
INFO user.rtgd: version is 0.5.5
DEBUG weewx.manager: Daily summary version is 4.0
INFO user.rtgd: Unknown block specified for scroller_text
INFO user.rtgd: gauge-data.txt will not be exported.
INFO user.rtgd: '/var/www/html/weewx/steelseries/gauge-data.txt' will be 
generated. min_interval is 2 seconds
DEBUG weewx.engine: Finished loading service user.rtgd.RealtimeGaugeData
INFO __main__: Starting up weewx version 5.2.0
DEBUG weewx.engine: Station does not support reading the time
INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'
INFO weewx.manager: Starting backfill of daily summaries
INFO weewx.manager: Daily summaries up to date
INFO weewx.engine: Starting main packet loop.
DEBUG weewx.manager: Daily summary version is 4.0
DEBUG weewx.manager: Daily summary version is 4.0
INFO user.rtgd: ts: 1763588923 (1763588923), self.cache[obs]['ts']: 
1763588923 (1763588923), max_age: 600 (600)
CRITICAL user.rtgd: Unexpected exception of type <class 'TypeError'>
DEBUG user.rtgd: rtgdthread: **** Traceback (most recent call last):
DEBUG user.rtgd: rtgdthread: ****   File "/etc/weewx/bin/user/rtgd.py", 
line 1825, in run
DEBUG user.rtgd: rtgdthread: ****     
self.process_packet(_package['payload'])
DEBUG user.rtgd: rtgdthread: ****     
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
DEBUG user.rtgd: rtgdthread: ****   File "/etc/weewx/bin/user/rtgd.py", 
line 1880, in process_packet
DEBUG user.rtgd: rtgdthread: ****     cached_packet = 
self.packet_cache.get_packet(_conv_packet['dateTime'],
DEBUG user.rtgd: rtgdthread: ****                                           
       self.max_cache_age)
DEBUG user.rtgd: rtgdthread: ****   File "/etc/weewx/bin/user/rtgd.py", 
line 2908, in get_packet
DEBUG user.rtgd: rtgdthread: ****     packet[obs] = self.get_value(obs, ts, 
max_age)
DEBUG user.rtgd: rtgdthread: ****                   
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
DEBUG user.rtgd: rtgdthread: ****   File "/etc/weewx/bin/user/rtgd.py", 
line 2894, in get_value
DEBUG user.rtgd: rtgdthread: ****     if obs in self.cache and ts - 
self.cache[obs]['ts'] <= max_age:
DEBUG user.rtgd: rtgdthread: ****                             
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG user.rtgd: rtgdthread: **** TypeError: '<=' not supported between 
instances of 'int' and 'str'
CRITICAL user.rtgd: Thread exiting. Reason: '<=' not supported between 
instances of 'int' and 'str'
INFO weewx.manager: Added record 2025-11-19 16:50:00 EST (1763589000) to 
database 'weewx.sdb'
INFO weewx.manager: Added record 2025-11-19 16:50:00 EST (17635890


On Wednesday, November 19, 2025 at 5:25:19 PM UTC-5 John Kline wrote:

> Is there no log message above the error you sent?  Did you restart weewx? 
>  In what directory did you change rtgd.py?
>
> On Nov 19, 2025, at 2:02 PM, 'Ron Walker' via weewx-user <
> [email protected]> wrote:
>
> John,
>
>
> Let me clarify.  I did exactly what Glen said and replaced the double 
> quotes in the line.  I then restarted weewx and got a similar error 
> message.  It looked to me as though it was pointing to the single quotes, 
> which I replaced.  I then restarted weewx and got the error in the previous 
> message.
>
> Next, I tried just retyping the line entirely and get the following error 
> along with the output from the log.info. It seems to point to the line 
> following the log.info line,which I did not touch!
>
> INFO user.rtgd: ts: 1763588923 (1763588923), self.cache[obs]['ts']: 
> 1763588923 (1763588923), max_age: 600 (600)
> CRITICAL user.rtgd: Unexpected exception of type <class 'TypeError'>
> DEBUG user.rtgd: rtgdthread: **** Traceback (most recent call last):
> DEBUG user.rtgd: rtgdthread: ****   File "/etc/weewx/bin/user/rtgd.py", 
> line 1825, in run
> DEBUG user.rtgd: rtgdthread: ****     
> self.process_packet(_package['payload'])
> DEBUG user.rtgd: rtgdthread: ****     
> ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
> DEBUG user.rtgd: rtgdthread: ****   File "/etc/weewx/bin/user/rtgd.py", 
> line 1880, in process_packet
> DEBUG user.rtgd: rtgdthread: ****     cached_packet = 
> self.packet_cache.get_packet(_conv_packet['dateTime'],
> DEBUG user.rtgd: rtgdthread: ****                                         
>          self.max_cache_age)
> DEBUG user.rtgd: rtgdthread: ****   File "/etc/weewx/bin/user/rtgd.py", 
> line 2908, in get_packet
> DEBUG user.rtgd: rtgdthread: ****     packet[obs] = self.get_value(obs, 
> ts, max_age)
> DEBUG user.rtgd: rtgdthread: ****                   
> ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
> DEBUG user.rtgd: rtgdthread: ****   File "/etc/weewx/bin/user/rtgd.py", 
> line 2894, in get_value
> DEBUG user.rtgd: rtgdthread: ****     if obs in self.cache and ts - 
> self.cache[obs]['ts'] <= max_age:
> DEBUG user.rtgd: rtgdthread: ****                             
>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> DEBUG user.rtgd: rtgdthread: **** TypeError: '<=' not supported between 
> instances of 'int' and 'str'
> CRITICAL user.rtgd: Thread exiting. Reason: '<=' not supported between 
> instances of 'int' and 'str'
>  
> The line referenced in the error:
> if obs in self.cache and ts - self.cache[obs]['ts'] <= max_age:
>
> On Wednesday, November 19, 2025 at 4:20:43 PM UTC-5 John Kline wrote:
>
>> Hey can’t be single quotes because there are single quotes inside the 
>> string.  Replace the things that look like double quotes with actual double 
>> quotes.
>>
>> On Nov 19, 2025, at 1:18 PM, 'Ron Walker' via weewx-user <
>> [email protected]> wrote:
>>
>> Glen, John,
>>
>>
>> I deleted and replaced the double and single quotes in the code.  It 
>> turns out that single quotes threw the same error when I restarted weewx.  
>> Here the log output from the restart:
>>
>> DEBUG weewx.engine: Loading service user.rtgd.RealtimeGaugeData
>> INFO user.rtgd: version is 0.5.5
>> DEBUG weewx.manager: Daily summary version is 4.0
>> INFO user.rtgd: Unknown block specified for scroller_text
>> INFO user.rtgd: gauge-data.txt will not be exported.
>> INFO user.rtgd: '/var/www/html/weewx/steelseries/gauge-data.txt' will be 
>> generated. min_interval is 2 seconds
>> DEBUG weewx.engine: Finished loading service user.rtgd.RealtimeGaugeData
>> INFO __main__: Starting up weewx version 5.2.0
>> DEBUG weewx.engine: Station does not support reading the time
>> INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'
>> INFO weewx.manager: Starting backfill of daily summaries
>> INFO weewx.manager: Empty database
>> INFO weewx.engine: Starting main packet loop.
>> DEBUG weewx.manager: Daily summary version is 4.0
>> DEBUG weewx.manager: Daily summary version is 4.0
>> CRITICAL user.rtgd: Unexpected exception of type <class 'KeyError'>
>> DEBUG user.rtgd: rtgdthread: **** Traceback (most recent call last):
>> DEBUG user.rtgd: rtgdthread: ****   File "/etc/weewx/bin/user/rtgd.py", 
>> line 1825, in run
>> DEBUG user.rtgd: rtgdthread: ****     
>> self.process_packet(_package['payload'])
>> DEBUG user.rtgd: rtgdthread: ****     
>> ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
>> DEBUG user.rtgd: rtgdthread: ****   File "/etc/weewx/bin/user/rtgd.py", 
>> line 1870, in process_packet
>> DEBUG user.rtgd: rtgdthread: ****     _conv_packet = 
>> weewx.units.to_std_system(packet,
>> DEBUG user.rtgd: rtgdthread: ****                                         
>>      self.stats_unit_system)
>> DEBUG user.rtgd: rtgdthread: ****   File 
>> "/usr/share/weewx/weewx/units.py", line 1613, in to_std_system
>> DEBUG user.rtgd: rtgdthread: ****     _datadict_target = 
>> StdUnitConverters[unit_system].convertDict(datadict)
>> DEBUG user.rtgd: rtgdthread: ****                       
>>  ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
>> DEBUG user.rtgd: rtgdthread: **** KeyError: None
>> CRITICAL user.rtgd: Thread exiting. Reason: None
>>
>> Thanks for staying with me on this!
>>
>> On Wednesday, November 19, 2025 at 2:25:37 PM UTC-5 Glenn McKechnie wrote:
>>
>>> On Thu, 20 Nov 2025 at 05:34, 'Ron Walker' via weewx-user <
>>> [email protected]> wrote:
>>>
>>>> John,
>>>>
>>>> I deleted the max_cache_age line and retyped it, in case there was any 
>>>> text I couldn't see.
>>>>
>>>> Here is the line you requested:
>>>> File "/etc/weewx/bin/user/rtgd.py", line 2893
>>>>     log.info(\u201cts: %s (%s), self.cache[obs][\u2018ts\u2019]: %s 
>>>> (%s), max_age: %s (%s)\u201d % (ts, ts, self.cache[obs][\u2018ts\u2019], 
>>>> self.cache[obs][\u2018ts\u2019], max_age, max_age))
>>>>              ^
>>>> SyntaxError: invalid character '\u201c' (U+201C)
>>>>
>>>
>>> That syntax error is the result of non-ascii characters in your log.info 
>>> string. Specifically - smart quotes. They are showing up as \u201c and 
>>> \201d instead.
>>>
>>> Where you see *" or **”*  ie :- 'double quotes' delete them and replace 
>>> them with the plain* " *character from your keyboard. Use a plain text 
>>> editor to do it and it will have no choice but to insert the correct 
>>> character. Use nano, vim or whatever is your favourite editor
>>>
>>> There is a subtle difference in their appearance and while they appear 
>>> the same, they are most definitely not.
>>>
>>>
>>> Cheers
>>>  Glenn (VK3GLN)
>>>
>>> Various WeeWx addons at
>>> https://github.com/glennmckechnie 
>>>
>> -- 
>>
>> 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 visit 
>> https://groups.google.com/d/msgid/weewx-user/449edf27-cfd2-4050-8700-a368880e9e6fn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/449edf27-cfd2-4050-8700-a368880e9e6fn%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 [email protected].
>
> To view this discussion visit 
> https://groups.google.com/d/msgid/weewx-user/5fabfcb7-59e5-46ce-aed8-ff212d348b53n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/weewx-user/5fabfcb7-59e5-46ce-aed8-ff212d348b53n%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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/weewx-user/a370729f-4993-45bd-8c35-f19e8c7bd3f4n%40googlegroups.com.

Reply via email to