use Weewx on raspberry

1,632 views
Skip to first unread message

Patrick Tranchant

unread,
Dec 8, 2018, 9:40:43 AM12/8/18
to weewx-user
hello I am a newbie from France ( sorry for my english )

I want to use weewx on a raspberry with a weather station built by myself (view on Magpi)
I don't see my station on your website to configure :

Weather Station Hardware Comparison: I don't found my weather station.

Do you have a solution or how to configure Weewx

thank you for your help

Patrick

rich T

unread,
Dec 8, 2018, 10:45:07 AM12/8/18
to weewx-user
Patrick

We need additional information about the weather station you built.

Rich

Patrick Tranchant

unread,
Dec 8, 2018, 10:49:52 AM12/8/18
to weewx-user
hi
thank you for your response


patrick

Patrick Tranchant

unread,
Dec 8, 2018, 11:19:28 AM12/8/18
to weewx-user
it's me again
the communication between Weewx and my BYP weather station must be done with the GPIO of Raspberry
I think you know it.

Patrick

On Saturday, December 8, 2018 at 3:40:43 PM UTC+1, Patrick Tranchant wrote:

Thomas Keffer

unread,
Dec 8, 2018, 11:46:34 AM12/8/18
to weewx-user
Hello, Patrick

Je ne suis au courant d'aucun pilote périphérique pour WeeWX qui fonctionnerait avec la station météo "Build your own" Raspberry Pi que vous avez liée. Je ne trouve pas non plus de référence dans l'archive weewx-user.

Donc, vous devrez écrire le pilote !

Les instructions figurent dans le Customizing Guide, dans la section Porting to new hardware.

-tk

--
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+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Patrick Tranchant

unread,
Dec 8, 2018, 11:55:25 AM12/8/18
to weewx-user
hello Thomas

General guidelines

  • The driver should emit data as it receives it from the hardware (no caching).
  • The driver should emit only data it receives from the hardware (no "filling in the gaps").
  • The driver should not modify the data unless the modification is directly related to the hardware (e.g., decoding a hardware-specific sensor value).
  • If the hardware flags "bad data", then the driver should emit a null value for that datum (Python None).
  • The driver should not calculate any derived variables (such as dewpoint). The service StdWXService will do that.
  • However, if the hardware emits a derived variable, then the driver should emit it.

On Saturday, December 8, 2018 at 3:40:43 PM UTC+1, Patrick Tranchant wrote:

Patrick Tranchant

unread,
Dec 8, 2018, 11:56:44 AM12/8/18
to weewx-user
hello Thomas
whaouh
I'm not a developer, let alone a programmer

It is going to be difficult for me
thanks

Patrick

On Saturday, December 8, 2018 at 3:40:43 PM UTC+1, Patrick Tranchant wrote:

Patrick Tranchant

unread,
Dec 8, 2018, 11:58:47 AM12/8/18
to weewx-user


On Saturday, December 8, 2018 at 5:19:28 PM UTC+1, Patrick Tranchant wrote:
it's me again
the communication between Weewx and my BYO weather station must be done with the GPIO of Raspberry

Thomas Keffer

unread,
Dec 8, 2018, 12:12:24 PM12/8/18
to weewx-user
Sorry. There is no driver available.

-tk

--

rich T

unread,
Dec 8, 2018, 12:26:29 PM12/8/18
to weewx-user
Patrick

If you don't want to try to write a driver, another option might be:

Weather Station > Node Red > MQTT > Weewx

1. Your weather station interfaces Node Red via the Raspberry GPIOs.
2. Add the data to MQTT broker. (there is some programming that needs to done to get and add the data)
3. Using the Weewx MQTT extension, subscribe to broker. (there is some configuring that needs to be done)

Rich

Patrick Tranchant

unread,
Dec 8, 2018, 12:30:23 PM12/8/18
to weewx...@googlegroups.com
thank you Rich
I go to try to read your solution.
thank

patrick

--

Pat

unread,
Dec 8, 2018, 1:29:40 PM12/8/18
to weewx-user
Have you built the weather station yet? Is it giving you a reading of the sensors?

Patrick Tranchant

unread,
Dec 8, 2018, 1:48:20 PM12/8/18
to weewx-user
hello Pat

I have already my BYO weather station, it works good
it displays the data from sensors , they are stocked in MariaDB
the datas are display just in text mode.

thanks
Patrick

On Saturday, December 8, 2018 at 3:40:43 PM UTC+1, Patrick Tranchant wrote:

Pat

unread,
Dec 8, 2018, 1:53:37 PM12/8/18
to weewx-user
How do you run the weather station? What file do you run? log_all_sensors.py?

Patrick Tranchant

unread,
Dec 8, 2018, 2:00:39 PM12/8/18
to weewx-user
I use a script on python3
I follow this link for the built of my weather Station
I can give you the final script

patrick

On Saturday, December 8, 2018 at 3:40:43 PM UTC+1, Patrick Tranchant wrote:

Pat

unread,
Dec 8, 2018, 2:03:14 PM12/8/18
to weewx-user
I followed your link, which brought me to GitHub. There are a lot of scripts there. 

If you can share your python3 script that will help. 

Patrick Tranchant

unread,
Dec 8, 2018, 2:14:01 PM12/8/18
to weewx-user
ok I give you the scripts
in attach file
The main script is weather_station_BYO_10.py
thank you

patrick

On Saturday, December 8, 2018 at 3:40:43 PM UTC+1, Patrick Tranchant wrote:
wind_direction_byo_5.py
bme280_sensor_2.py
weather_station_BYO_10.py

Pat

unread,
Dec 8, 2018, 2:14:49 PM12/8/18
to weewx-user
Thanks. 

Where do you plan to run WeeWX? 

on the same Raspberry Pi?

Patrick Tranchant

unread,
Dec 8, 2018, 2:17:09 PM12/8/18
to weewx-user
yes on the same PI


On Saturday, December 8, 2018 at 3:40:43 PM UTC+1, Patrick Tranchant wrote:

Patrick Tranchant

unread,
Dec 8, 2018, 2:22:25 PM12/8/18
to weewx-user
watch the datas , displayed on my screen

Wind direction: 0.0 / Wind speed: 2.882624887969079 / Wind gust: 4.083718591289529 / Rainfall: 3.3528 / Humidity: 49.045477937775004 / Pressure: 992.038277081991 / Ambient Temperature: 20.20529098296538 / Ground Temperature: 17.687;

Patrick

On Saturday, December 8, 2018 at 3:40:43 PM UTC+1, Patrick Tranchant wrote:

Patrick Tranchant

unread,
Dec 8, 2018, 2:26:59 PM12/8/18
to weewx-user
an other measure

Wind direction: 180.0 / Wind speed: 0.0 / Wind gust: 0.0 / Rainfall: 0.0 / Humidity: 48.59056071006303 / Pressure: 992.0321939541822 / Ambient Temperature: 20.324745389912277 / Ground Temperature: 17.812;

On Saturday, December 8, 2018 at 3:40:43 PM UTC+1, Patrick Tranchant wrote:

Pat

unread,
Dec 8, 2018, 2:30:46 PM12/8/18
to weewx-user
If you want to use WeeWX, we will have to convert this python3 script into a weewx driver. 

Then you would let WeeWX handle everything and you would get updates on a website. 

Patrick Tranchant

unread,
Dec 8, 2018, 2:31:51 PM12/8/18
to weewx-user
Yes
on the same raspberry

Patrick

On Saturday, December 8, 2018 at 3:40:43 PM UTC+1, Patrick Tranchant wrote:

Pat

unread,
Dec 8, 2018, 2:39:25 PM12/8/18
to weewx-user
Writing a driver isn't a fast process and takes a lot of testing. I don't have your weather station so it might take a while to get it accurate. 

I don't have a lot of time left for today and won't be available tomorrow, but I can try an initial attempt. Unless someone else reading this wants to try it out too :) 

Patrick Tranchant

unread,
Dec 8, 2018, 2:42:10 PM12/8/18
to weewx-user
thanks to you
I can wait for you or someone other

have a good evening

Patrick

On Saturday, December 8, 2018 at 3:40:43 PM UTC+1, Patrick Tranchant wrote:

Pat

unread,
Dec 8, 2018, 2:52:51 PM12/8/18
to weewx-user
Can you explain the difference between Ground Temperature and Ambient Temperature with this station?

Patrick Tranchant

unread,
Dec 8, 2018, 2:58:29 PM12/8/18
to weewx-user


the ground temperature (in french temperature du sol)  is with a DS18b2 sensor and the Ambient teperature is with BME280 sensor ( in french temperature de l'air)

Pat

unread,
Dec 8, 2018, 3:01:31 PM12/8/18
to weewx-user
Ok, so Ambient Temperature would be the outTemp observation. 

Is your DS18b2 in the soil? 

Patrick Tranchant

unread,
Dec 8, 2018, 3:02:38 PM12/8/18
to weewx-user
Yes it is good

Pat

unread,
Dec 8, 2018, 10:02:14 PM12/8/18
to weewx-user
I do not have this weather station so I have copied and pasted your python3 file to a format that WeeWX should understand. There will be bugs since I have no way to test it :)

I invite others lurking here to review and update anything obvious as well - for sanity's sake. I've commented the code with some questions which input from others here could be valuable in finishing the driver. 

To install: 
  1. Copy the attached byows.py to your bin/user folder
  2. Copy the dependency files from your python folder to bin/user otherwise the script won't start.
    1. Such as wind_direction_byo_5.py, and any bme280 files. 
  3. Copy this section to the bottom of weewx.conf. (there are no driver options yet, that might come in future) - I named it BYOWS for "Bring Your Own Weather Station"
[BYOWS]
   
# This section is for the Raspberry Pi Bring Your Own Weather Station driver.
       
   
# The driver to use
    driver
= user.byows

Restart weewx

Check syslog with sudo tail -f /var/log/syslog -n 100 and see what errors come up and paste them here. 
byows.py

Patrick Tranchant

unread,
Dec 9, 2018, 6:08:14 AM12/9/18
to weewx-user
hello Pat


you worked that night, where then you live on the other side of the atlantic with jetlag ..
Should I first install Weewx and what should I choose for the hardware to install?
thanks again

Patrick

Pat

unread,
Dec 9, 2018, 8:05:39 AM12/9/18
to weewx-user
Yes install WeeWX. If you're using Raspbian on your Raspberry Pi, follow these instructions

Select Simulator for the hardware during setup. 

Then copy the file above to bin/user (which is /usr/share/weewx/user if you installed by apt). 

Then run sudo service weewx stop

Then go to /etc/weewx and edit weewx.conf and add that code block to the bottom of the file

Then run sudo service weewx start 

Check syslog for what errors come up

Patrick Tranchant

unread,
Dec 9, 2018, 8:57:16 AM12/9/18
to weewx-user
hello Pat
how are you
My actual files ( weather_station_BYO_10.py) is installed in /home/pi/weather-station/
I put your file "byows.py" in the same directory; it is OK ?
And I run the file by python3 byows.py

1st error:
 python3 byows.py
  File "byows.py", line 104
    global self.wind_count
               ^
SyntaxError: invalid syntax

but maybe I'm wrong, it's the application "Weewx" by the web server that launches the file "byows.py" and not as I do, in any case the application by: http / localhost / weewx / gets off to a good start, but it's simulator mode data

I modified the file as:
 def reset_wind(self):
        self.wind_count
        self.wind_count = 0

I run again the file and 2nd error:
python3 byows.py
Traceback (most recent call last):
  File "byows.py", line 22, in <module>
    import weedb
ImportError: No module named 'weedb'

but maybe I'm wrong, it's the application "Weewx" by the web server that launches the file "byows.py" and not as I do, in any case the application by: http / localhost / weewx / gets off to a good start, but it's simulator mode data

watch the log:
 $ sudo tail -f /var/log/syslog -n 100
Dec  9 14:17:08 raspberrypi weewx[6993]: engine: Terminating weewx version 3.8.2
Dec  9 14:17:13 raspberrypi weewx[7227]: Stopping weewx weather system: weewx..
Dec  9 14:17:13 raspberrypi systemd[1]: Stopped LSB: weewx weather system.
Dec  9 14:17:13 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Dec  9 14:17:14 raspberrypi weewx[7268]: engine: Initializing weewx version 3.8.2
Dec  9 14:17:14 raspberrypi weewx[7268]: engine: Using Python 2.7.13 (default, Sep 26 2018, 18:42:22) #012[GCC 6.3.0 20170516]
Dec  9 14:17:14 raspberrypi weewx[7268]: engine: Platform Linux-4.14.79-v7+-armv7l-with-debian-9.6
Dec  9 14:17:14 raspberrypi weewx[7268]: engine: Locale is 'fr_FR.UTF-8'
Dec  9 14:17:14 raspberrypi weewx[7268]: engine: pid file is /var/run/weewx.pid
Dec  9 14:17:14 raspberrypi weewx[7272]: engine: Using configuration file /etc/weewx/weewx.conf
Dec  9 14:17:14 raspberrypi weewx[7272]: engine: Loading station type Simulator (weewx.drivers.simulator)
Dec  9 14:17:14 raspberrypi weewx[7257]: Starting weewx weather system: weewx.
Dec  9 14:17:14 raspberrypi systemd[1]: Started LSB: weewx weather system.
Dec  9 14:17:14 raspberrypi weewx[7272]: engine: StdConvert target unit is 0x1
Dec  9 14:17:14 raspberrypi weewx[7272]: wxcalculate: The following values will be calculated: barometer=prefer_hardware, windchill=prefer_hardware, dewpoint=prefer_hardware, appTemp=prefer_hardware, rainRate=prefer_hardware, windrun=prefer_hardware, heatindex=prefer_hardware, maxSolarRad=prefer_hardware, humidex=prefer_hardware, pressure=prefer_hardware, inDewpoint=prefer_hardware, ET=prefer_hardware, altimeter=prefer_hardware, cloudbase=prefer_hardware
Dec  9 14:17:14 raspberrypi weewx[7272]: wxcalculate: The following algorithms will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS
Dec  9 14:17:14 raspberrypi weewx[7272]: engine: Archive will use data binding wx_binding
Dec  9 14:17:14 raspberrypi weewx[7272]: engine: Record generation will be attempted in 'hardware'
Dec  9 14:17:14 raspberrypi weewx[7272]: engine: Using archive interval of 300 seconds (specified in weewx configuration)
Dec  9 14:17:14 raspberrypi weewx[7272]: engine: Using binding 'wx_binding' to database 'weewx.sdb'
Dec  9 14:17:14 raspberrypi weewx[7272]: manager: Starting backfill of daily summaries
Dec  9 14:17:14 raspberrypi weewx[7272]: restx: StationRegistry: Registration not requested.
Dec  9 14:17:14 raspberrypi weewx[7272]: restx: Wunderground: Posting not enabled.
Dec  9 14:17:14 raspberrypi weewx[7272]: restx: PWSweather: Posting not enabled.
Dec  9 14:17:14 raspberrypi weewx[7272]: restx: CWOP: Posting not enabled.
Dec  9 14:17:14 raspberrypi weewx[7272]: restx: WOW: Posting not enabled.
Dec  9 14:17:14 raspberrypi weewx[7272]: restx: AWEKAS: Posting not enabled.
Dec  9 14:17:14 raspberrypi weewx[7272]: engine: Starting up weewx version 3.8.2
Dec  9 14:17:14 raspberrypi weewx[7272]: engine: Clock error is -0.20 seconds (positive is fast)
Dec  9 14:17:14 raspberrypi weewx[7272]: engine: Starting main packet loop.
Dec  9 14:20:16 raspberrypi weewx[7272]: manager: Added record 2018-12-09 14:20:00 CET (1544361600) to database 'weewx.sdb'
Dec  9 14:20:16 raspberrypi weewx[7272]: manager: Added record 2018-12-09 14:20:00 CET (1544361600) to daily summary in 'weewx.sdb'
Dec  9 14:20:24 raspberrypi weewx[7272]: cheetahgenerator: Generated 14 files for report StandardReport in 7.20 seconds
Dec  9 14:20:25 raspberrypi weewx[7272]: imagegenerator: Generated 12 images for StandardReport in 1.32 seconds
Dec  9 14:20:25 raspberrypi weewx[7272]: copygenerator: copied 9 files to /var/www/html/weewx
Dec  9 14:25:16 raspberrypi weewx[7272]: manager: Added record 2018-12-09 14:25:00 CET (1544361900) to database 'weewx.sdb'
Dec  9 14:25:16 raspberrypi weewx[7272]: manager: Added record 2018-12-09 14:25:00 CET (1544361900) to daily summary in 'weewx.sdb'
Dec  9 14:25:19 raspberrypi weewx[7272]: cheetahgenerator: Generated 14 files for report StandardReport in 2.28 seconds
Dec  9 14:25:20 raspberrypi weewx[7272]: imagegenerator: Generated 12 images for StandardReport in 1.26 seconds
Dec  9 14:25:20 raspberrypi weewx[7272]: copygenerator: copied 0 files to /var/www/html/weewx
Dec  9 14:30:16 raspberrypi weewx[7272]: manager: Added record 2018-12-09 14:30:00 CET (1544362200) to database 'weewx.sdb'
Dec  9 14:30:16 raspberrypi weewx[7272]: manager: Added record 2018-12-09 14:30:00 CET (1544362200) to daily summary in 'weewx.sdb'
Dec  9 14:30:19 raspberrypi weewx[7272]: cheetahgenerator: Generated 14 files for report StandardReport in 2.30 seconds
Dec  9 14:30:20 raspberrypi weewx[7272]: imagegenerator: Generated 12 images for StandardReport in 1.27 seconds
Dec  9 14:30:20 raspberrypi weewx[7272]: copygenerator: copied 0 files to /var/www/html/weewx
Dec  9 14:35:16 raspberrypi weewx[7272]: manager: Added record 2018-12-09 14:35:00 CET (1544362500) to database 'weewx.sdb'
Dec  9 14:35:16 raspberrypi weewx[7272]: manager: Added record 2018-12-09 14:35:00 CET (1544362500) to daily summary in 'weewx.sdb'
Dec  9 14:35:19 raspberrypi weewx[7272]: cheetahgenerator: Generated 14 files for report StandardReport in 2.33 seconds
Dec  9 14:35:20 raspberrypi weewx[7272]: imagegenerator: Generated 12 images for StandardReport in 1.27 seconds
Dec  9 14:35:20 raspberrypi weewx[7272]: copygenerator: copied 0 files to /var/www/html/weewx
Dec  9 14:39:01 raspberrypi CRON[7410]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Dec  9 14:39:09 raspberrypi systemd[1]: Starting Clean php session files...
Dec  9 14:39:10 raspberrypi systemd[1]: Started Clean php session files.
Dec  9 14:40:16 raspberrypi weewx[7272]: manager: Added record 2018-12-09 14:40:00 CET (1544362800) to database 'weewx.sdb'
Dec  9 14:40:16 raspberrypi weewx[7272]: manager: Added record 2018-12-09 14:40:00 CET (1544362800) to daily summary in 'weewx.sdb'
Dec  9 14:40:19 raspberrypi weewx[7272]: cheetahgenerator: Generated 14 files for report StandardReport in 2.56 seconds
Dec  9 14:40:20 raspberrypi weewx[7272]: imagegenerator: Generated 12 images for StandardReport in 1.31 seconds
Dec  9 14:40:20 raspberrypi weewx[7272]: copygenerator: copied 0 files to /var/www/html/weewx
Dec  9 14:45:16 raspberrypi weewx[7272]: manager: Added record 2018-12-09 14:45:00 CET (1544363100) to database 'weewx.sdb'
Dec  9 14:45:16 raspberrypi weewx[7272]: manager: Added record 2018-12-09 14:45:00 CET (1544363100) to daily summary in 'weewx.sdb'
Dec  9 14:45:19 raspberrypi weewx[7272]: cheetahgenerator: Generated 14 files for report StandardReport in 2.30 seconds
Dec  9 14:45:20 raspberrypi weewx[7272]: imagegenerator: Generated 12 images for StandardReport in 1.26 seconds
Dec  9 14:45:20 raspberrypi weewx[7272]: copygenerator: copied 0 files to /var/www/html/weewx
Dec  9 14:47:58 raspberrypi systemd[1]: Stopping LSB: weewx weather system...
Dec  9 14:47:58 raspberrypi weewx[7272]: engine: Shutting down StdReport thread
Dec  9 14:47:58 raspberrypi weewx[7272]: engine: Terminating weewx version 3.8.2
Dec  9 14:48:03 raspberrypi weewx[7606]: Stopping weewx weather system: weewx..
Dec  9 14:48:03 raspberrypi systemd[1]: Stopped LSB: weewx weather system.
Dec  9 14:48:11 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Dec  9 14:48:12 raspberrypi weewx[7679]: engine: Initializing weewx version 3.8.2
Dec  9 14:48:12 raspberrypi weewx[7679]: engine: Using Python 2.7.13 (default, Sep 26 2018, 18:42:22) #012[GCC 6.3.0 20170516]
Dec  9 14:48:12 raspberrypi weewx[7679]: engine: Platform Linux-4.14.79-v7+-armv7l-with-debian-9.6
Dec  9 14:48:12 raspberrypi weewx[7679]: engine: Locale is 'fr_FR.UTF-8'
Dec  9 14:48:12 raspberrypi weewx[7679]: engine: pid file is /var/run/weewx.pid
Dec  9 14:48:12 raspberrypi weewx[7683]: engine: Using configuration file /etc/weewx/weewx.conf
Dec  9 14:48:12 raspberrypi weewx[7683]: engine: Loading station type Simulator (weewx.drivers.simulator)
Dec  9 14:48:12 raspberrypi weewx[7668]: Starting weewx weather system: weewx.
Dec  9 14:48:12 raspberrypi systemd[1]: Started LSB: weewx weather system.
Dec  9 14:48:12 raspberrypi weewx[7683]: engine: StdConvert target unit is 0x1
Dec  9 14:48:12 raspberrypi weewx[7683]: wxcalculate: The following values will be calculated: barometer=prefer_hardware, windchill=prefer_hardware, dewpoint=prefer_hardware, appTemp=prefer_hardware, rainRate=prefer_hardware, windrun=prefer_hardware, heatindex=prefer_hardware, maxSolarRad=prefer_hardware, humidex=prefer_hardware, pressure=prefer_hardware, inDewpoint=prefer_hardware, ET=prefer_hardware, altimeter=prefer_hardware, cloudbase=prefer_hardware
Dec  9 14:48:12 raspberrypi weewx[7683]: wxcalculate: The following algorithms will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS
Dec  9 14:48:12 raspberrypi weewx[7683]: engine: Archive will use data binding wx_binding
Dec  9 14:48:12 raspberrypi weewx[7683]: engine: Record generation will be attempted in 'hardware'
Dec  9 14:48:12 raspberrypi weewx[7683]: engine: Using archive interval of 300 seconds (specified in weewx configuration)
Dec  9 14:48:12 raspberrypi weewx[7683]: engine: Using binding 'wx_binding' to database 'weewx.sdb'
Dec  9 14:48:12 raspberrypi weewx[7683]: manager: Starting backfill of daily summaries
Dec  9 14:48:12 raspberrypi weewx[7683]: restx: StationRegistry: Registration not requested.
Dec  9 14:48:12 raspberrypi weewx[7683]: restx: Wunderground: Posting not enabled.
Dec  9 14:48:12 raspberrypi weewx[7683]: restx: PWSweather: Posting not enabled.
Dec  9 14:48:12 raspberrypi weewx[7683]: restx: CWOP: Posting not enabled.
Dec  9 14:48:12 raspberrypi weewx[7683]: restx: WOW: Posting not enabled.
Dec  9 14:48:12 raspberrypi weewx[7683]: restx: AWEKAS: Posting not enabled.
Dec  9 14:48:12 raspberrypi weewx[7683]: engine: Starting up weewx version 3.8.2
Dec  9 14:48:12 raspberrypi weewx[7683]: engine: Clock error is -0.18 seconds (positive is fast)
Dec  9 14:48:12 raspberrypi weewx[7683]: engine: Starting main packet loop.
Dec  9 14:50:14 raspberrypi weewx[7683]: manager: Added record 2018-12-09 14:50:00 CET (1544363400) to database 'weewx.sdb'
Dec  9 14:50:14 raspberrypi weewx[7683]: manager: Added record 2018-12-09 14:50:00 CET (1544363400) to daily summary in 'weewx.sdb'
Dec  9 14:50:22 raspberrypi weewx[7683]: cheetahgenerator: Generated 14 files for report StandardReport in 7.18 seconds
Dec  9 14:50:23 raspberrypi weewx[7683]: imagegenerator: Generated 12 images for StandardReport in 1.33 seconds
Dec  9 14:50:23 raspberrypi weewx[7683]: copygenerator: copied 9 files to /var/www/html/weewx
Dec  9 14:55:14 raspberrypi weewx[7683]: manager: Added record 2018-12-09 14:55:00 CET (1544363700) to database 'weewx.sdb'
Dec  9 14:55:14 raspberrypi weewx[7683]: manager: Added record 2018-12-09 14:55:00 CET (1544363700) to daily summary in 'weewx.sdb'
Dec  9 14:55:17 raspberrypi weewx[7683]: cheetahgenerator: Generated 14 files for report StandardReport in 2.42 seconds
Dec  9 14:55:18 raspberrypi weewx[7683]: imagegenerator: Generated 12 images for StandardReport in 1.30 seconds
Dec  9 14:55:18 raspberrypi weewx[7683]: copygenerator: copied 0 files to /var/www/html/weewx

Pat

unread,
Dec 9, 2018, 10:33:36 AM12/9/18
to weewx-user
Correct, you do not run the python file. 

You let weewx run it and control it. 

Did you add this to weewx.conf? And restart weewx.conf?

[BYOWS]
   
# This section is for the Raspberry Pi Bring Your Own Weather Station driver.
       
   
# The driver to use

    driver
= user.meteostick_socket



You also need to change this line in weewx.conf. 

Under [Station]
    station_type = BYOWS

Then restart weewx again

In the syslog, you should see it say

engine: Loading station type BYOWS (weewx.user.byows) 

Patrick Tranchant

unread,
Dec 9, 2018, 10:55:52 AM12/9/18
to weewx-user
hi
no, I have it on bottom in the file

##############################################################################

#   This section configures the internal weewx engine.

[Engine]

    [[Services]]
        # This section specifies the services that should be run. They are
        # grouped by type, and the order of services within each group
        # determines the order in which the services will be run.
        prep_services = weewx.engine.StdTimeSynch
        data_services = ,
        process_services = weewx.engine.StdConvert, weewx.engine.StdCalibrate, weewx.engine.StdQC,$
        archive_services = weewx.engine.StdArchive
        restful_services = weewx.restx.StdStationRegistry, weewx.restx.StdWunderground, weewx.rest$
        report_services = weewx.engine.StdPrint, weewx.engine.StdReport
#################################################

[BYOWS]
    # This section is for the Raspberry Pi Bring Your Own Weather Station driver.

    # The driver to use
    driver = user.byows

I go to change by your new info in the same place

Pat

unread,
Dec 9, 2018, 11:03:55 AM12/9/18
to weewx-user
Ok. change the station_type then restart weewx and see what happens. 

Patrick Tranchant

unread,
Dec 9, 2018, 11:10:33 AM12/9/18
to weewx-user
again

mistake on my part, there were already these lines before [engine]

        report_services = weewx.engine.StdPrint, weewx.engine.StdReport
#################################################
[BYOWS]
    # This section is for the Raspberry Pi Bring Your Own Weather Station driver.

    # The driver to use
    driver = user.meteostick_socket########################################################################$


#   This section configures the internal weewx engine.

[Engine]

    [[Services]]
        # This section specifies the services that should be run. They are
        # grouped by type, and the order of services within each group
        # determines the order in which the services will be run.
        prep_services = weewx.engine.StdTimeSynch
        data_services = ,
        process_services = weewx.engine.StdConvert, weewx.engine.StdCalibrate, weewx.engine.StdQC,$
        archive_services = weewx.engine.StdArchive
        restful_services = weewx.restx.StdStationRegistry, weewx.restx.StdWunderground, weewx.rest$
        report_services = weewx.engine.StdPrint, weewx.engine.StdReport

Pat

unread,
Dec 9, 2018, 11:17:48 AM12/9/18
to weewx-user
Oops. that's my mistake - a bad copy/paste. 

This thread is getting long. I'll PM you

Patrick Tranchant

unread,
Dec 9, 2018, 11:28:36 AM12/9/18
to weewx-user
again

it is ok now, I modified by:

#################################################
[BYOWS]
    # This section is for the Raspberry Pi Bring Your Own Weather Station driver.

    # The driver to use
#    driver = user.meteostick_socket
    driver = user.byows



there was a duplicated part [Engine] !!!
, there is
  Dec  9 17:22:33 raspberrypi weewx[8988]: engine: Loading station type BYOWS (user.byows)
but there are other errors:

here are the new mistakes:

Dec  9 17:22:32 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Dec  9 17:22:33 raspberrypi weewx[8984]: engine: Initializing weewx version 3.8.2
Dec  9 17:22:33 raspberrypi weewx[8984]: engine: Using Python 2.7.13 (default, Sep 26 2018, 18:42:22) #012[GCC 6.3.0 20170516]
Dec  9 17:22:33 raspberrypi weewx[8984]: engine: Platform Linux-4.14.79-v7+-armv7l-with-debian-9.6
Dec  9 17:22:33 raspberrypi weewx[8984]: engine: Locale is 'fr_FR.UTF-8'
Dec  9 17:22:33 raspberrypi weewx[8984]: engine: pid file is /var/run/weewx.pid
Dec  9 17:22:33 raspberrypi weewx[8988]: engine: Using configuration file /etc/weewx/weewx.conf
Dec  9 17:22:33 raspberrypi weewx[8972]: Starting weewx weather system: weewx.
Dec  9 17:22:33 raspberrypi systemd[1]: Started LSB: weewx weather system.
Dec  9 17:22:33 raspberrypi weewx[8988]: engine: Loading station type BYOWS (user.byows)
Dec  9 17:22:33 raspberrypi weewx[8988]: engine: Caught unrecoverable exception in engine:
Dec  9 17:22:33 raspberrypi weewx[8988]:     ****  No module named gpiozero
Dec  9 17:22:33 raspberrypi weewx[8988]:     ****  Traceback (most recent call last):
Dec  9 17:22:33 raspberrypi weewx[8988]:     ****    File "/usr/share/weewx/weewx/engine.py", line 871, in main
Dec  9 17:22:33 raspberrypi weewx[8988]:     ****      engine = engine_class(config_dict)
Dec  9 17:22:33 raspberrypi weewx[8988]:     ****    File "/usr/share/weewx/weewx/engine.py", line 72, in __init__
Dec  9 17:22:33 raspberrypi weewx[8988]:     ****      self.setupStation(config_dict)
Dec  9 17:22:33 raspberrypi weewx[8988]:     ****    File "/usr/share/weewx/weewx/engine.py", line 96, in setupStation
Dec  9 17:22:33 raspberrypi weewx[8988]:     ****      __import__(driver)
Dec  9 17:22:33 raspberrypi weewx[8988]:     ****    File "/usr/share/weewx/user/byows.py", line 12, in <module>
Dec  9 17:22:33 raspberrypi weewx[8988]:     ****      from gpiozero import Button
Dec  9 17:22:33 raspberrypi weewx[8988]:     ****  ImportError: No module named gpiozero
Dec  9 17:22:33 raspberrypi weewx[8988]:     ****  Exiting.



patrick

Pat

unread,
Dec 9, 2018, 11:44:05 AM12/9/18
to weewx-user
I was afraid of that. 

How did you install gpiozero? I don't see it in the tutorial.

Try sudo pip install gpiozero and then restart weewx and check syslog again.

Patrick Tranchant

unread,
Dec 9, 2018, 12:39:21 PM12/9/18
to weewx-user
hi

!!!
pi@raspberrypi:~/weather-station $ sudo pip3 install gpiozero
Requirement already satisfied: gpiozero in /usr/lib/python3/dist-packages

problem with version of python ???

Patrick Tranchant

unread,
Dec 9, 2018, 12:53:04 PM12/9/18
to weewx-user
hi
just for information, my original file " weather_station_BYO_10.py" works very good and use GPIOZERO

patrick

Pat

unread,
Dec 9, 2018, 2:06:29 PM12/9/18
to weewx-user
Run this

sudo apt-get install python python-dev python-pip

Then run the python pip install gpiozero

Then restart weewx

Patrick Tranchant

unread,
Dec 9, 2018, 2:25:34 PM12/9/18
to weewx-user
 hello Pat
did you see my two previous answers?
GPIOZERO is well installed and I use pip3 and python3
should I still?

Pat

unread,
Dec 9, 2018, 2:32:27 PM12/9/18
to weewx-user
Yes but weewx uses python 2. You need pip2 to install

Patrick Tranchant

unread,
Dec 9, 2018, 2:44:20 PM12/9/18
to weewx-user
I can install Python 2 and python3 at the same time ?
Patrick

Patrick Tranchant

unread,
Dec 9, 2018, 2:59:26 PM12/9/18
to weewx-user
install pip2 for gpiozero

sudo pip2 install gpiozero
Collecting gpiozero
  Downloading https://files.pythonhosted.org/packages/8f/df/2f22cea78f4539032e091579d6f32d9ebe360c04534838d151d37a667f2d/gpiozero-1.4.1-py2.py3-none-any.whl (100kB)
    100% |████████████████████████████████| 102kB 552kB/s
Installing collected packages: gpiozero
Successfully installed gpiozero-1.4.1

and watch the resul log:
Dec  9 20:54:15 raspberrypi weewx[5741]: engine: Locale is 'fr_FR.UTF-8'
Dec  9 20:54:15 raspberrypi weewx[5741]: engine: pid file is /var/run/weewx.pid
Dec  9 20:54:15 raspberrypi weewx[5730]: Starting weewx weather system: weewx.
Dec  9 20:54:15 raspberrypi systemd[1]: Started LSB: weewx weather system.
Dec  9 20:54:15 raspberrypi weewx[5745]: engine: Using configuration file /etc/               weewx/weewx.conf
Dec  9 20:54:15 raspberrypi weewx[5745]: engine: Loading station type BYOWS (us               er.byows)
Dec  9 20:54:17 raspberrypi weewx[5745]: engine: Caught unrecoverable exception                in engine:
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****  No module named bme280
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****  Traceback (most recent call                last):
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****    File "/usr/share/weewx/wee               wx/engine.py", line 871, in main
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****      engine = engine_class(co               nfig_dict)
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****    File "/usr/share/weewx/wee               wx/engine.py", line 72, in __init__
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****      self.setupStation(config               _dict)
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****    File "/usr/share/weewx/wee               wx/engine.py", line 96, in setupStation
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****      __import__(driver)
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****    File "/usr/share/weewx/use               r/byows.py", line 15, in <module>
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****      import bme280_sensor_2
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****    File "/usr/share/weewx/use               r/bme280_sensor_2.py", line 1, in <module>
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****      import bme280
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****  ImportError: No module named                bme280
Dec  9 20:54:17 raspberrypi weewx[5745]:     ****  Exiting.

my older script works always, so gpiozero is ok !!!

patrick

Pat

unread,
Dec 9, 2018, 3:52:16 PM12/9/18
to weewx-user
We are making progress. Your gpiozero is installed. Now we need to install the bme280 library. 

sudo pip install RPi.bme280

Restart weewx when done and paste the output of syslog

Patrick Tranchant

unread,
Dec 9, 2018, 5:09:50 PM12/9/18
to weewx-user
hi,
I installed :
sudo pip2 install RPi.bme280

 sudo pip2 install RPi.bme280
Collecting RPi.bme280
  Using cached https://files.pythonhosted.org/packages/64/a9/606b2f986da18b752f02c9b0062d562907a43701d3e3ecec4a503259852f/RPi.bme280-0.2.2-py2.py3-none-any.whl
Collecting smbus2 (from RPi.bme280)
  Using cached https://www.piwheels.org/simple/smbus2/smbus2-0.2.1-py2.py3-none-any.whl
Installing collected packages: smbus2, RPi.bme280
Successfully installed RPi.bme280-0.2.2 smbus2-0.2.1

I tested my old script with python3 , it's ok

weather-station $ python3 weather_station_BYO_10.py
Measuring wind direction for 5 seconds...
Measuring wind direction for 5 seconds...
INSERT INTO WEATHER_MEASUREMENT (AMBIENT_TEMPERATURE, GROUND_TEMPERATURE, AIR_QUALITY, AIR_PRESSURE, HUMIDITY, WIND_DIRECTION, WIND_SPEED, WIND_GUST_SPEED, RAINFALL, CREATED) VALUES(20.160495623579482, 21.25, 0, 1006.4383127595189, 50.15730754965875, 0.0, 0.0, 0.0, 0.0, 2018-12-09 22:51:34);





I restarted weewx and my RPi doesn't work, I reboot three times and it is the same thing; the screen is black !!!!! ggggggggrrrrrrrrrrhhhhhhhhh

weather-station $ sudo /etc/init.d/weewx restart
[ ok ] Restarting weewx (via systemctl): weewx.service.


Patrick

Pat

unread,
Dec 9, 2018, 6:48:51 PM12/9/18
to weewx-user
Anything in the syslog as to what the error is? 

If you think it's the RPi.bme280 you can run sudo pip2 uninstall RPi.bme280 and that should remove it. 

But without that you won't be able to use weewx with your bme280 sensor. Or we'll have to find another driver like this one https://github.com/adafruit/Adafruit_Python_BME280

Patrick Tranchant

unread,
Dec 10, 2018, 12:56:17 PM12/10/18
to weewx-user
hello Pat
how are you ?

I found maybe the problem
I must unplug the BME280 module

watch the log, I didn't found anything

With the command : tail -f /var/log/syslog -n 100

Dec 10 18:31:33 raspberrypi systemd[1]: Stopping LSB: weewx weather system...
Dec 10 18:31:33 raspberrypi weewx[1721]: Stopping weewx weather system: weewx not running....
Dec 10 18:31:33 raspberrypi systemd[1]: Stopped LSB: weewx weather system.
Dec 10 18:31:33 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Dec 10 18:31:34 raspberrypi weewx[1746]: engine: Initializing weewx version 3.8.2
Dec 10 18:31:34 raspberrypi weewx[1746]: engine: Using Python 2.7.13 (default, Sep 26 2018, 18:42:22) #012[GCC 6.3.0 20170516]
Dec 10 18:31:34 raspberrypi weewx[1746]: engine: Platform Linux-4.14.79-v7+-armv7l-with-debian-9.6
Dec 10 18:31:34 raspberrypi weewx[1746]: engine: Locale is 'fr_FR.UTF-8'
Dec 10 18:31:34 raspberrypi weewx[1746]: engine: pid file is /var/run/weewx.pid
Dec 10 18:31:34 raspberrypi weewx[1751]: engine: Using configuration file /etc/weewx/weewx.conf
Dec 10 18:31:34 raspberrypi weewx[1751]: engine: Loading station type BYOWS (user.byows)
Dec 10 18:31:34 raspberrypi weewx[1734]: Starting weewx weather system: weewx.
Dec 10 18:31:34 raspberrypi systemd[1]: Started LSB: weewx weather system.
Dec 10 18:31:36 raspberrypi weewx[1751]: engine: Caught unrecoverable exception in engine:
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****  [Errno 121] Erreur d'entrée/sortie sur l'hôte cible
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****  Traceback (most recent call last):
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****    File "/usr/share/weewx/weewx/engine.py", line 871, in main
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****      engine = engine_class(config_dict)
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****    File "/usr/share/weewx/weewx/engine.py", line 72, in __init__
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****      self.setupStation(config_dict)
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****    File "/usr/share/weewx/weewx/engine.py", line 96, in setupStation
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****      __import__(driver)
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****    File "/usr/share/weewx/user/byows.py", line 15, in <module>
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****      import bme280_sensor_2
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****    File "/usr/share/weewx/user/bme280_sensor_2.py", line 9, in <module>
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****      bme280.load_calibration_params(bus,address)
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****    File "/usr/local/lib/python2.7/dist-packages/bme280/__init__.py", line 155, in load_calibration_params
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****      compensation_params.dig_T1 = read.unsigned_short(0x88)
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****    File "/usr/local/lib/python2.7/dist-packages/bme280/reader.py", line 40, in unsigned_short
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****      return self._bus.read_word_data(self._address, register) & 0xffff
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****    File "/usr/local/lib/python2.7/dist-packages/smbus2/smbus2.py", line 396, in read_word_data
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****      ioctl(self.fd, I2C_SMBUS, msg)
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****  IOError: [Errno 121] Erreur d'entrée/sortie sur l'hôte cible
Dec 10 18:31:36 raspberrypi weewx[1751]:     ****  Exiting.

  connection module BME280 on GPIO of RPi:
RPI OK
restart weewx => /etc/init.d/weewx restart
RPI NOK

Dec 10 18:36:27 raspberrypi systemd[1]: Stopping LSB: weewx weather system...
Dec 10 18:36:27 raspberrypi weewx[1806]: Stopping weewx weather system: weewx not running....
Dec 10 18:36:27 raspberrypi systemd[1]: Stopped LSB: weewx weather system.
Dec 10 18:36:27 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Dec 10 18:36:28 raspberrypi weewx[1830]: engine: Initializing weewx version 3.8.2
Dec 10 18:36:28 raspberrypi weewx[1830]: engine: Using Python 2.7.13 (default, Sep 26 2018, 18:42:22) #012[GCC 6.3.0 20170516]
Dec 10 18:36:28 raspberrypi weewx[1830]: engine: Platform Linux-4.14.79-v7+-armv7l-with-debian-9.6
Dec 10 18:36:28 raspberrypi weewx[1830]: engine: Locale is 'fr_FR.UTF-8'
Dec 10 18:36:28 raspberrypi weewx[1830]: engine: pid file is /var/run/weewx.pid
Dec 10 18:36:28 raspberrypi weewx[1835]: engine: Using configuration file /etc/weewx/weewx.conf
Dec 10 18:36:28 raspberrypi weewx[1835]: engine: Loading station type BYOWS (user.byows)
Dec 10 18:36:28 raspberrypi weewx[1819]: Starting weewx weather system: weewx.
Dec 10 18:36:28 raspberrypi systemd[1]: Started LSB: weewx weather system.

unplug module BME280
reboot OK
I go to watch the syslog

open syslog => cat /var/log/syslog
I go before RPi NOK

Dec 10 18:31:36 raspberrypi weewx[1751]:     ****  Exiting.
Dec 10 18:30:34 raspberrypi systemd-modules-load[83]: Inserted module 'i2c_dev'
Dec 10 18:30:34 raspberrypi systemd-modules-load[83]: Inserted module 'w1_gpio'
Dec 10 18:30:34 raspberrypi systemd-modules-load[83]: Inserted module 'w1_therm'
Dec 10 18:30:34 raspberrypi fake-hwclock[89]: lundi 10 décembre 2018, 17:17:01 (UTC+0000)
Dec 10 18:30:34 raspberrypi systemd-fsck[114]: fsck: /etc/fstab: parse error at line 6 -- ignored
Dec 10 18:30:34 raspberrypi systemd[1]: Started Create Static Device Nodes in /dev.
Dec 10 18:30:34 raspberrypi systemd[1]: Starting udev Kernel Device Manager...
Dec 10 18:30:34 raspberrypi systemd-fsck[114]: /dev/mmcblk0p2 : propre, 149537/1911616 fichiers, 1780623/7779968 blocs
Dec 10 18:30:34 raspberrypi systemd[1]: Started File System Check on Root Device

I go to try uninstall pip2 RPi.bme280

Patrick Tranchant

unread,
Dec 10, 2018, 1:07:38 PM12/10/18
to weewx-user
Again me

I confirm,

sudo pip2 uninstall RPi.bme280
Uninstalling RPi.bme280-0.2.2:
  /usr/local/lib/python2.7/dist-packages/RPi.bme280-0.2.2.dist-info/DESCRIPTION.rst
  /usr/local/lib/python2.7/dist-packages/RPi.bme280-0.2.2.dist-info/INSTALLER
  /usr/local/lib/python2.7/dist-packages/RPi.bme280-0.2.2.dist-info/METADATA
  /usr/local/lib/python2.7/dist-packages/RPi.bme280-0.2.2.dist-info/RECORD
  /usr/local/lib/python2.7/dist-packages/RPi.bme280-0.2.2.dist-info/WHEEL
  /usr/local/lib/python2.7/dist-packages/RPi.bme280-0.2.2.dist-info/metadata.json
  /usr/local/lib/python2.7/dist-packages/RPi.bme280-0.2.2.dist-info/top_level.txt
  /usr/local/lib/python2.7/dist-packages/bme280/__init__.py
  /usr/local/lib/python2.7/dist-packages/bme280/__init__.pyc
  /usr/local/lib/python2.7/dist-packages/bme280/const.py
  /usr/local/lib/python2.7/dist-packages/bme280/const.pyc
  /usr/local/lib/python2.7/dist-packages/bme280/reader.py
  /usr/local/lib/python2.7/dist-packages/bme280/reader.pyc
Proceed (y/n)? y
  Successfully uninstalled RPi.bme280-0.2.2

 sudo pip3 install RPi.bme280
Requirement already satisfied: RPi.bme280 in /usr/local/lib/python3.5/dist-packages
Requirement already satisfied: smbus2 in /usr/local/lib/python3.5/dist-packages (from RPi.bme280)

sudo /etc/init.d/weewx restart
[ ok ] Restarting weewx (via systemctl): weewx.service.

RPi OK

maybe you do not need 2 versions of bme280

Patrick Tranchant

unread,
Dec 10, 2018, 1:21:12 PM12/10/18
to weewx-user
I uninstall pip3 RPi.bme280
I install pip2 RPi.bme280

This is the same problem , when I restart weewx , the RPi is NOK

Patrick Tranchant

unread,
Dec 10, 2018, 2:15:41 PM12/10/18
to weewx-user
hi

I uninstall pip2 RPi.bme280
I see on website Adafruit

[The default python on your computer may not be python 3. Python 2 is officially discontinued and all our libraries are Python 3 only.

We'll be using python3 and pip3 in our commands, use those versions of python and pip to make sure you're using 3 and not 2]


I don't have an adafruit.bme280but compatible, it is ok with my old script.

I don't know what to do.....


patrick

Pat

unread,
Dec 10, 2018, 2:17:31 PM12/10/18
to weewx-user
The BME280 can only be open at a time once. 

You must close your other script. 

Is weather_station_BYO_10.py running when you try to run weewx and reboot?

If so stop it and try again

Patrick Tranchant

unread,
Dec 10, 2018, 2:47:24 PM12/10/18
to weewx-user
yes the script weather_station_BYO_10.py is stopped

I run it just for test and after I stopped it

patrick

Pat

unread,
Dec 10, 2018, 3:52:27 PM12/10/18
to weewx-user
Ok get your Raspberry Pi back to a working state. Remove the python2 package. 

We will try another way

rich T

unread,
Dec 10, 2018, 6:13:00 PM12/10/18
to weewx-user
Patrick

Is this the BME280 python package you are using?  It works with python 2 and python 3.


Rich


On Monday, December 10, 2018 at 2:47:24 PM UTC-5, Patrick Tranchant wrote:

Patrick Tranchant

unread,
Dec 11, 2018, 3:31:57 AM12/11/18
to weewx-user
hello Rich T

yes, I used this package but in Pyton3 or 2

sudo pip(3) install RPi.bme280
this is the same problem

the module works with my script, just problem with Weewx.

Patrick

Pat

unread,
Dec 11, 2018, 9:56:26 AM12/11/18
to weewx-user
Patrick is your raspberry pi working again?

Patrick Tranchant

unread,
Dec 11, 2018, 11:12:15 AM12/11/18
to weewx-user
hello
yes it works
I tested with my script, just a little problem with the wind_direction (script I think )

Patrick Tranchant

unread,
Dec 17, 2018, 2:29:00 PM12/17/18
to weewx-user
Hello Pat

my station is OK now,
any news for me

have a good evening

Patrick Tranchant

unread,
Dec 20, 2018, 2:03:05 PM12/20/18
to weewx-user
hello Pat,

I try to run the script with Thonny, and I have an error on line" import weedb" => ImportError : No Module named "weedb"
problem with the path !!!

vk3...@gmail.com

unread,
Dec 28, 2018, 5:27:53 PM12/28/18
to weewx-user
You need to make sure that the weewx bin directory is in the PYTHONPATH.

I've just run weewx from python, but something like 

$ PYTHONPATH=/home/weewx/bin thonny......

- Use whatever the location of weewx is and whatever command you use to invoke thonny.

Susan

Patrick Tranchant

unread,
Dec 30, 2018, 12:56:31 PM12/30/18
to weewx-user
 hello PAT

I could install weewx on new RPi
Watch the new error:

Dec 30 18:44:19 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Dec 30 18:44:19 raspberrypi weewx[1389]: engine: Initializing weewx version 3.8.2
Dec 30 18:44:19 raspberrypi weewx[1389]: engine: Using Python 2.7.13 (default, Sep 26 2018, 18:42:22) #012[GCC 6.3.0 20170516]
Dec 30 18:44:19 raspberrypi weewx[1389]: engine: Platform Linux-4.14.71-v7+-armv7l-with-debian-9.4
Dec 30 18:44:19 raspberrypi weewx[1389]: engine: Locale is 'fr_FR.UTF-8'
Dec 30 18:44:19 raspberrypi weewx[1389]: engine: pid file is /var/run/weewx.pid
Dec 30 18:44:20 raspberrypi weewx[1393]: engine: Using configuration file /etc/weewx/weewx.conf
Dec 30 18:44:20 raspberrypi weewx[1393]: engine: Loading station type BYOWS (user.byows)
Dec 30 18:44:20 raspberrypi weewx[1378]: Starting weewx weather system: weewx.
Dec 30 18:44:20 raspberrypi systemd[1]: Started LSB: weewx weather system.
Dec 30 18:44:22 raspberrypi weewx[1393]: engine: Caught unrecoverable exception in engine:
Dec 30 18:44:22 raspberrypi weewx[1393]:     ****  No module named statistics
Dec 30 18:44:22 raspberrypi weewx[1393]:     ****  Traceback (most recent call last):
Dec 30 18:44:22 raspberrypi weewx[1393]:     ****    File "/usr/share/weewx/weewx/engine.py", line 871, in main
Dec 30 18:44:22 raspberrypi weewx[1393]:     ****      engine = engine_class(config_dict)
Dec 30 18:44:22 raspberrypi weewx[1393]:     ****    File "/usr/share/weewx/weewx/engine.py", line 72, in __init__
Dec 30 18:44:22 raspberrypi weewx[1393]:     ****      self.setupStation(config_dict)
Dec 30 18:44:22 raspberrypi weewx[1393]:     ****    File "/usr/share/weewx/weewx/engine.py", line 96, in setupStation
Dec 30 18:44:22 raspberrypi weewx[1393]:     ****      __import__(driver)
Dec 30 18:44:22 raspberrypi weewx[1393]:     ****    File "/usr/share/weewx/user/byows.py", line 17, in <module>
Dec 30 18:44:22 raspberrypi weewx[1393]:     ****      import statistics
Dec 30 18:44:22 raspberrypi weewx[1393]:     ****  ImportError: No module named statistics
Dec 30 18:44:22 raspberrypi weewx[1393]:     ****  Exiting.

I could test avec "Simulator" and after I modified the file to use "byows driver" as the other RPi.
on this RPI, I have just install Apache2, I think that I must install also Mysql . Yes or No

Patrick

Pat

unread,
Dec 30, 2018, 12:59:00 PM12/30/18
to weewx-user
Sorry, my time has been short lately. I am hoping someone else can jump in and help finish this. 

For this error try running sudo pip install statistics

Again, I don't think you can run your script and weewx at the same time. 

It will be one or the other. 

Patrick Tranchant

unread,
Dec 30, 2018, 1:05:44 PM12/30/18
to weewx-user
no problem, I was also in Holidays in ROME.
I could install Statistics and new  Error:


Dec 30 19:01:31 raspberrypi systemd[1]: Stopping LSB: weewx weather system...
Dec 30 19:01:31 raspberrypi weewx[1506]: Stopping weewx weather system: weewx not running....
Dec 30 19:01:31 raspberrypi systemd[1]: Stopped LSB: weewx weather system.
Dec 30 19:01:31 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Dec 30 19:01:32 raspberrypi weewx[1531]: engine: Initializing weewx version 3.8.2
Dec 30 19:01:32 raspberrypi weewx[1531]: engine: Using Python 2.7.13 (default, Sep 26 2018, 18:42:22) #012[GCC 6.3.0 20170516]
Dec 30 19:01:32 raspberrypi weewx[1531]: engine: Platform Linux-4.14.71-v7+-armv7l-with-debian-9.4
Dec 30 19:01:32 raspberrypi weewx[1531]: engine: Locale is 'fr_FR.UTF-8'
Dec 30 19:01:32 raspberrypi weewx[1531]: engine: pid file is /var/run/weewx.pid
Dec 30 19:01:32 raspberrypi weewx[1519]: Starting weewx weather system: weewx.
Dec 30 19:01:32 raspberrypi systemd[1]: Started LSB: weewx weather system.
Dec 30 19:01:32 raspberrypi weewx[1535]: engine: Using configuration file /etc/weewx/weewx.conf
Dec 30 19:01:32 raspberrypi weewx[1535]: engine: Loading station type BYOWS (user.byows)
Dec 30 19:01:34 raspberrypi weewx[1535]: engine: Caught unrecoverable exception in engine:
Dec 30 19:01:34 raspberrypi weewx[1535]:     ****  name 'BYOWS' is not defined
Dec 30 19:01:34 raspberrypi weewx[1535]:     ****  Traceback (most recent call last):
Dec 30 19:01:34 raspberrypi weewx[1535]:     ****    File "/usr/share/weewx/weewx/engine.py", line 871, in main
Dec 30 19:01:34 raspberrypi weewx[1535]:     ****      engine = engine_class(config_dict)
Dec 30 19:01:34 raspberrypi weewx[1535]:     ****    File "/usr/share/weewx/weewx/engine.py", line 72, in __init__
Dec 30 19:01:34 raspberrypi weewx[1535]:     ****      self.setupStation(config_dict)
Dec 30 19:01:34 raspberrypi weewx[1535]:     ****    File "/usr/share/weewx/weewx/engine.py", line 96, in setupStation
Dec 30 19:01:34 raspberrypi weewx[1535]:     ****      __import__(driver)
Dec 30 19:01:34 raspberrypi weewx[1535]:     ****    File "/usr/share/weewx/user/byows.py", line 30, in <module>
Dec 30 19:01:34 raspberrypi weewx[1535]:     ****      wind_speed_sensor.when_pressed = BYOWS.spin # is this a valid call for the below class function?
Dec 30 19:01:34 raspberrypi weewx[1535]:     ****  NameError: name 'BYOWS' is not defined
Dec 30 19:01:34 raspberrypi weewx[1535]:     ****  Exiting.

Pat

unread,
Dec 31, 2018, 9:09:06 AM12/31/18
to weewx-user
Did you add the test byows.py file to your bin/user folder?

Patrick Tranchant

unread,
Dec 31, 2018, 9:25:50 AM12/31/18
to weewx-user

hello PAT,
yes I think, I join the files weewx.conf and byows.py that I use

Patrick
byows.py
weewx.conf

Pat

unread,
Dec 31, 2018, 9:56:45 AM12/31/18
to weewx-user
Can you paste the directory listing for your user/bin folder? 

Pat

unread,
Dec 31, 2018, 9:57:14 AM12/31/18
to weewx-user
Correction, I meant to say bin/user folder. 

Pat

unread,
Dec 31, 2018, 10:08:46 AM12/31/18
to weewx-user
Also try changing this in weewx.conf to driver = user.BYOWS using capitals instead.

Patrick Tranchant

unread,
Dec 31, 2018, 11:41:33 AM12/31/18
to weewx-user
hi
here is:

pi@raspberrypi:~ $ cd /usr/share/weewx/user/
pi@raspberrypi:/usr/share/weewx/user $ ls -ail
total 64
259101 drwxr-xr-x  2 root root 4096 déc.  30 19:28 .
259024 drwxr-xr-x 10 root root 4096 déc.  30 19:19 ..
259242 -rw-r--r--  1 root root  288 déc.  30 17:55 bme280_sensor_2.py
259321 -rw-r--r--  1 root root  614 déc.  30 18:12 bme280_sensor_2.pyc
259317 -rw-r--r--  1 root root 5612 déc.  30 17:55 byows.py
259241 -rw-r--r--  1 root root 5244 déc.  30 18:12 byows.pyc
259318 -rw-r--r--  1 root root 1239 déc.  30 17:55 ds18b20_therm.py
259349 -rw-r--r--  1 root root 1706 déc.  30 19:01 ds18b20_therm.pyc
259103 -rw-r--r--  1 root root  541 août  16 18:06 extensions.py
259204 -rw-r--r--  1 root root  419 déc.  30 17:37 extensions.pyc
259102 -rw-r--r--  1 root root  306 août  16 18:06 __init__.py
258839 -rw-r--r--  1 root root  324 déc.  30 17:37 __init__.pyc
259319 -rw-r--r--  1 root root 1577 déc.  30 17:55 wind_direction_byo_5.py
259322 -rw-r--r--  1 root root 1874 déc.  30 18:44 wind_direction_byo_5.pyc

Patrick Tranchant

unread,
Dec 31, 2018, 11:49:03 AM12/31/18
to weewx-user
or this:

pi@raspberrypi:/usr/share/weewx/user $ cd /usr/bin/
pi@raspberrypi:/usr/bin $ ls -ail
.
.
.
59438 lrwxrwxrwx  1 root root         25 août  16 18:06 wee_config -> ../share/weewx/wee_config
59443 lrwxrwxrwx  1 root root         27 août  16 18:06 wee_database -> ../share/weewx/wee_database
59446 lrwxrwxrwx  1 root root         24 août  16 18:06 wee_debug -> ../share/weewx/wee_debug
59445 lrwxrwxrwx  1 root root         25 août  16 18:06 wee_device -> ../share/weewx/wee_device
59440 lrwxrwxrwx  1 root root         28 août  16 18:06 wee_extension -> ../share/weewx/wee_extension
59439 lrwxrwxrwx  1 root root         25 août  16 18:06 wee_import -> ../share/weewx/wee_import
59441 lrwxrwxrwx  1 root root         26 août  16 18:06 wee_reports -> ../share/weewx/wee_reports
59444 lrwxrwxrwx  1 root root         21 août  16 18:06 weewxd -> ../share/weewx/weewxd

Is that what you want

Patrick Tranchant

unread,
Dec 31, 2018, 11:53:18 AM12/31/18
to weewx-user
I modified the files "weewx.conf" but this the same thing

Dec 31 17:51:36 raspberrypi systemd[1]: Stopping LSB: weewx weather system...
Dec 31 17:51:36 raspberrypi weewx[1858]: Stopping weewx weather system: weewx not running....
Dec 31 17:51:36 raspberrypi systemd[1]: Stopped LSB: weewx weather system.
Dec 31 17:51:36 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Dec 31 17:51:36 raspberrypi weewx[1882]: engine: Initializing weewx version 3.8.2
Dec 31 17:51:36 raspberrypi weewx[1882]: engine: Using Python 2.7.13 (default, Sep 26 2018, 18:42:22) #012[GCC 6.3.0 20170516]
Dec 31 17:51:36 raspberrypi weewx[1882]: engine: Platform Linux-4.14.71-v7+-armv7l-with-debian-9.4
Dec 31 17:51:36 raspberrypi weewx[1882]: engine: Locale is 'fr_FR.UTF-8'
Dec 31 17:51:36 raspberrypi weewx[1882]: engine: pid file is /var/run/weewx.pid
Dec 31 17:51:36 raspberrypi weewx[1886]: engine: Using configuration file /etc/weewx/weewx.conf
Dec 31 17:51:36 raspberrypi weewx[1886]: engine: Debug is 1
Dec 31 17:51:36 raspberrypi weewx[1886]: engine: Initializing engine
Dec 31 17:51:36 raspberrypi weewx[1886]: engine: Loading station type BYOWS (user.BYOWS)
Dec 31 17:51:36 raspberrypi systemd[1]: Started LSB: weewx weather system.
Dec 31 17:51:36 raspberrypi weewx[1870]: Starting weewx weather system: weewx.
Dec 31 17:51:36 raspberrypi weewx[1886]: engine: Caught unrecoverable exception in engine:
Dec 31 17:51:36 raspberrypi weewx[1886]:     ****  No module named BYOWS
Dec 31 17:51:36 raspberrypi weewx[1886]:     ****  Traceback (most recent call last):
Dec 31 17:51:36 raspberrypi weewx[1886]:     ****    File "/usr/share/weewx/weewx/engine.py", line 871, in main
Dec 31 17:51:36 raspberrypi weewx[1886]:     ****      engine = engine_class(config_dict)
Dec 31 17:51:36 raspberrypi weewx[1886]:     ****    File "/usr/share/weewx/weewx/engine.py", line 72, in __init__
Dec 31 17:51:36 raspberrypi weewx[1886]:     ****      self.setupStation(config_dict)
Dec 31 17:51:36 raspberrypi weewx[1886]:     ****    File "/usr/share/weewx/weewx/engine.py", line 96, in setupStation
Dec 31 17:51:36 raspberrypi weewx[1886]:     ****      __import__(driver)
Dec 31 17:51:36 raspberrypi weewx[1886]:     ****  ImportError: No module named BYOWS
Dec 31 17:51:36 raspberrypi weewx[1886]:     ****  Exiting.

Patrick Tranchant

unread,
Dec 31, 2018, 11:58:36 AM12/31/18
to weewx-user
I have installed Weewx by the command : apt-get install weewx, I can remove and use other ?

Pat

unread,
Dec 31, 2018, 1:43:33 PM12/31/18
to weewx-user
That install method is supported. 

Everything so far seems OK and I'm not able to replicate this error since I don't have the hardware.

What happens if you type sudo weewxd /etc/weewx/weewx.conf ?

gjr80

unread,
Dec 31, 2018, 2:38:07 PM12/31/18
to weewx-user
user.BYOWS and user.byows are two different things. You have been using user.BYOWS in weewx.conf yet you have a file user/byows.py. Try using user.byows in weewx.conf.

Gary

Pat

unread,
Dec 31, 2018, 3:24:58 PM12/31/18
to weewx-user
With a new install using apt-get, I was able to get the driver to run with this config. 

I don't have the hardware so nothing happens.

[Station]
   
   
# Description of the station location
    location
= "byows"
   
   
# Latitude and longitude in decimal degrees
    latitude
= 90.000
    longitude
= 0.000
   
   
# Altitude of the station, with unit it is in. This is downloaded from
   
# from the station if the hardware supports it.
    altitude
= 0, meter
   
   
# Set to type of station hardware. There must be a corresponding stanza
   
# in this file with a 'driver' parameter indicating the driver to be used.
   
#station_type = Simulator
    station_type
= BYOWS
   
   
# If you have a website, you may specify an URL
   
#station_url = http://www.example.com
   
   
# The start of the rain year (1=January; 10=October, etc.). This is
   
# downloaded from the station if the hardware supports it.
    rain_year_start
= 1
   
   
# Start of week (0=Monday, 6=Sunday)
    week_start
= 6


##############################################################################


[BYOWS]
   
# This section is for the Raspberry Pi Bring Your Own Weather Station driver.
       
   
# The driver to use
    driver
= user.byows

Patrick Tranchant

unread,
Jan 1, 2019, 7:07:17 AM1/1/19
to weewx-user
hello Gary and PAT, HNY 2019

I could reinstalled with the other method, but I have the same error, look, and here is the conf, is the error not in byows.py (with capital or lowercase) ... ..
see you

Patrick

Jan  1 12:35:16 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Jan  1 12:35:16 raspberrypi weewx[1711]: engine: Initializing weewx version 3.8.2
Jan  1 12:35:16 raspberrypi weewx[1711]: engine: Using Python 2.7.13 (default, Sep 26 2018, 18:42:22) #012[GCC 6.3.0 20170516]
Jan  1 12:35:16 raspberrypi weewx[1711]: engine: Platform Linux-4.14.71-v7+-armv7l-with-debian-9.4
Jan  1 12:35:16 raspberrypi weewx[1711]: engine: Locale is 'fr_FR.UTF-8'
Jan  1 12:35:16 raspberrypi weewx[1711]: engine: pid file is /var/run/weewx.pid
Jan  1 12:35:16 raspberrypi weewx[1715]: engine: Using configuration file /home/weewx/weewx.conf
Jan  1 12:35:16 raspberrypi weewx[1715]: engine: Loading station type BYOWS (user.byows)
Jan  1 12:35:16 raspberrypi systemd[1]: Started LSB: weewx weather system.
Jan  1 12:35:16 raspberrypi weewx[1699]: Starting weewx weather system: weewx.
Jan  1 12:35:19 raspberrypi weewx[1715]: engine: Caught unrecoverable exception in engine:
Jan  1 12:35:19 raspberrypi weewx[1715]:     ****  name 'BYOWS' is not defined
Jan  1 12:35:19 raspberrypi weewx[1715]:     ****  Traceback (most recent call last):
Jan  1 12:35:19 raspberrypi weewx[1715]:     ****    File "/home/weewx/bin/weewx/engine.py", line 871, in main
Jan  1 12:35:19 raspberrypi weewx[1715]:     ****      engine = engine_class(config_dict)
Jan  1 12:35:19 raspberrypi weewx[1715]:     ****    File "/home/weewx/bin/weewx/engine.py", line 72, in __init__
Jan  1 12:35:19 raspberrypi weewx[1715]:     ****      self.setupStation(config_dict)
Jan  1 12:35:19 raspberrypi weewx[1715]:     ****    File "/home/weewx/bin/weewx/engine.py", line 96, in setupStation
Jan  1 12:35:19 raspberrypi weewx[1715]:     ****      __import__(driver)
Jan  1 12:35:19 raspberrypi weewx[1715]:     ****    File "/home/weewx/bin/user/byows.py", line 30, in <module>
Jan  1 12:35:19 raspberrypi weewx[1715]:     ****      wind_speed_sensor.when_pressed = BYOWS.spin # is this a valid call for the below class function?
Jan  1 12:35:19 raspberrypi weewx[1715]:     ****  NameError: name 'BYOWS' is not defined
Jan  1 12:35:19 raspberrypi weewx[1715]:     ****  Exiting.
byows.py
weewx.conf

Patrick Tranchant

unread,
Jan 1, 2019, 7:34:29 AM1/1/19
to weewx-user
I modified the script "byows.py"

wind_speed_sensor.when_pressed = byows.spin # is this a valid call for the below class function?

rain_sensor = Button(6)
rain_sensor.when_pressed = byows.bucket_tipped # is this a valid call for the below class function?

def logmsg(dst, msg):
    syslog.syslog(dst, 'byows: %s' % msg)
but it is the same error

Jan  1 13:30:32 raspberrypi weewx[2019]:     ****  name 'byows' is not defined
Jan  1 13:30:32 raspberrypi weewx[2019]:     ****  Traceback (most recent call last):
Jan  1 13:30:32 raspberrypi weewx[2019]:     ****    File "/home/weewx/bin/weewx/engine.py", line 871, in main
Jan  1 13:30:32 raspberrypi weewx[2019]:     ****      engine = engine_class(config_dict)
Jan  1 13:30:32 raspberrypi weewx[2019]:     ****    File "/home/weewx/bin/weewx/engine.py", line 72, in __init__
Jan  1 13:30:32 raspberrypi weewx[2019]:     ****      self.setupStation(config_dict)
Jan  1 13:30:32 raspberrypi weewx[2019]:     ****    File "/home/weewx/bin/weewx/engine.py", line 96, in setupStation
Jan  1 13:30:32 raspberrypi weewx[2019]:     ****      __import__(driver)
Jan  1 13:30:32 raspberrypi weewx[2019]:     ****    File "/home/weewx/bin/user/byows.py", line 30, in <module>
Jan  1 13:30:32 raspberrypi weewx[2019]:     ****      wind_speed_sensor.when_pressed = byows.spin # is this a valid call for the below class function?
Jan  1 13:30:32 raspberrypi weewx[2019]:     ****  NameError: name 'byows' is not defined

where is define 'BYOWS' ?

see you

Patrick

Patrick Tranchant

unread,
Jan 1, 2019, 7:38:18 AM1/1/19
to weewx-user
in my original file, there is:

def spin():
    global wind_count
    wind_count = wind_count + 1
   

maybe it's missing in "byows.py"? I do not know

Pat

unread,
Jan 1, 2019, 8:04:41 AM1/1/19
to weewx-user
Try this version of byows.py - copy to bin/user and restart weewx.
byows.py

Patrick Tranchant

unread,
Jan 1, 2019, 10:00:20 AM1/1/19
to weewx-user
I do it, but this the same ERROR

Jan  1 15:55:56 raspberrypi weewx[2593]: engine: pid file is /var/run/weewx.pid
Jan  1 15:55:56 raspberrypi weewx[2597]: engine: Using configuration file /home/weewx/weewx.conf
Jan  1 15:55:56 raspberrypi weewx[2597]: engine: Loading station type BYOWS (user.byows)
Jan  1 15:55:56 raspberrypi weewx[2582]: Starting weewx weather system: weewx.
Jan  1 15:55:56 raspberrypi systemd[1]: Started LSB: weewx weather system.
Jan  1 15:55:59 raspberrypi weewx[2597]: engine: Caught unrecoverable exception in engine:
Jan  1 15:55:59 raspberrypi weewx[2597]:     ****  name 'BYOWS' is not defined
Jan  1 15:55:59 raspberrypi weewx[2597]:     ****  Traceback (most recent call last):
Jan  1 15:55:59 raspberrypi weewx[2597]:     ****    File "/home/weewx/bin/weewx/engine.py", line 871, in main
Jan  1 15:55:59 raspberrypi weewx[2597]:     ****      engine = engine_class(config_dict)
Jan  1 15:55:59 raspberrypi weewx[2597]:     ****    File "/home/weewx/bin/weewx/engine.py", line 72, in __init__
Jan  1 15:55:59 raspberrypi weewx[2597]:     ****      self.setupStation(config_dict)
Jan  1 15:55:59 raspberrypi weewx[2597]:     ****    File "/home/weewx/bin/weewx/engine.py", line 96, in setupStation
Jan  1 15:55:59 raspberrypi weewx[2597]:     ****      __import__(driver)
Jan  1 15:55:59 raspberrypi weewx[2597]:     ****    File "/home/weewx/bin/user/byows.py", line 32, in <module>
Jan  1 15:55:59 raspberrypi weewx[2597]:     ****      wind_speed_sensor.when_pressed = BYOWS.spin # is this a valid call for the below class function?
Jan  1 15:55:59 raspberrypi weewx[2597]:     ****  NameError: name 'BYOWS' is not defined
Jan  1 15:55:59 raspberrypi weewx[2597]:     ****  Exiting.

Pat

unread,
Jan 1, 2019, 10:12:34 AM1/1/19
to weewx-user
Is your weewx Pi available externally? If I find a few minutes later I could try to SSH to it?

Patrick Tranchant

unread,
Jan 1, 2019, 10:54:31 AM1/1/19
to weewx-user
ok
I go to configure a DMZ and I come back to you, by private mail if possible

patrick

Patrick Tranchant

unread,
Jan 1, 2019, 11:18:32 AM1/1/19
to weewx-user
I am ready Pat

Pat O'Brien

unread,
Jan 1, 2019, 11:38:04 AM1/1/19
to weewx...@googlegroups.com
Yes you can send me a private mail. I can't look at it for a few hours. Maybe you can leave it there for a day or so? Send me a login and your home ip in private mail. 

--
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/ZoDjJYZJR9o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gjr80

unread,
Jan 1, 2019, 2:30:19 PM1/1/19
to weewx-user
In this case the problem is your code is trying use a BYOWS object before the BYOWS class has been defined. You need to re-structure your code to avoid calling the class before it is defined.

Gary

Pat

unread,
Jan 1, 2019, 2:31:16 PM1/1/19
to weewx-user
Exactly correct. I'm SSH'd to his Pi and debugging now. Will probably need more help soon but for now the driver is at least working. Unsure on validity of sensor values quite yet. 

Pat

unread,
Jan 1, 2019, 2:52:17 PM1/1/19
to weewx-user
I've actually run out of time for today. 

Gary, I could use some help if you (or anyone else) has some time. I haven't done much special on the driver other than try to bolt everything together from the Tutorial's code and some of Patrick's code provided in this thread. Since I don't have the hardware it's a logical first step to me. 

In bolting things together it's making calls to other files which seems a bit sloppy for a driver. Perhaps there's a quick way to clean this up and consolidate? 

Secondly, in the genPackets function, there's a while loop which is counting the wind speed from the wind_direction_byo_5.py file and it delays things for roughly 60 seconds in 5 second intervals. Seems like there could be a better way to let weewx handle the wind speed counter?

This is where some of my inexperience with driver making starts to show up with wind speed counting and rain bucket tip counting. :)

Help is appreciated to try and finish this driver. 

Thanks
byows.py
bme280_sensor_2.py
wind_direction_byo_5.py

Patrick Tranchant

unread,
Jan 2, 2019, 2:23:58 PM1/2/19
to weewx-user
Hello Pat and Gary

I have reinstall on a new SD card Weewx with Apt-get install, that works good ( so as yesterday ).
that is a good thing.
Now, I installed also Mysql, I must to configure Mysql and no Sqlite3, I think , it is best, Yes
Say me

Patrick

gjr80

unread,
Jan 3, 2019, 4:21:47 PM1/3/19
to weewx-user
Patrick,

If you are struggling to get something working with weeWX then you are best advised to stick with SQLite. It is simple to use and easy to manage and just works. Setting up MySQL just adds more complexity, something you generally don't want if you are debugging other issues. In most cases unless you have a specific reason you are best served sticking with SQLite. The recommended approach is to get a stable functioning weeWX install and then migrate to MySQL if you wish to go down that path. That being said if you have installed MySQL /MariaDB and have it working without error then leave it be.

Gary

gjr80

unread,
Jan 3, 2019, 4:22:59 PM1/3/19
to weewx-user
Happy to help where/when I can though I have none of this hardware so that limits advice to reviewing code/errors.

Gary

Patrick Tranchant

unread,
Jan 4, 2019, 12:58:32 PM1/4/19
to weewx-user
hello Gary

I prefer to use Mysql, because I installed already Nagios, Cacti, Zoneminder with Mysql, I know a little bit Mysql;
Is the config de Mysql inside Weewx.conf ? and in an other file ?

say me, thanks

Patrick Tranchant

unread,
Jan 4, 2019, 2:28:15 PM1/4/19
to weewx-user
Again Gary;

for the others values, Must I to modify the weewx.conf file ?  or just for config Mysql,
All is done inside the driver ?

Pat

unread,
Jan 4, 2019, 2:29:24 PM1/4/19
to weewx-user

gjr80

unread,
Jan 4, 2019, 2:31:06 PM1/4/19
to weewx-user
Patrick,

No problems. As far as weeWX is concerned all of the MySQL config information is located in the [DatabaseTypes], [Databases] and [DataBindings] stanazas in weewx.conf. Chances are they are already pre-configured with most of what you want. I strongly suggest you read the Configuring MySQL section in the User's Guide (http://weewx.com/docs/usersguide.htm#configuring_mysql)

Gary

Patrick Tranchant

unread,
Jan 4, 2019, 2:31:26 PM1/4/19
to weewx-user
thank you Pat

I didn't see this chapter.
thanks

Patrick Tranchant

unread,
Jan 4, 2019, 2:33:11 PM1/4/19
to weewx-user
ok Gary

Pat said me also
It is loading more messages.
0 new messages