Weewx stops working on Raspberry Pi

1,082 views
Skip to first unread message

Eirik Skorstad

unread,
Oct 6, 2013, 11:08:47 AM10/6/13
to weewx...@googlegroups.com
Running weewx on a rasberry pi with mysql on another server. Seems like that there is a problem with weewx when it loose connection with the the database. Also the raspberry pi it self stops working when this happens, and I have to force a restart by unplugging power cable... 

Anybody else have the same experience? 

Andrew Milner

unread,
Oct 6, 2013, 11:54:46 AM10/6/13
to weewx...@googlegroups.com
I run mysql on the Pi itself so do not have a problem of remote databases!

Eirik Skorstad

unread,
Oct 6, 2013, 4:32:18 PM10/6/13
to weewx...@googlegroups.com
How much space do you think it will use per year?

Andrew Milner

unread,
Oct 7, 2013, 12:44:41 AM10/7/13
to weewx...@googlegroups.com
That will depend on the archive frequency to give a sensible answer.  I will admit that I have an old external USB pocket drive attached to my pi and powered off my 7 port powered hub

Per Edström

unread,
Oct 8, 2013, 1:12:03 PM10/8/13
to weewx...@googlegroups.com
I have WMR200 on R.Pi running weewx on Weezy (Debian).

It will hang from time to time so I too have to power-reboot it. Now I set a cronjob to reboot the R.Pi every Sunday and also restart weewx every night. I have yet to evaluate how it's working though..

# m h  dom mon dow   command

3 0 * * * /etc/init.d/weewx stop
4 0 * * * /etc/init.d/weewx start
1 0 * * 0 reboot

It seems to restart weewx at least..

Weewx uptime: 0 days, 19 hours, 8 minutes
Server uptime: 4 days, 20 hours, 44 minutes
weewx v2.4.0

Thomas Keffer

unread,
Oct 8, 2013, 3:55:52 PM10/8/13
to weewx-user
Why does weewx need to be restarted? If it is crashing, that's a bug and I'd like to know the details.

-tk


--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Tom Keffer
kef...@threefools.org
+1 541-386-8891 (h)
+1 541-490-9507 (c)
Skype: tkeffer

Per Edström

unread,
Oct 8, 2013, 4:37:42 PM10/8/13
to weewx...@googlegroups.com
I might also be Weezy, the OS on R.Pi, that causes problem. First Weewx stops working then R.Pi becomes unaccessible and needs power-reboot.

Does Weewx write anything in syslog if it encounbters problem?

Thomas Keffer

unread,
Oct 8, 2013, 5:30:33 PM10/8/13
to weewx-user
It catches all exceptions and writes them to the syslog. Simple I/O exceptions (cannot open console, etc.) are retried. More serious exceptions cause program termination. 

It should never just quietly go away.

-tk


On Tue, Oct 8, 2013 at 1:37 PM, Per Edström <peredst...@gmail.com> wrote:
I might also be Weezy, the OS on R.Pi, that causes problem. First Weewx stops working then R.Pi becomes unaccessible and needs power-reboot.

Does Weewx write anything in syslog if it encounbters problem?

--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

vds

unread,
Oct 8, 2013, 5:51:40 PM10/8/13
to weewx...@googlegroups.com
On Sunday, October 6, 2013 8:08:47 AM UTC-7, Eirik Skorstad wrote:
Running weewx on a rasberry pi with mysql on another server. Seems like that there is a problem with weewx when it loose connection with the the database. Also the raspberry pi it self stops working when this happens, and I have to force a restart by unplugging power cable... 

Anybody else have the same experience?

Might not be weewx at fault.

I've found my Pi seems extraordinarily sensitive to power flicker.  All I use mine for is running 'motion' to do a timelapse movie snap once per minute, plus service an incoming scp session to slurp the movie off of the box a few times per hour.   Unfortunately I have it plugged straight into the wall (not to a surge suppressor) and it's generally the only box that gets stupid occasionally.

I know it's house power related because I can tell when the clock on the range in the kitchen downstairs indicated PF (power fail) even though everything else in the house stayed up.

One downside of the pi is all the logs go 'poof' when you reboot it if you're running in ramdisk off SD card.  Having a traditional spinning disk os and being able to see  what the logs showed 'before' the hang is usually pretty helpful.


Gino De Cock

unread,
Oct 8, 2013, 6:12:02 PM10/8/13
to weewx...@googlegroups.com
No problem here

Per Edström

unread,
Oct 9, 2013, 4:19:37 AM10/9/13
to weewx...@googlegroups.com
No I think weewx was still running but could not "talk to"/receive data from the WMR200, something like this:

Sep 30 11:46:55 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:47:10 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:47:25 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:47:40 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:47:55 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available

Therefore no files were generated nor uploaded.

It I remember correctly, to restart weewx fixed that but then there was some issues with the Weezy OS so that I could not access it via SSH if it was left with too much uptime, hence the weekly reboot.

I don't know if it is a driver-issue or a WMR200-HW-issue. At that time I also had problem with the console-time vs R.Pi-time. Maybe that caused it? I can try to remove my cronjob and see if weewx behaves the same way now..

Eirik Skorstad

unread,
Oct 9, 2013, 8:03:50 AM10/9/13
to weewx...@googlegroups.com
Seems to me that this is a Wheezy problem. It is completly unresponsive after this happens. Fault searching is not very easy as the logs are deleted every time i reboot.. Doh!

Are you connected with wireless or cable? 
--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/AFDE424PQqA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Thomas Keffer

unread,
Oct 9, 2013, 9:17:33 AM10/9/13
to weewx-user
Looking through the WMR200 device driver (I did not write it), whenever there are no data on the USB bus, it emits this message. It then emits a heartbeat command to tell the console to start streaming again. This is a normal thing, so it should not tag it as a full-blow "error" (syslog.LOG_ERR). At worst, it's a DEBUG message. 

But, you say that after such a message weewx cannot talk to the console at all?

-tk

Tom Keffer
kef...@threefools.org
+1 541-386-8891 (h)
+1 541-490-9507 (c)
Skype: tkeffer


--

Per Edström

unread,
Oct 9, 2013, 10:35:06 AM10/9/13
to weewx...@googlegroups.com
Yes, pretty much so. It never gains contact again so maybe the heartbeat doesn't work fully..

In this logfile the connection problem was over 4 hours until I SSH.ed in and rebooted:

Sep 30 06:25:22 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 06:25:37 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 06:25:52 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 06:26:07 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 06:26:22 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 06:26:37 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 06:26:52 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 06:27:07 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 06:27:22 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
:
:
Sep 30 11:42:40 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:42:55 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:43:10 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:43:25 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:43:40 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:43:55 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:44:10 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:44:25 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:44:40 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:44:55 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:45:10 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:45:25 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:45:40 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:45:55 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:46:10 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:46:25 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:46:40 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available

Sep 30 11:46:55 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:47:10 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:47:25 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:47:40 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:47:55 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:48:10 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:48:25 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:48:40 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:48:55 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:49:10 raspberrypi weewx[2201]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Sep 30 11:49:14 raspberrypi shutdown[4470]: shutting down for system reboot
Sep 30 11:49:14 raspberrypi init: Switching to runlevel: 6
Sep 30 11:49:14 raspberrypi ifplugd(eth0)[1538]: Exiting.

Corbin Dallas

unread,
Oct 9, 2013, 12:20:41 PM10/9/13
to weewx...@googlegroups.com
I had this problem when I was running 1.14.  Everything would run great for about 2 weeks, but at some point between 14 and 20 days, Weewx would stop reading data from the console and parts of the program seemed to crash.  Just re-starting weewx didn't seem to fix issues, I had to re-boot.  I am not Linux savy enough to work out just what the source of the problem was.
 
But since I switched to 2.3, I have not seen this issue and I've run the computer as long as 60 days without a reboot and then it was rebooted for other, power related issues. 
 
What version of the program are you using?
 

On Sunday, October 6, 2013 8:08:47 AM UTC-7, Eirik Skorstad wrote:

Thomas Keffer

unread,
Oct 9, 2013, 12:25:46 PM10/9/13
to weewx...@googlegroups.com

Corbin, what kind of weather station are you using?

-tk
Fat-fingered from my smartphone.

--

Per Edström

unread,
Oct 9, 2013, 1:31:01 PM10/9/13
to weewx...@googlegroups.com
I run Weewx 2.4.0 and the latest release of Wheezy.
HW: Rev.2 of R.Pi (512MB) and 16GB Transcend SD-card.
WMR200

Andrew Milner

unread,
Oct 10, 2013, 1:04:23 AM10/10/13
to weewx...@googlegroups.com
Erik - well so far 3.5 years is 44 Mb using mysql according to php, with an archive interval of 5 minutes for most of that time (some very old data was at 10 minute intervals and came from Cumulus)

Andrew

On Sunday, 6 October 2013 23:32:18 UTC+3, Eirik Skorstad wrote:

Per Edström

unread,
Oct 11, 2013, 4:38:44 AM10/11/13
to weewx...@googlegroups.com
I manually rebooted R.Pi last night but just 3 hour and 20 minutes (200 minutes if this is a bug-value?) later the WMR200 stopped sending data and never recovered..

"
Weewx uptime: 0 days, 3 hours, 20 minutes
Server uptime: 0 days, 3 hours, 20 minutes
weewx v2.4.0
"

Oct 11 03:35:41 raspberrypi weewx[2197]: ftpupload: Uploaded file /vader/NOAA/NOAA-2013-10.txt
Oct 11 03:35:41 raspberrypi weewx[2197]: ftpupload: Uploaded file /vader/NOAA/NOAA-2013.txt
Oct 11 03:35:42 raspberrypi weewx[2197]: ftpupload: Uploaded file /vader/smartphone/wind.html
Oct 11 03:35:43 raspberrypi weewx[2197]: ftpupload: Uploaded file /vader/smartphone/index.html
Oct 11 03:35:44 raspberrypi weewx[2197]: ftpupload: Uploaded file /vader/smartphone/radar.html
Oct 11 03:35:44 raspberrypi weewx[2197]: ftpupload: Uploaded file /vader/smartphone/temp_outside.html
Oct 11 03:35:44 raspberrypi weewx[2197]: ftpupload: Uploaded file /vader/smartphone/barometer.html
Oct 11 03:35:45 raspberrypi weewx[2197]: ftpupload: Uploaded file /vader/smartphone/rain.html
Oct 11 03:35:45 raspberrypi weewx[2197]: reportengine: ftp'd 26 files in 14.16 seconds
Oct 11 03:35:45 raspberrypi weewx[2197]: reportengine: Running report RSYNC
Oct 11 03:35:45 raspberrypi weewx[2197]: reportengine: Found configuration file /etc/weewx/skins/Rsync/skin.conf for report RSYNC
Oct 11 03:35:45 raspberrypi weewx[2197]: reportengine: rsync upload not requested. Skipped.
Oct 11 03:37:06 raspberrypi weewx[2197]: wmr200: No data received in 15 seconds
Oct 11 03:37:21 raspberrypi weewx[2197]: wmr200: No data received in 15 seconds
Oct 11 03:37:36 raspberrypi weewx[2197]: wmr200: No data received in 15 seconds
Oct 11 03:37:51 raspberrypi weewx[2197]: wmr200: No data received in 15 seconds
Oct 11 03:38:06 raspberrypi weewx[2197]: wmr200: No data received in 15 seconds
Oct 11 03:38:21 raspberrypi weewx[2197]: wmr200: No data received in 15 seconds
Oct 11 03:38:36 raspberrypi weewx[2197]: wmr200: No data received in 15 seconds
Oct 11 03:38:51 raspberrypi weewx[2197]: wmr200: No data received in 15 seconds
Oct 11 03:39:06 raspberrypi weewx[2197]: wmr200: No data received in 15 seconds

Per Edström

unread,
Oct 11, 2013, 5:03:19 AM10/11/13
to weewx...@googlegroups.com
I forgot to say that:

/etc/init.d/weewx stop
and
/etc/init.d/weewx start

..made the weewx start collecting data again. No need to reboot R.Pi. So I guess that the data collection-fault is weewx-related?

Thomas Keffer

unread,
Oct 11, 2013, 10:54:34 AM10/11/13
to weewx-user, Chris Manton
Sounds like it. It seems that the "heartbeat" thread is not doing its job. Chris? Any comments?

-tk



--

Chris Manton

unread,
Oct 11, 2013, 12:35:40 PM10/11/13
to weewx...@googlegroups.com, Chris Manton
Reading this thread, looks like that the wmr200 console went away, up until the last part where a weewx stop/start seemed to jiggle things working again.

I think the difference is that a watchdog sends 1 magic command, while a restart sends 2 magic commands.  I'd have to check the code.

The best data to gather would be via usbmon, which presents the raw data.  This would indicate if the wmr200 console is ignoring the watchdog, or if the watchdog is not actually sending data wmr200 console.

If it's the former, then we may need to add code to figure out how to jiggle it, as the stop/start seems to work.  If it's the latter, we can instrument it to figure out what happened to the watchdog.

(I predict the former scenario)

As an aside, I've develop and run my driver on the OMAP platform and have not seen this issue.  My system has not failed outside a scheduled downtime for tweaking the code, and my record is around  60 days uptime.  I don't regularly reboot regularly nor restart weewx ever.

C
--

Per Edström

unread,
Oct 11, 2013, 6:22:58 PM10/11/13
to weewx...@googlegroups.com, Chris Manton
Ok, I set up usbmon to log activity on device 5, it looks like this after a weewx restart. Will run it over night and see if it fails again and if so, if there is anything interesting in the logs..

d40be500 2425055471 S Ii:1:005:1 -115:1 8 <
d40be500 2425056078 C Ii:1:005:1 0:1 8 = 030a0d00 0d000000
d40be500 2425058481 S Ii:1:005:1 -115:1 8 <
d40be500 2425059053 C Ii:1:005:1 0:1 8 = 01ce0d00 0d000000
d40be500 2425059959 S Ii:1:005:1 -115:1 8 <
d40be500 2425060425 C Ii:1:005:1 0:1 8 = 03002128 0d000000
d40be500 2425060822 S Ii:1:005:1 -115:1 8 <
d40be500 2425061294 C Ii:1:005:1 0:1 8 = 01002128 0d000000
d40be500 2425062288 S Ii:1:005:1 -115:1 8 <
d40be500 2425062800 C Ii:1:005:1 0:1 8 = 01002128 0d000000
d40be500 2425063590 S Ii:1:005:1 -115:1 8 <
d40be500 2425064050 C Ii:1:005:1 0:1 8 = 01372128 0d000000
d40be500 2425064393 S Ii:1:005:1 -115:1 8 <

Per Edström

unread,
Oct 12, 2013, 4:43:08 PM10/12/13
to weewx...@googlegroups.com, Chris Manton
I was just checking up on my pie and found this:

Oct 12 19:33:28 raspberrypi weewx[2859]: wxengine: Starting main packet loop.
Oct 12 19:33:32 raspberrypi weewx[2859]: wmr200: USB device polling thread exiting
Oct 12 19:33:32 raspberrypi weewx[2859]: wmr200: USB polling thread expired
Oct 12 19:33:32 raspberrypi weewx[2859]: wmr200: Watchdog received shutdown
Oct 12 19:33:32 raspberrypi weewx[2859]: wmr200: Watchdog thread exiting
Oct 12 19:33:32 raspberrypi weewx[2859]: wmr200: watchdog thread expired
Oct 12 19:33:32 raspberrypi weewx[2859]: wmr200: closeDevice() Unable to detach driver interface. Reason: could not detach kernel driver from interface 0: No data available
Oct 12 19:33:32 raspberrypi weewx[2859]: wxengine: Caught unrecoverable exception in wxengine:
Oct 12 19:33:32 raspberrypi weewx[2859]:     ****  'WMR200' object has no attribute 'last_time_epoch'
Oct 12 19:33:32 raspberrypi weewx[2859]:     ****  Traceback (most recent call last):
Oct 12 19:33:32 raspberrypi weewx[2859]:     ****    File "/usr/share/weewx/weewx/wxengine.py", line 881, in main
Oct 12 19:33:32 raspberrypi weewx[2859]:     ****      engine.run()
Oct 12 19:33:32 raspberrypi weewx[2859]:     ****    File "/usr/share/weewx/weewx/wxengine.py", line 160, in run
Oct 12 19:33:32 raspberrypi weewx[2859]:     ****      for packet in self.console.genLoopPackets():
Oct 12 19:33:32 raspberrypi weewx[2859]:     ****    File "/usr/share/weewx/weewx/drivers/wmr200.py", line 1374, in genLoopPackets
Oct 12 19:33:32 raspberrypi weewx[2859]:     ****      self.pkt.packetProcess()
Oct 12 19:33:32 raspberrypi weewx[2859]:     ****    File "/usr/share/weewx/weewx/drivers/wmr200.py", line 824, in packetProcess
Oct 12 19:33:32 raspberrypi weewx[2859]:     ****      'dateTime'          : self._wmr200.last_time_epoch,
Oct 12 19:33:32 raspberrypi weewx[2859]:     ****  AttributeError: 'WMR200' object has no attribute 'last_time_epoch'
Oct 12 19:33:32 raspberrypi weewx[2859]:     ****  Exiting.
Oct 12 20:17:01 raspberrypi /USR/SBIN/CRON[3440]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Oct 12 21:17:01 raspberrypi /USR/SBIN/CRON[3449]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)


I have "use_pc_time = 1" in /etc/weewx/weewx.conf and it have been working fine..

Thomas Keffer

unread,
Oct 12, 2013, 5:20:28 PM10/12/13
to weewx-user, Chris Manton
Chris,

You're going to have to debug this one. To my eye, it appears the logic is there to set last_time_epoch, but there may be a race condition. Hard to tell without a WMR200 console.

-tk



--

Chris Manton

unread,
Oct 12, 2013, 7:03:49 PM10/12/13
to Thomas Keffer, weewx-user
This is a known issue (at least that I've seen) when using pc time versus console time.

The console timestamps have all the same timestamps per measurement interval, while PC time are stamped
at the time of acquisition.

Because of how weewx archives the data (I don't know exactly how), missing fields at the end of a weewx
epoch (my terminology; the periodic time in which weewx archives the collection of packets received from the driver) cause
this failure.

I've disabled pc time and gone back to console time and have not had the same problem.

Not sure if pc time is an appropriate setting or not; I must have copied it from another driver at one point.

Workaround is to disable pc time and use console time.  I'm not convinced there is any benefit to using pc time.

Fix is to remove pc time option, or to understand and root cause this failure.

C
--

Per Edström

unread,
Oct 13, 2013, 4:16:11 AM10/13/13
to weewx...@googlegroups.com, Thomas Keffer
I had console-time earlier but as the clock on WMR200 has drifted too much it started to cause otehr problems. And since I'm not at the location (winter lodge) I changed to PC-time and it worked well for many weeks. I also changed to PC-time on my home-WMR200 as PC-time is more accurate and I don't have to change console-time when it drifts too much (how much time-drift is acceptable?).

Why is console-time-drift a problem? What is it compared with that figures out that the offset is too much? If the "real-time" is 12:00 but data is stored on "12:10" shouldn't matter as log as the offset is pretty stable..
Oct 13 10:15:17 raspberrypi weewx[2599]: Archive: added archive record 2013-10-13 10:15:00 CEST (1381652100)


I restarted weewx and now it's running again but I got the USB-problem instead (the USB-logging was not running as the PC crontab-rebooted at midnight):

root@raspberrypi:~# tail -f /var/log/syslog
Oct 13 10:11:28 raspberrypi weewx[2599]: wxengine: Finished loading service weewx.wxengine.StdRESTful
Oct 13 10:11:28 raspberrypi weewx[2599]: wxengine: Loading service weewx.wxengine.StdReport
Oct 13 10:11:28 raspberrypi weewx[2599]: wxengine: Finished loading service weewx.wxengine.StdReport
Oct 13 10:11:28 raspberrypi weewx[2599]: wxengine: Starting up weewx version 2.4.0
Oct 13 10:11:28 raspberrypi weewx[2599]: wxengine: Station does not support reading the time
Oct 13 10:11:28 raspberrypi weewx[2599]: wxengine: Starting main packet loop.
Oct 13 10:11:28 raspberrypi weewx[2599]: wmr200: USB readDevice overflow error
Oct 13 10:11:28 raspberrypi weewx[2599]: wmr200: USB overflow
Oct 13 10:11:28 raspberrypi weewx[2599]: wmr200: USB readDevice overflow error
Oct 13 10:11:28 raspberrypi weewx[2599]: wmr200: USB overflow
Oct 13 10:11:35 raspberrypi weewx[2599]: wmr200: Checksum error act:7dd exp:300c
Oct 13 10:11:37 raspberrypi weewx[2599]: wmr200: USB device polling thread exiting
Oct 13 10:11:37 raspberrypi weewx[2599]: wmr200: USB polling thread expired
Oct 13 10:11:37 raspberrypi weewx[2599]: wmr200: Watchdog received shutdown
Oct 13 10:11:37 raspberrypi weewx[2599]: wmr200: Watchdog thread exiting
Oct 13 10:11:37 raspberrypi weewx[2599]: wmr200: watchdog thread expired
Oct 13 10:11:37 raspberrypi weewx[2599]: wmr200: closeDevice() Unable to detach driver interface. Reason: could not detach kernel driver from interface 0: No data available
Oct 13 10:11:37 raspberrypi weewx[2599]: wxengine: Caught WeeWxIOError: Checksum error act:7dd exp:300c
Oct 13 10:11:37 raspberrypi weewx[2599]:     ****  Waiting 60 seconds then retrying...
Oct 13 10:12:37 raspberrypi weewx[2599]: wxengine: retrying...
Oct 13 10:12:37 raspberrypi weewx[2599]: wxengine: Using configuration file /etc/weewx/weewx.conf
Oct 13 10:12:37 raspberrypi weewx[2599]: wxengine: Loading station type WMR200 (weewx.drivers.wmr200)
Oct 13 10:12:37 raspberrypi weewx[2599]: wmr200: Using PC Time:1
Oct 13 10:12:37 raspberrypi weewx[2599]: wmr200: Created watchdog thread to poke for live data every 30 seconds
Oct 13 10:12:37 raspberrypi weewx[2599]: wmr200: Created USB polling thread to read block on device
Oct 13 10:12:37 raspberrypi weewx[2599]: wmr200: Started poll_usb_device thread live data
Oct 13 10:12:37 raspberrypi weewx[2599]: wmr200: Reset device
Oct 13 10:12:38 raspberrypi weewx[2599]: wmr200: USB polling thread reset sent
Oct 13 10:12:38 raspberrypi weewx[2599]: wmr200: Started watchdog thread live data
Oct 13 10:12:38 raspberrypi weewx[2599]: wmr200: Restart count: 3
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Loading service weewx.wxengine.StdTimeSynch
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Finished loading service weewx.wxengine.StdTimeSynch
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Loading service weewx.wxengine.StdConvert
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: StdConvert target unit is 0x1
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Finished loading service weewx.wxengine.StdConvert
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Loading service weewx.wxengine.StdCalibrate
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Finished loading service weewx.wxengine.StdCalibrate
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Loading service weewx.wxengine.StdQC
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Finished loading service weewx.wxengine.StdQC
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Loading service weewx.wxengine.StdArchive
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Using config file archive interval of 300
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Record generation will be attempted in 'hardware'
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Using archive database: archive_sqlite
Oct 13 10:12:38 raspberrypi weewx[2599]: stats: Schema exists with 16 elements
Oct 13 10:12:38 raspberrypi weewx[2599]: stats: Backfilling stats database.
Oct 13 10:12:38 raspberrypi weewx[2599]: stats: stats database up to date.
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Using stats database: stats_sqlite
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Finished loading service weewx.wxengine.StdArchive
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Loading service weewx.wxengine.StdPrint
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Finished loading service weewx.wxengine.StdPrint
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Loading service weewx.wxengine.StdRESTful
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Data will not be posted to Wunderground
Oct 13 10:12:38 raspberrypi weewx[2599]:     ****  'station'
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Data will not be posted to PWSweather
Oct 13 10:12:38 raspberrypi weewx[2599]:     ****  'station'
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Data will not be posted to CWOP
Oct 13 10:12:38 raspberrypi weewx[2599]:     ****  'station'
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: No RESTful upload sites. No need to start thread.
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Finished loading service weewx.wxengine.StdRESTful
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Loading service weewx.wxengine.StdReport
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Finished loading service weewx.wxengine.StdReport
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Starting up weewx version 2.4.0
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Station does not support reading the time
Oct 13 10:12:38 raspberrypi weewx[2599]: wxengine: Starting main packet loop.

Per Edström

unread,
Feb 10, 2014, 10:21:11 AM2/10/14
to weewx...@googlegroups.com, Thomas Keffer
I "solved" the problem with Weewx on R.Pi stopping by restarting it every hour. One minute delay so that ongoing activity (FTP etc) is finished before starting again (else start will fail quietly):

0 */1 * * * /etc/init.d/weewx stop
1 */1 * * * /etc/init.d/weewx start

Now it works well! :-)

Message has been deleted

Andrew Milner

unread,
Oct 22, 2019, 8:59:11 PM10/22/19
to weewx...@googlegroups.com
that looks to me like cron table settings



On Wed, 23 Oct 2019 at 02:44, K Weaver <p280...@gmail.com> wrote:
Where do you put this script?

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/AFDE424PQqA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/d4b3cad4-0730-4b94-8d2c-b56c34a35f35%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages