Just upgraded to v5 and everything works as it should except my interceptor 
module.

Long story short....my barometer module is broken and returns ridiculous 
values that bork the normal weewx calculations, so I've been using an 
interceptor to check the database entry after every new archive record is 
written, and run a shell script that changes these crazy values to one that 
I suck down off the internet.
This has been working for a long time now.

"*weewx.conf*" relevant entry/lines:
[Engine]
    [[Services]]
        report_services = *user.barometerfudge.MungeBarometer*, 
weewx.engine.StdPrint, weewx.engine.StdReport, user.lowBattery.BatteryAlarm

Module name in ~/bin/user :
-rw-r--r-- 1 weewx weewx   1172 Jan 25 21:20 barometerfudge.py

Contents:
import subprocess
import weewx
from weewx.engine import StdService

class MungeBarometer(StdService):

    def __init__(self, engine, config_dict):
        super(MungeBarometer, self).__init__(engine, config_dict)
        self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)

    def new_archive_record(self, event):
        subprocess.call(["/home/weewx/check_fix_pressure.sh"])

I have also tried using 'subprocess.run', but same result.

There are a couple of other python modules in ~/bin/user and they are being 
run fine, so there's not a permission issue.  Nothing else has changed.

No errors appear in the log even when debug=1, there is simply no output 
from that script at all meaning that it's not being run.  I updated it to 
create a 'logger' entry when it starts, and it works if I run it manually 
so I know that it's not being called by weewx.

The compiled python *is* being generated/updated in __pycache__ when weewx 
is restarted.

Does using a "virtual python environment' prevent the execution of shell 
scripts in discreet directories further up the directory structure?  I 
would have thought I'd see an error in the log if that were the case.

Any other clues/ideas appreciated.

Cheers...Owen

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/9beaeee5-787f-4d7d-81a7-7d0d4f964fefn%40googlegroups.com.

Reply via email to