I adapted the Arduino code for easy reading from weeWX and made a weeWX driver, posted here along with the Arduino code:
Some questions and issues:- the driver currently gets the wind speed about every 17 seconds even though the Arduino is reporting it much more often that that. When using a Vantage I get the wind about every 2 seconds. Any thoughts on how to make the updates more frequent?
- I named the driver "aws", as in "Arduino Weather Station". I'm a bit worried that might get confusing and hard to search for because of Amazon Web Services. Agreed? Idea for other name?
- where to place the driver file? Currently in /home/weewx/bin/weewx/drivers/aws.py.
- should I make any changes to how it's packaged? Would this be something useful for the main fork of weewx?
you should put it in user/aws.py
Traceback (most recent call last):
File "/home/weewx/bin/weewxd", line 64, in <module>
weewx.engine.main(options, args)
File "/home/weewx/bin/weewx/engine.py", line 916, in main
engine = engine_class(config_dict)
File "/home/weewx/bin/weewx/engine.py", line 72, in __init__
self.setupStation(config_dict)
File "/home/weewx/bin/weewx/engine.py", line 96, in setupStation
__import__(driver)
ImportError: No module named aws
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/R7j98YGv1ME/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
make genLoopPacket return every time data is emitted from the arduino.
instead of polling the hardware, open the serial port once in the driver __init__. then do a non-blocking read instead (a read with timeout) instead of read-then-close.
you should put it in user/aws.pyWhen I put it in /home/weewx/bin/user/aws.py, engine.py can't find it:
- I named the driver "aws", as in "Arduino Weather Station". I'm a bit worried that might get confusing and hard to search for because of Amazon Web Services. Agreed? Idea for other name?
- I named the driver "aws", as in "Arduino Weather Station". I'm a bit worried that might get confusing and hard to search for because of Amazon Web Services. Agreed? Idea for other name?Winduino ?
driver = user.aws
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))

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) for testing the connection to the Arduino.
$ PYTHONPATH=/home/weewx/bin python /home/weewx/bin/user/aws.py$ PYTHONPATH=/home/weewx/bin python /home/weewx/bin/user/aws.py
https://github.com/weewx/weewx/wiki
and please add your driver to the weewx wiki!
--
--
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+unsubscribe@googlegroups.com.