Run weewx as just a collector, run the reports on a different server (mysql database backend)

97 views
Skip to first unread message

Adam Niedzwiedzki

unread,
Oct 3, 2021, 4:45:55 PM10/3/21
to weewx-user
Hi All,

I have weewx setup and working perfectly on my raspberrypi, but I wish to change it so that it just runs as a collector.
I'm writing to a mysql database on a VM on my NAS.
I don't want it to generate any files or reports etc on the raspberrypi.

I would like to then run weewx on another server to generate the reports. Is this possible?

Cheers
Ad

vince

unread,
Oct 3, 2021, 5:33:36 PM10/3/21
to weewx-user
Can you explain why you want to do this ?
Perhaps there are alternate ways of solving whatever problem you are concerned about...

Adam Niedzwiedzki

unread,
Oct 3, 2021, 6:14:32 PM10/3/21
to weewx-user
Hi Vince,

I wish for my raspberrypi to be "just a collector" it has the SD card set as read only, it only uses RAM files systems. I don't run a webserver on it.
To prolong the life of the SD card and the device, I would like to just run weewx (I guess you could say in a collector only mode). It just takes the data from the weather station and writes it to the database, nothing more.
I have another virtual machine on a much faster/better platform that does all my heavy lifting (webserver, database etc) that is backed up etc. I'd like for weewx to generate the reports etc on this server. (not on the pi and then rsync/sftp/ftp them to ANOTHER webserver)

Cheers
Adam

vince

unread,
Oct 3, 2021, 6:38:19 PM10/3/21
to weewx-user
On Sunday, October 3, 2021 at 3:14:32 PM UTC-7 ad5...@gmail.com wrote:
I wish for my raspberrypi to be "just a collector" it has the SD card set as read only, it only uses RAM files systems. I don't run a webserver on it.
To prolong the life of the SD card and the device, I would like to just run weewx (I guess you could say in a collector only mode). It just takes the data from the weather station and writes it to the database, nothing more.

I wonder (untested) if you could remove weewx.StdReport from report_services and get the collector to just collect.  Perhaps try that.
 
I have another virtual machine on a much faster/better platform that does all my heavy lifting (webserver, database etc) that is backed up etc. I'd like for weewx to generate the reports etc on this server. (not on the pi and then rsync/sftp/ftp them to ANOTHER webserver)

I don't think that's trivial to do.  You'd have to define 'something' in terms of what Station the 'heavy lifting' box thinks it has, but never start the daemon since that would fail because you're not attached to your station.  You'd then need to run bin/wee_reports manually on the 'heavy lifting' box via cron to generate reports.  I don't know whether that would block you from doing other things like rsync uploaders or the like.  You'd have to do some tests to find out experimentally.
 
FWIW - what you're worried about isn't really an issue these days. Folks have run weewx for 'years' without issue to SD card as long as you have a quality SD card and stable power.   I don't think I've yet seen a SD card corrupt on a pi3, pi3+, or pi4....

Your time might be better spent just letting your collector pi do the whole job.  Perhaps mount /home/weewx/public_html to your NAS.  That would keep you in a more supportable configuration I'd think....

Graham Eddy

unread,
Oct 4, 2021, 12:30:38 AM10/4/21
to weewx...@googlegroups.com
maybe collector instance can emit everything via mqtt and recorder/reporter instance can receive mqtt messages as its driver. note that collector instance's 'stored' data is not much use as it will be lost every time ramdisk is unmounted (eg on reboot) so it should emit only current observations not interval-based values. collector instance can run StdReport but generate few/no reports
--
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/111aa318-6a80-46c5-94ab-350fee44301dn%40googlegroups.com.

Cameron D

unread,
Oct 4, 2021, 9:21:07 PM10/4/21
to weewx-user
I had something like this for a while - but not exactly the same.
The VM with the wamp server did not have USB device access, so my solution was
1. weewx collects on one machine
2. writes to DB on the VM
3. weewx on the original machine generates reports by writing to a shared network drive that the apache server can see.
4. view reports by accessing the web server on the VM.

The only slightly tricky bit is getting the permissions right.

Graham Eddy

unread,
Oct 5, 2021, 10:21:14 PM10/5/21
to weewx...@googlegroups.com
maybe collector instance can emit everything via mqtt and recorder/reporter instance can receive mqtt messages as its driver. note that collector instance's 'stored' data is not much use as it will be lost every time ramdisk is unmounted (eg on reboot) so it should emit only current observations not interval-based values. collector instance can run StdReport but generate few/no reports

On 4/10/21 9:14 am, Adam Niedzwiedzki wrote:
Reply all
Reply to author
Forward
0 new messages