Open plainwind opened 3 years ago
Plainwind, Your message got cut off in the first sentence. Can you please resend?
Things to keep in mind: -- Your driver should be named with a ".py" extension -- it's Python code, not HTML. If you have HTML tags in the file then you did something wrong. Try downloading as plain text, then rename with the .py extension -- Also, the driver should be copied to the Weewx user's bin/user directory (i.e., [WEEWX_ROOT]/bin/user -- you could place it elsewhere but the bin/user dir won't be overwritten during upgrades. That's where I put mine. -- The Weewx config file (weewx.conf) should be copied to the Weewx user's home dir -- again, whatever WEEWX_ROOT is, for me it's /home/weewx. -- You need to specify the driver with a section at the end of the file (where "my_byows" is the name of your driver minus the extension): [BYOWS] driver = user.my_byows -- You also need to specify the driver type by changing the "station_type" line to read something like: station_type = BYOWS # this much match the section you added, i.e. [BYOWS} -- it can be anything you want, just make sure the two lines match -- And please note this: The byows driver is NOT a one-driver-for-all script -- you must edit it according to the sensors you have, your own WEEWX_ROOT directory, etc, etc. It might take a little or a LOT of editing to make this work.
Good luck, --Randall G
On Thu, Mar 18, 2021 at 11:39 AM plainwind @.***> wrote:
After downloading the driver into the /usr/share/weewx/user directory, the downloaded file is an html file with a first line of
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jardiamj/BYOWS_RPi/issues/8, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7LMKZWNDQVQAQVAHZE5U3TEJCHHANCNFSM4ZNFQSXQ .
Randall Many thanks for your very helpful email.
My home-made station uses the BME280 for temp, humidity and pressure. I also have a Davis anemometer and wind vane. I’m using an MCP3008 ADC to convert the wind vane potentiometer voltage to a digital value.
I’ve followed your advice and have now solved some of the issues and have Jardiam's BYOWS driver partially working for the wind vane and anemometer. However, currently the driver doesn’t recognise the BME280 despite me importing the bme280 module.
As you say, the driver will need modifying to suit my particular set-up. That is where the problem lies since I am only a beginner at Python!
Jardiam uses a number of classes in his code. It’s not obvious to me what some of the classes are for e.g. ByowsRpi and ByowsRpiStation. Because I’m not familiar with classes, I’m struggling to know how to modify Jardiam’s code. I’m following several tutorials to get up to speed.
As my Python knowledge improves, I’m hoping that I can eventually figure out how to modify Jardiam’s code. I will keep trying!
Regards Plainwind (John)
On 27 Mar 2021, at 23:38, randallgray @.***> wrote:
Plainwind, Your message got cut off in the first sentence. Can you please resend?
Things to keep in mind: -- Your driver should be named with a ".py" extension -- it's Python code, not HTML. If you have HTML tags in the file then you did something wrong. Try downloading as plain text, then rename with the .py extension -- Also, the driver should be copied to the Weewx user's bin/user directory (i.e., [WEEWX_ROOT]/bin/user -- you could place it elsewhere but the bin/user dir won't be overwritten during upgrades. That's where I put mine. -- The Weewx config file (weewx.conf) should be copied to the Weewx user's home dir -- again, whatever WEEWX_ROOT is, for me it's /home/weewx. -- You need to specify the driver with a section at the end of the file (where "my_byows" is the name of your driver minus the extension): [BYOWS] driver = user.my_byows -- You also need to specify the driver type by changing the "station_type" line to read something like: station_type = BYOWS # this much match the section you added, i.e. [BYOWS} -- it can be anything you want, just make sure the two lines match -- And please note this: The byows driver is NOT a one-driver-for-all script -- you must edit it according to the sensors you have, your own WEEWX_ROOT directory, etc, etc. It might take a little or a LOT of editing to make this work.
Good luck, --Randall G
On Thu, Mar 18, 2021 at 11:39 AM plainwind @.***> wrote:
After downloading the driver into the /usr/share/weewx/user directory, the downloaded file is an html file with a first line of
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jardiamj/BYOWS_RPi/issues/8, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7LMKZWNDQVQAQVAHZE5U3TEJCHHANCNFSM4ZNFQSXQ .
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jardiamj/BYOWS_RPi/issues/8#issuecomment-808817948, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATJG5NLY4CQ6V375IPSGJQLTFZT77ANCNFSM4ZNFQSXQ.
John, Glad to hear you made some progress.
I'm using the Adafruit drivers for my BME280 which are Python 3 specific. That's why I modified my copy of BYOWS to support WeeWX 4 & Python 3.
So does your BME280 drivers support Python2 or are they 3 specific? Take a look at the documentation and code examples from where ever you got your drivers.
And take a look at the log file/s for anything BME280 related. If it's not working the logs should contain a clue as to the problem.
Also, as for classes, since you are a Python beginner I'd say just leave them as they are and add / modify your code within them. Just modify what you need to and leave the code "wrapping" intact as much as possible. Does that make sense?
If you're still stuck I can send you my code if that would help. It's been modified quite a bit from what's currently posted.
Good luck, --Randall Gray
On Sun, Mar 28, 2021 at 9:03 AM plainwind @.***> wrote:
Randall Many thanks for your very helpful email.
My home-made station uses the BME280 for temp, humidity and pressure. I also have a Davis anemometer and wind vane. I’m using an MCP3008 ADC to convert the wind vane potentiometer voltage to a digital value.
I’ve followed your advice and have now solved some of the issues and have Jardiam's BYOWS driver partially working for the wind vane and anemometer. However, currently the driver doesn’t recognise the BME280 despite me importing the bme280 module.
As you say, the driver will need modifying to suit my particular set-up. That is where the problem lies since I am only a beginner at Python!
Jardiam uses a number of classes in his code. It’s not obvious to me what some of the classes are for e.g. ByowsRpi and ByowsRpiStation. Because I’m not familiar with classes, I’m struggling to know how to modify Jardiam’s code. I’m following several tutorials to get up to speed.
As my Python knowledge improves, I’m hoping that I can eventually figure out how to modify Jardiam’s code. I will keep trying!
Regards Plainwind (John)
On 27 Mar 2021, at 23:38, randallgray @.***> wrote:
Plainwind, Your message got cut off in the first sentence. Can you please resend?
Things to keep in mind: -- Your driver should be named with a ".py" extension -- it's Python code, not HTML. If you have HTML tags in the file then you did something wrong. Try downloading as plain text, then rename with the .py extension -- Also, the driver should be copied to the Weewx user's bin/user directory (i.e., [WEEWX_ROOT]/bin/user -- you could place it elsewhere but the bin/user dir won't be overwritten during upgrades. That's where I put mine. -- The Weewx config file (weewx.conf) should be copied to the Weewx user's home dir -- again, whatever WEEWX_ROOT is, for me it's /home/weewx. -- You need to specify the driver with a section at the end of the file (where "my_byows" is the name of your driver minus the extension): [BYOWS] driver = user.my_byows -- You also need to specify the driver type by changing the "station_type" line to read something like: station_type = BYOWS # this much match the section you added, i.e. [BYOWS} -- it can be anything you want, just make sure the two lines match -- And please note this: The byows driver is NOT a one-driver-for-all script -- you must edit it according to the sensors you have, your own WEEWX_ROOT directory, etc, etc. It might take a little or a LOT of editing to make this work.
Good luck, --Randall G
On Thu, Mar 18, 2021 at 11:39 AM plainwind @.***> wrote:
After downloading the driver into the /usr/share/weewx/user directory, the downloaded file is an html file with a first line of
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jardiamj/BYOWS_RPi/issues/8, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AA7LMKZWNDQVQAQVAHZE5U3TEJCHHANCNFSM4ZNFQSXQ
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/jardiamj/BYOWS_RPi/issues/8#issuecomment-808817948>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ATJG5NLY4CQ6V375IPSGJQLTFZT77ANCNFSM4ZNFQSXQ .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jardiamj/BYOWS_RPi/issues/8#issuecomment-808916971, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7LMK74QTI2JN6BBRJWZ2LTF5HOHANCNFSM4ZNFQSXQ .
Randall Thanks, again, for your helpful advice.
I’m coding in Python 3. It hadn’t occurred tome that the Jardi’s byows_rpi.py driver on Github might be in Python 2. There doesn’t seem to be any indication on Github of the Python version. In fact, how do you tell at a glance whether code is Python 2 or 3? I guess there are subtle differences which the trained eye can spot.
I’m using the Pimoroni bme280 and associated library along with a Davis anemometer and wind vane. I’ve attached my current script (which works!) It's a mash up of pieces of code both from https://www.youtube.com/watch?v=ChQpD2gsC20 https://www.youtube.com/watch?v=ChQpD2gsC20 and https://projects.raspberrypi.org/en/projects/build-your-own-weather-station https://projects.raspberrypi.org/en/projects/build-your-own-weather-station with the overall flow designed to continuously print current conditions and create archive records at regular intervals (currently 5 minutes). I’ve gone as far as I want with this script and now need focus my effort towards integrating my sensors with weewx.
I would be very grateful for sight of your code. It may give me some more clues of how I need to modify Jardi’s byows_rpi.py driver to allow my own set-up to run with weewx.
Regards John
On 29 Mar 2021, at 01:20, randallgray @.***> wrote:
John, Glad to hear you made some progress.
I'm using the Adafruit drivers for my BME280 which are Python 3 specific. That's why I modified my copy of BYOWS to support WeeWX 4 & Python 3.
So does your BME280 drivers support Python2 or are they 3 specific? Take a look at the documentation and code examples from where ever you got your drivers.
And take a look at the log file/s for anything BME280 related. If it's not working the logs should contain a clue as to the problem.
Also, as for classes, since you are a Python beginner I'd say just leave them as they are and add / modify your code within them. Just modify what you need to and leave the code "wrapping" intact as much as possible. Does that make sense?
If you're still stuck I can send you my code if that would help. It's been modified quite a bit from what's currently posted.
Good luck, --Randall Gray
On Sun, Mar 28, 2021 at 9:03 AM plainwind @.***> wrote:
Randall Many thanks for your very helpful email.
My home-made station uses the BME280 for temp, humidity and pressure. I also have a Davis anemometer and wind vane. I’m using an MCP3008 ADC to convert the wind vane potentiometer voltage to a digital value.
I’ve followed your advice and have now solved some of the issues and have Jardiam's BYOWS driver partially working for the wind vane and anemometer. However, currently the driver doesn’t recognise the BME280 despite me importing the bme280 module.
As you say, the driver will need modifying to suit my particular set-up. That is where the problem lies since I am only a beginner at Python!
Jardiam uses a number of classes in his code. It’s not obvious to me what some of the classes are for e.g. ByowsRpi and ByowsRpiStation. Because I’m not familiar with classes, I’m struggling to know how to modify Jardiam’s code. I’m following several tutorials to get up to speed.
As my Python knowledge improves, I’m hoping that I can eventually figure out how to modify Jardiam’s code. I will keep trying!
Regards Plainwind (John)
On 27 Mar 2021, at 23:38, randallgray @.***> wrote:
Plainwind, Your message got cut off in the first sentence. Can you please resend?
Things to keep in mind: -- Your driver should be named with a ".py" extension -- it's Python code, not HTML. If you have HTML tags in the file then you did something wrong. Try downloading as plain text, then rename with the .py extension -- Also, the driver should be copied to the Weewx user's bin/user directory (i.e., [WEEWX_ROOT]/bin/user -- you could place it elsewhere but the bin/user dir won't be overwritten during upgrades. That's where I put mine. -- The Weewx config file (weewx.conf) should be copied to the Weewx user's home dir -- again, whatever WEEWX_ROOT is, for me it's /home/weewx. -- You need to specify the driver with a section at the end of the file (where "my_byows" is the name of your driver minus the extension): [BYOWS] driver = user.my_byows -- You also need to specify the driver type by changing the "station_type" line to read something like: station_type = BYOWS # this much match the section you added, i.e. [BYOWS} -- it can be anything you want, just make sure the two lines match -- And please note this: The byows driver is NOT a one-driver-for-all script -- you must edit it according to the sensors you have, your own WEEWX_ROOT directory, etc, etc. It might take a little or a LOT of editing to make this work.
Good luck, --Randall G
On Thu, Mar 18, 2021 at 11:39 AM plainwind @.***> wrote:
After downloading the driver into the /usr/share/weewx/user directory, the downloaded file is an html file with a first line of
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jardiamj/BYOWS_RPi/issues/8, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AA7LMKZWNDQVQAQVAHZE5U3TEJCHHANCNFSM4ZNFQSXQ
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/jardiamj/BYOWS_RPi/issues/8#issuecomment-808817948>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ATJG5NLY4CQ6V375IPSGJQLTFZT77ANCNFSM4ZNFQSXQ .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jardiamj/BYOWS_RPi/issues/8#issuecomment-808916971, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7LMK74QTI2JN6BBRJWZ2LTF5HOHANCNFSM4ZNFQSXQ .
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jardiamj/BYOWS_RPi/issues/8#issuecomment-808988247, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATJG5NMLREUTCMFURWXCBI3TF7BWXANCNFSM4ZNFQSXQ.
I am glad that some of you have had some fun with this driver. I wonder how your setups are holding up.
After downloading the driver into the /usr/share/weewx/user directory, the downloaded file is an html file with a first line of <!DOCTYPE html>