Hello,
I made some progress I believe. The problem or restart seems to have disappeared ! But I don't know why...
First I did a test on a Pi3B+. I performed several stops, starts, restarts, reboots... It worked perfectly, without any error.
The configuration was the same as the Pi4 apart WeeWx 4.6.2 instead of 4.7.0.
I also checked that "wee_device --get-interval" returns "5min"
pi@weewx:~ $ sudo wee_device --get-interval
Using configuration file /etc/weewx/weewx.conf
Using TE923 driver version 0.41.1 (weewx.drivers.te923)
Interval: 5 min
Back to the Pi4/Weewx 4.7.0 with debug=1 I did the same test. The restart failed 3 times before it succeeded.
From the syslog/debug log, I believe I understood the following: (log attached)
Restart fails after "weewx.drivers.te923: read: address 0x0000fe" returns "5a 81 ..." (81 hex = 129 dec) which is a unrecognized interval value
Apr 20 16:32:39 weewx weewx[31672] DEBUG weewx.drivers.te923: read: address 0x0000fe
Apr 20 16:32:39 weewx weewx[31672] DEBUG weewx.manager: Daily summary version is 4.0
Apr 20 16:32:39 weewx weewx[31672] DEBUG weewx.manager: Daily summary version is 4.0
Apr 20 16:32:39 weewx weewx[31672] DEBUG weewx.drivers.te923: read: 5a 81 27 ae 54 15 05 14 09 a2 51 69 c0 94 24 c0 80 65 c0 3c 70 71 c0 99 23 c2 53 00 00 f1 3f 06 62 78
Apr 20 16:32:39 weewx weewx[31672] ERROR weewx.drivers.te923: Unrecognized archive interval '129'
Apr 20 16:32:39 weewx weewx[31672] INFO weewx.engine: Main loop exiting. Shutting engine down.
Apr 20 16:32:39 weewx weewx[31672] DEBUG weewx.restx: Shut down AWEKAS thread.
Apr 20 16:32:39 weewx weewx[31672] DEBUG weewx.restx: Shut down Wunderground-PWS thread.
Apr 20 16:32:39 weewx weewx[31672] DEBUG weewx.restx: Shut down StationRegistry thread.
Apr 20 16:32:39 weewx weewx[31672] CRITICAL __main__: Caught WeeWxIOError: Unrecognized archive interval '129'
Apr 20 16:32:39 weewx weewx[31672] CRITICAL __main__: **** Waiting 60 seconds then retrying...
In that situation, "wee_device --get-interval" returns "Unknown"
Restart succeeds when "read: address 0x0000fe" returns "5a 01..." 01 which is recognized by the te923 driver as a valid interval: 5min or 300s.
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.drivers.te923: read: address 0x0000fe
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.manager: Daily summary version is 4.0
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.manager: Daily summary version is 4.0
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.drivers.te923: read: 5a 01 28 ad 54 15 05 14 09 a2 51 69 c0 94 24 c0 80 65 c0 3c 70 71 c0 99 23 c2 53 00 00 f1 3f 06 62 f4
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.drivers.te923: read: address 0x0000fb
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.drivers.te923: read: 5a 22 02 06 01 28 ad 54 15 05 14 09 a2 51 69 c0 94 24 c0 80 65 c0 3c 70 71 c0 99 23 c2 53 00 00 f1 89
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.drivers.te923: record_index=1576
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.drivers.te923: count=5 oldest_addr=0x00ea33 latest_addr=0x00eacb
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.drivers.te923: get_record at address 0x00ea33 (year=2022 month=4)
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.drivers.te923: read: address 0x00ea33
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.drivers.te923: read: 5a 34 20 16 14 23 a2 47 97 c1 39 91 c1 33 94 c3 09 20 18 c2 42 21 c2 47 aa 0a 0f 3f 03 37 c2 60 00 c2
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.drivers.te923: read: address 0x00ea43
Apr 20 16:34:49 weewx weewx[31672] DEBUG weewx.drivers.te923: read: 5a 20 18 c2 42 21 c2 47 aa 0a 0f 3f 03 37 c2 60 00 56 00 01 97 0c 42 34 20 16 19 23 a2 47 95 c1 39 7e
...
Since that moment, everything works fine. I am not anymore able to reproduce the error.
A question still remains: where this 81 hex wrong value does come from ?
To be continued
Pierre-Yves