Currently running weewx 4.5.1 in a Raspberry Pi 3B+ with the Bullseye 
version of Raspberry Pi OS.
For a Raspberry Pi (using a microSD card as the OS system drive) I want to 
create a ramdisk for the /home/weewx/public_html directory.  
I followed examples from various webpages on the ramdisk topic.  
What I've tried thus far doesn't fully work.
How are others implementing this?

I started by renaming my /home/weewx/public_html directory to 
/home/weewx/public_html_backup, so there would be no conflict when the 
ramdisk was created at bootup.  
Then, I put this line in the /etc/fstab file and rebooted.
tmpfs   /home/weewx/public_html   tmpfs   defaults,noatime,size=100M   0 0
I tested it with sudo mount -a and the new partition was visible by using 
the df command.

After a reboot, a /home/weewx/public_html directory was created as a tmpfs 
volume.
To test the functionality, I manually ran wee_reports to force the webpage 
to be created.
When wee_reports ran, the process crashed with errors, because some of the 
files don't exist from previous runs of wee_reports.

pi@rpi3b:/home/weewx $ sudo bin/wee_reports
Using configuration file /home/weewx/weewx.conf
Generating for all time
Traceback (most recent call last):
  File "/home/weewx/bin/user/belchertown.py", line 1390, in 
get_extension_list
    with open(forecast_file, "wb+") as file:
FileNotFoundError: [Errno 2] No such file or directory: 
'/home/weewx/public_html/json/forecast.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/weewx/bin/weewx/reportengine.py", line 196, in run
    obj.start()
  File "/home/weewx/bin/weewx/reportengine.py", line 281, in start
    self.run()
  File "/home/weewx/bin/weewx/cheetahgenerator.py", line 152, in run
    ngen = self.generate(gen_dict[section_name], self.gen_ts)
  File "/home/weewx/bin/weewx/cheetahgenerator.py", line 222, in generate
    ngen += self.generate(section[subsection], gen_ts)
  File "/home/weewx/bin/weewx/cheetahgenerator.py", line 222, in generate
    ngen += self.generate(section[subsection], gen_ts)
  File "/home/weewx/bin/weewx/cheetahgenerator.py", line 310, in generate
    searchList = self._getSearchList(encoding, timespan,
  File "/home/weewx/bin/weewx/cheetahgenerator.py", line 387, in 
_getSearchList
    searchList += obj.get_extension_list(timespan, db_lookup)
  File "/home/weewx/bin/user/belchertown.py", line 1399, in 
get_extension_list
    raise Warning(
Warning: Error writing forecast info to 
/home/weewx/public_html/json/forecast.json. Reason: [Errno 2] No such file 
or directory: '/home/weewx/public_html/json/forecast.json'  

I found that if I copy the contents of my /home/weewx/public_html_backup 
folder into the /home/weewx/public_html ramdisk, then wee_reports completes 
and creates the fully populated /home/weewx/public_html directory.

Is everyone else populating the ramdisk with a backup of the puclic_html 
folder at bootup time?

Thanks,
Eric

-- 
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 on the web visit 
https://groups.google.com/d/msgid/weewx-user/5b24c101-f827-4c57-a4ec-252763757e8cn%40googlegroups.com.

Reply via email to