On Thursday, 6 April 2017 13:36:50 UTC+10, Alec Bennett wrote:
>
>
> Another question: there's some code at the bottom of the driver that (I
> think) lets it run independently of weewx for testing. In my case it starts
> with:
>
>
> if __name__ == '__main__':
>> import optparse
>> usage = """%prog [options] [--help]"""
>> syslog.openlog('aws', syslog.LOG_PID | syslog.LOG_CONS)
>> syslog.setlogmask(syslog.LOG_UPTO(syslog.LOG_DEBUG))
>>
>
> When I try to run aws.py directly though I get import errors. I'm not sure
> if I should worry about it, since for example simulator.py gets an import
> error too (in that case its "No module named weedb"). Is it worth looking
> into? Note that I made a separate script (arduino_test.py
> <https://github.com/wrybread/weewx-ArduinoWeatherStation/blob/master/arduino_test.py>)
>
> for testing the connection to the Arduino.
>
Hi,
What command are you using to run aws.py directly? If you are having import
errors it is probably a PYTHONPATH issue, something like this should work
(for a setup.py install):
$ PYTHONPATH=/home/weewx/bin python /home/weewx/bin/user/aws.py
Obviously the paths will need to be changed for a deb or rpm install.
You will find this sort of arrangement (with perhaps more detailed
instructions) used in a number of the the drivers in bin/weewx/drivers.
Gary
--
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].
For more options, visit https://groups.google.com/d/optout.