Hello! I faced with this problem again, and looking deeper into it I'm finally adding a new method "update_and_exit" in StdArchive that I can call with the --update-and-exit argument
In this way, running weewxd --config=/path/to/weewx.conf --update-and-exit should just download the latests archive records from console, report them and exit. Also I need to modify do_sync method in StdTimeSync to do viceversa: update the system's time with the consoles clock, as I am offline and without rtc. Will let you know when it is finished. On Monday, 24 June 2024 at 14:57:18 UTC-3 vince wrote: > If you use rsyslogd for logging, here is a /etc/rsyslog.d/weewx config > file snippet that logs anything WU related to a separate file > > # log wunderground to other file > if $msg contains 'Wunderground-PWS: Published record' then > /var/log/weewx/weewx-wunderground.log > > > On Monday, June 24, 2024 at 5:07:13 AM UTC-7 [email protected] wrote: > >> Lithium would be the way! Already studying a solution this way. >> >> But I need a process to download the console and shutdown the pi. I could >> also do without the weewx's LOOP, something with weectl. >> >> On Sunday 23 June 2024 at 16:33:07 UTC-3 [email protected] wrote: >> >>> After optimizing the power consumption, consider using an LTO (Lithium >>> Titanate Oxid) battery, it should outperform the AGM in every aspect. The >>> downside is you need a rather sophisticated battery management and for LTO >>> batteries, there isn't really much to find. Depending on how low the >>> temperatures really get, LiFePO4 batteries should also do the job, and >>> there are lots of BMS on the market. >>> vince schrieb am Sonntag, 23. Juni 2024 um 20:10:05 UTC+2: >>> >>>> Wow - very interesting setup. A lot of questions come to mind: >>>> >>>> - what model pi are you running ? >>>> - have you stripped the os down to the bare minimum number of >>>> processes running ? >>>> - have you stripped down the services weewx runs to the minimum ? >>>> - what is the power savings you measure by killing weewx ? >>>> - do any of those changes have measurable impact on power >>>> consumption ? >>>> >>>> For a pi-only software solution I'd just use bash and cron periodically: >>>> >>>> - check if weewx is running or not >>>> - if not, start weewx up and await it running the WU upload >>>> after the first archive period >>>> - watch the weewx log to see if the WU upload has logged that it >>>> has completed its upload. You could do this with a custom rsyslog.conf >>>> entry and log only WU stuff to a particular file >>>> - when the WU log is populated, rotate that logfile (for the next >>>> run) and kill weewx and exit >>>> - (and use cron to periodically start the script of course) >>>> >>>> Basically your script would watch for the WU-only logfile to be >>>> non-zero size with a particular content in it saying the upload was >>>> complete. >>>> >>>> For a hardware solution I'd look for a hardware-only way to use an >>>> arduino or pi pico to actually power the raspi down completely, but then >>>> you'd need a RTC in the weewx pi (another battery needing to work in low >>>> power). One interesting link I found with pointers to some others is >>>> https://stfn.pl/blog/34-pico-power-consumption-solar-panels/ if that >>>> helps any. The author there has a lot of links and there are pointers to >>>> some adafruit boards that might help if you wanted to try a hardware >>>> solution. >>>> >>>> FWIW - I fiddled with deepsleep etc. on a pico when they came out but >>>> didn't have anything that could measure how little power they sip when >>>> deep >>>> sleeping. I do know that a pi itself still draws a lot of power when >>>> powered off although you can edit the os setup to minimize this. See >>>> https://www.jeffgeerling.com/blog/2023/reducing-raspberry-pi-5s-power-consumption-140x >>>> >>>> for details. I can confirm his blog solution works on a pi5 and pi4 but >>>> never tried it on a pi3 or zero or old model-B so I don't know there..... >>>> >>>> On Sunday, June 23, 2024 at 9:47:46 AM UTC-7 [email protected] wrote: >>>> >>>>> Thanks Greg! this should be achievable knowing the code. Would really >>>>> help! >>>>> >>>>> (had to google it MIB: Management Information Base) >>>>> On Thursday 20 June 2024 at 14:20:54 UTC-3 Greg Troxel wrote: >>>>> >>>>>> Indeed the real goal is important. >>>>>> >>>>>> I can certainly see having weewx have some kind of status output (a >>>>>> MIB >>>>>> :) that indicates whether it has successfully processed all the >>>>>> archive >>>>>> records and written the database (and run reports), so that a >>>>>> supervisor >>>>>> process can shut it down. >>>>>> >>>>>> I do not see most people wanting to spend time on that, so the OP has >>>>>> some code to write. >>>>>> >>>>>> -- 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/943adafb-c9e0-447b-befb-df13a8671a60n%40googlegroups.com.
