Trying to get a Rainwise Tipping Bucket to work

69 views
Skip to first unread message

michael form

unread,
May 3, 2020, 2:47:46 PM5/3/20
to weewx-user
Through much help from this forum, I have gotten WEEWX generally working on a Raspberry Pi 4. The only thing that does not seem to work is the input from my Rainwise Tipping Bucket using a DS2423 1-wire counter. My question is how should the device be listed in weewx.conf?

Should the sensor_map listing be: rain = /uncached/1D.30C60D000000,   or rain = /uncached/1D.30C60D000000/counters.B   or something else?

Should the sensor_type be:  rain = rainwise_bucket,  or   rain = delta  or something else?

Basically, the "Rain (Hourly Total) plot (always at zero), and the RAIN TODAY and RAIN RATE on the summary are both zero (using the Seasons skin) even though I have poured at least a hurricane's worth of water into the bucket. I can hear the tipping mechanism working.

Thanks for any help on how to list the device or suggestions where I should look.
 

Glenn McKechnie

unread,
May 3, 2020, 6:17:00 PM5/3/20
to weewx...@googlegroups.com
Assuming the rainwise bucket has a hobby-board counter, which uses the
DS2423 then the following will be your configuration...

[OWFS]

[[sensor_type]]
rain = rainwise_bucket

[[sensor_map]]
rain = /uncached/1D.30C60D000000

The counter.B is hardcoded in the driver so you don't need to add that part.

Is this the latest weewx, version 4.
Have you looked in syslog to see what is being reported?

The actual values from the sensors can be read directly using the
owfs.py driver script.
Are you using that script, and what is the interface ... usb, i2c-1
localhost ???

If the installation is working then something along the lines of

PYTHONPATH=/home/weewx/bin python /home/weewx/bin/user/owfs.py
--reading=/uncached/1D.81B500000000/Counter.B

should give a result. Pour water in and the counter.B value should increment
Adjust paths to suit. You may need to specify your interface as --iface==XXXX

If that doesn't return a result then more info will be needed, in
particular about your installation.

1. your setup
2. version of weewx
3. which script / driver are you using
4. the syslog output !
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/b3e5aed9-7e7b-4e0c-acf1-bdb6f4dfdeb7%40googlegroups.com.
>


--


Cheers
Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

Michael Form

unread,
May 3, 2020, 8:35:10 PM5/3/20
to weewx...@googlegroups.com
Glenn:

You have come to the rescue once again.

However, I have what you suggested in the type and map entries which
does not work.

When I try,  sudo PYTHONPATH=/usr/share/weewx python
/usr/share/weewx/user/owfs.py --reading=/uncached/1D.30C60D000000

I get the old exNoController message:

  File "/usr/lib/python2.7/dist-packages/ow/__init__.py", line 223, in init
    raise exNoController
ow.exNoController

I stopped trying to figure out the reason that I was getting this error
since weewx was working fine. It would be good to figure out the reason
for the error as it would be useful to read the sensors directly.

My setup is weewx version 3.9.2 running with Python 2.7 on a Raspberry
Pi 4. I am using OWFS.

syslog shows no problems with the "rain" info with the "correct map and
type settings (although it does show errors when I had other settings).
There were errors when I tried to read the sensor:

May  3 19:46:38 raspberrypi weewx[1755]: engine: Terminating weewx
version 3.9.2
May  3 19:46:43 raspberrypi weewx[9679]: Stopping weewx weather system:
weewx..
May  3 19:46:43 raspberrypi systemd[1]: weewx.service: Succeeded.
May  3 19:46:43 raspberrypi systemd[1]: Stopped LSB: weewx weather system.
May  3 19:49:43 raspberrypi OWFS[9746]: DEFAULT: owlib.c:(208) Cannot
open USB bus master
May  3 19:49:43 raspberrypi OWFS[9746]: DEFAULT: owlib.c:(52) No valid
1-wire buses found
May  3 19:52:02 raspberrypi OWFS[9756]: DEFAULT: owlib.c:(208) Cannot
open USB bus master
May  3 19:52:02 raspberrypi OWFS[9756]: DEFAULT: owlib.c:(52) No valid
1-wire buses found
May  3 19:54:31 raspberrypi OWFS[9804]: DEFAULT: owlib.c:(208) Cannot
open USB bus master
May  3 19:54:31 raspberrypi OWFS[9804]: DEFAULT: owlib.c:(52) No valid
1-wire buses found
May  3 20:16:07 raspberrypi systemd[1]: Started Session c10 of user pi.

What I do not understand is why  it complains "Cannot open USB bus
master" and "No valid 1-wire buses found" when weewx works perfectly
well using the Maxim USB bus master, DS9490. Then again, there are many
things that I do not understand. :)

Thanks for any suggestions and let me know if you need any further
information.

Glenn McKechnie

unread,
May 3, 2020, 9:28:07 PM5/3/20
to weewx...@googlegroups.com
On 04/05/2020, Michael Form <maf....@gmail.com> wrote:
> Glenn:
>
> You have come to the rescue once again.

Ah, Okay. I'll find and review our previous discusion

> However, I have what you suggested in the type and map entries which
> does not work.
>
> When I try, sudo PYTHONPATH=/usr/share/weewx python
> /usr/share/weewx/user/owfs.py --reading=/uncached/1D.30C60D000000
>
> I get the old exNoController message:
>
> File "/usr/lib/python2.7/dist-packages/ow/__init__.py", line 223, in
> init
> raise exNoController
> ow.exNoController

That means that communication with any 1-wire devices is impossible.
The interface to query them doesn't exist.

> I stopped trying to figure out the reason that I was getting this error
> since weewx was working fine. It would be good to figure out the reason
> for the error as it would be useful to read the sensors directly.

If weewx is working fine, what's the other driver?
What interface does it use?

If you have another driver running then my understanding is owfs.py
should be running as a service.
But you should still get a response from that command line query.

> My setup is weewx version 3.9.2 running with Python 2.7 on a Raspberry
> Pi 4. I am using OWFS.

Going by your last post, you have a temperature gauge (outTemp) and
you now have the rain gauge.
You were also setting up owserver and using that. You had difficulties
in starting owserver but appeared to get it working.

Is it still running?

I'm assuming that the usb dongle / bus master DS9490 is still set up
in /etc/owfs.conf.

Attach a copy of /etc/owfs.conf to your next reply.

Also attach your password free weewx.conf file, or at the very least
your full OWFS section. That's everything after [OWFS] until the main
next section heading.
Depending on the answers to the above questions, you need to supply an
appropriate --iface string to that command.
I'm punting that will be ' --iface=localhost:4304 ' ie:-
PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/owfs.py
--iface=localhost:4304 --reading=/uncached/1D.30C60D000000

You may even need to give that a couple of tries, depending on your
configuration. Wait a couple of seconds between each attempt.

> Then again, there are many things that I do not understand. :)

I'll look for you in the queue ;-)

> Thanks for any suggestions and let me know if you need any further
> information.

Regardless of whether you get this working or not, post those
requested configs / extracts back to the list.
They may help the next user with a similar problem. (It's always good
to have a solution with a problem!)

Michael Form

unread,
May 3, 2020, 10:53:19 PM5/3/20
to weewx...@googlegroups.com
Well, it communicates with all 1-Wire devices but I do not know the answer to your question about the "other driver" or "what interface it is using". Perhaps the info below will answer those questions but it seems to me that things are OK.

Adding
--iface=localhost:4304 --reading=/uncached/1D.30C60D000000
to the PYTHONPATH does return the DS2423 info. Where would I find this in the documentation?
Is there some way of reading the values in counter.B?

What needs to be changed in weewx.conf and/or owfs.conf to make things happy?

Thanks again.


Here is the section of weewx.conf that concerns itself with 1-Wire stuff and owfs.conf are below:

# 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 = OWFS

    # 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


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

####[Simulator]
    # This section is for the weewx weather station simulator

    # The time (in seconds) between LOOP packets.
####    loop_interval = 2.5

    # The simulator mode can be either 'simulator' or 'generator'.
    # Real-time simulator. Sleep between each LOOP packet.
####    mode = simulator
    # Generator.  Emit LOOP packets as fast as possible (useful for testing).
    #mode = generator

    # The start time. Format is YYYY-mm-ddTHH:MM. If not specified, the default
    # is to use the present time.
    #start = 2011-01-01T00:00

    # The driver to use:
####    driver = weewx.drivers.simulator

# Options for extension 'owfs'
[OWFS]
    interface = localhost:4304
    driver = user.owfs
    [[sensor_type]]
        windSpeed = inspeed_windspeed
        windDir = inspeed_windvane
        rain = rainwise_bucket
    [[sensor_map]]
        outTemp = /uncached/28.D5A7C6000000/temperature
       # in outside cone
       outHumidity = /uncached/26.ADD891000000/humidity
     # in outside cone
      rain = /uncached/1D.30C60D000000
        windDir = /uncached/26.5C6EE7000000
        windSpeed = /uncached/1D.BCBF0D000000

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

Here is OWFS.conf:

# Sample configuration file for the OWFS suite for Debian GNU/Linux.
#
#
# This is the main OWFS configuration file. You should read the
# owfs.conf(5) manual page in order to understand the options listed
# here.

######################## SOURCES ########################
#
# With this setup, any client (but owserver) uses owserver on the
# local machine...
###! server: server = localhost:4304
#
# ...and owserver uses the real hardware, by default fake devices
# This part must be changed on real installation
## server: FAKE = DS18S20,DS2405
#
#### USB device: DS9490
server: usb = all
#
# Serial port: DS9097
#server: device = /dev/ttyS1
#
# owserver tcp address
#server: server = 192.168.10.1:3131
#
# random simulated device
#server: FAKE = DS18S20,DS2405
#
######################### OWFS ##########################
#
#mountpoint = /mnt/1wire
#allow_other
#
####################### OWHTTPD #########################

###http: port = 2121

####################### OWFTPD ##########################

###ftp: port = 2120

####################### OWSERVER ########################

###server: port = localhost:4304

server: port = 4304

Glenn McKechnie

unread,
May 3, 2020, 11:46:48 PM5/3/20
to weewx-user
Michael Form wrote:
> Well, it communicates with all 1-Wire devices but I do not know the answer
> to your question about the "other driver" or "what interface it is using".
> Perhaps the info below will answer those questions but it seems to me that
> things are OK.

The owfs.py can run as a driver (full 1-wire network)

It can also run as a service.
This is where you have another station type that will be the main driver
entry, you augment the values returned from that weather station with a
couple of 1-wire sensors that are being read by owfs.py that runs as a
service.

You are running a full 1-wire setup. Your config is correct.

owfs.py can iface (interface) with a serial port, usb port, i2c-1 device
Yours is a the usb port BUT, it's accessed through owserver so
weewx.conf needs the localhost:4304 entry to tell it that.


> Adding
>
> --iface=localhost:4304 --reading=/uncached/1D.30C60D000000
>
> to the PYTHONPATH does return the DS2423 info. Where would I find this in
> the documentation?

It's in the source of owfs.py
Probably needs adding to the / a wiki entry.

> Is there some way of reading the values in counter.B?

Along the way the counters.B got dropped. Ooops!
To get the reading for that location add it to the path as per the following.

PYTHONPATH=/home/weewx/bin python /home/weewx/bin/user/owfs.py --reading=/uncached/1D.81B500000000/Counter.B


>
> _What needs to be changed in weewx.conf and/or owfs.conf to make things
> happy?__

That appears to be nothing (see below). Providing the owserver is
running.

/etc/init.d/owserver status

if systemd isn't in charge, that should return "owserver is running."

If systemd is in charge it will give you more info, of which "active
(running)" should be in there.

If there are no errors in the log, or your other sensors are working
fine. Then it is running.


_
> Thanks again.
>
>
> Here is the section of *weewx.conf* that concerns itself with 1-Wire stuff
> and owfs.conf are below:
>
> # 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 = OWFS

No other drivers so this is correct.

[...]
> # Options for extension 'owfs'
> [OWFS]
>     interface = localhost:4304

This means we access the usb device via the owserver (which listens on
localhost:4304)

>     driver = user.owfs
>     [[sensor_type]]
>         windSpeed = inspeed_windspeed
>         windDir = inspeed_windvane
>         rain = rainwise_bucket
>     [[sensor_map]]
>         outTemp = /uncached/28.D5A7C6000000/temperature
>        # in outside cone
>        outHumidity = /uncached/26.ADD891000000/humidity
>      # in outside cone
>       rain = /uncached/1D.30C60D000000
>         windDir = /uncached/26.5C6EE7000000
>         windSpeed = /uncached/1D.BCBF0D000000
>
> ###################
[...]

> server: usb = all

Correct, and confirms that access to the DS9490R will be made via the
owserver

[...]
> ####################### OWSERVER ########################
>
> ###server: port = localhost:4304
>
> server: port = 4304

also correct

weewx will contact the owserver which will access the usb adaptor.
All communication will be via the owserver.

Glenn McKechnie

unread,
May 3, 2020, 11:51:35 PM5/3/20
to weewx-user
Argh!
Bugger.

PYTHONPATH=/home/weewx/bin python /home/weewx/bin/user/owfs.py
--iface=localhost:4304 --reading=/uncached/1D.81B500000000/Counter.B

owfs.py defaults to the usb adaptor. You need to specify the iface if
using something else

michael form

unread,
May 4, 2020, 12:17:16 AM5/4/20
to weewx-user
Thanks. owserver is indeed running.

Evidently, the "Counter.B" needs to have a lower case c, "counter.B" for it to work. At least for me.

It indeed returns a value and tomorrow I will pour more water into the tipping bucket and see if the counter increments. If it does, then I will have to see if the "rain" is posted correctly in weewx. 
I am pessimistic about success since with everything as it currently is, "rain" never changed with the addition of water. Of course, the problem may lie in the operation of the tipping bucket itself, but tomorrow 
will tell the tale on what is going on.

Glenn McKechnie

unread,
May 4, 2020, 12:38:42 AM5/4/20
to weewx...@googlegroups.com
FaT Fingers striKes again.

I've made a few changes to the owfs entry. Have a look at it and see
if it fills enough of the gaps.

https://github.com/weewx/weewx/wiki/owfs

I have a markdown error in it. Need to escape [ so that it (all of
them) display correctly (rather than as a link)



On 04/05/2020, michael form <mike...@gmail.com> wrote:
> Thanks. owserver is indeed running.
>
> Evidently, the "Counter.B" needs to have a lower case c, "counter.B" for it
>
> to work. At least for me.
>
> It indeed returns a value and tomorrow I will pour more water into the
> tipping bucket and see if the counter increments. If it does, then I will
> have to see if the "rain" is posted correctly in weewx.
> I am pessimistic about success since with everything as it currently is,
> "rain" never changed with the addition of water. Of course, the problem may
>
> lie in the operation of the tipping bucket itself, but tomorrow
> will tell the tale on what is going on.
>
> On Sunday, May 3, 2020 at 11:51:35 PM UTC-4, Glenn McKechnie wrote:
>>
>> Argh!
>> Bugger.
>>
>> PYTHONPATH=/home/weewx/bin python /home/weewx/bin/user/owfs.py
>> --iface=localhost:4304 --reading=/uncached/1D.81B500000000/Counter.B
>>
>> owfs.py defaults to the usb adaptor. You need to specify the iface if
>> using something else
>>
>> On 04/05/2020, Glenn McKechnie <glenn.m...@gmail.com <javascript:>>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/1be9ca5f-c591-4ca3-8b5a-002564a35eaa%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages