weewx-owfs failure with new Raspbian Stretch

220 views
Skip to first unread message

Howard Walter

unread,
Dec 11, 2017, 10:19:15 AM12/11/17
to weewx-user
I recently decided to upgrade my RPi running weewx 3.5 on the Debian 8 Wheezy based Raspbian to weewx 3.8 running on the new Debian 9 Stretch Raspbian.

When the 1-wire adapter is plugged into the usb socket, syslog shows
Dec  7 17:33:27 wx kernel: [436943.136563] usb 1-1.5: new full-speed USB device number 107 using dwc_otg
Dec  7 17:33:27 wx kernel: [436943.270174] usb 1-1.5: New USB device found, idVendor=04fa, idProduct=2490
Dec  7 17:33:27 wx kernel: [436943.270189] usb 1-1.5: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Dec  7 17:33:27 wx mtp-probe: checking bus 1, device 107: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5"
Dec  7 17:33:27 wx mtp-probe: bus: 1, device: 107 was not an MTP device

Using weewx-owfs-0.21, weewx loads the owfs config and promptly exits. Syslog shows
Dec  7 17:35:26 wx OWFS[23185]: DEFAULT: owlib.c:(208) Cannot open USB bus master
Dec  7 17:35:26 wx OWFS[23185]: DEFAULT: owlib.c:(52) No valid 1-wire buses found
Dec  7 17:35:26 wx OWFS[23185]: import of driver failed:  (<class 'ow.exNoController'>)
Dec  7 17:35:26 wx OWFS[23185]: engine: Unable to load driver:
Dec  7 17:35:26 wx OWFS[23185]:     ****  Exiting...

I'm using the same entry in /etc/udev/rules.d/98-owfs.rules that worked before:
ATTRS{idVendor}=="04fa", ATTRS{idProduct}=="2490", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="pi"

 /dev/bus/usb/001/ shows a usb port which is pi group readable and writable:
 # ls -l
total 0
crw-rw-rw- 1 root pi   189, 106 Dec  7 17:33 107

In an attempt to test permissions, running the following simple program as root:
    #!/usr/bin/python
    import ow
    ow.init('u')

Dec  11 07:05:46 wx OWFS[30742]: DEFAULT: owlib.c:(208) Cannot open USB bus master
Dec  11 07:05:46 wx OWFS[30742]: DEFAULT: owlib.c:(52) No valid 1-wire buses found

Thanks for your help.

Miguel Andres

unread,
Dec 11, 2017, 12:30:25 PM12/11/17
to weewx...@googlegroups.com
Dear Howard,

Thank your your post. May I rise your attention to my post dated Dec 4 titled
[weewx-user] --reading failure in weewx_3.8.0-1 and weewx-owfs-0.21 Raspberry Pi & DS18B20

It may not provide a solution but it certainly shows that there is an issue here as I ran my tests with the same settings as you:

Raspberry Pi 1 Model B running Raspbian Minimal (Stretch)
2017-09-07-raspbian-stretch-lite.img
sudo dpkg -i weewx_3.8.0-1_all.deb
wget http://lancet.mit.edu/mwall/projects/weather/releases/weewx-owfs-0.21.tgz

That is:
weewx 3.8.1
weewx-owfs 0.21

Let's see & hope this question gains some more attention now.

Regards,



--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Glenn McKechnie

unread,
Dec 11, 2017, 5:39:15 PM12/11/17
to weewx...@googlegroups.com
No expert here but this may be something to do with the mtp-probe.

If I plug my usb dongle into a systemd Pi I get...

Dec 12 09:12:21 weewx-public kernel: [2549795.987157] usb 1-1.4: new
full-speed USB device number 4 using dwc_otg
Dec 12 09:12:21 weewx-public kernel: [2549796.120625] usb 1-1.4: New
USB device found, idVendor=04fa, idProduct=2490
Dec 12 09:12:21 weewx-public kernel: [2549796.120638] usb 1-1.4: New
USB device strings: Mfr=0, Product=0, SerialNumber=0
Dec 12 09:12:22 weewx-public kernel: [2549797.184470] Driver for
1-wire Dallas network protocol.
Dec 12 09:12:22 weewx-public kernel: [2549797.194526] usbcore:
registered new interface driver DS9490R

I'm assuming you don't get those last 2, encouraging, lines? Instead
you show the mpt-probe lines and plugging 'mtp-probe' into google
returns a few hits that suggests it may be getting in the way. Do you
need libmtp?

"""
libmtp is a library for communicating with MTP aware devices in POSIX
compliant operating systems. It implements MTP Basic, the subset
proposed for standardization.

The Media Transfer Protocol (commonly referred to as MTP) is a devised
set of custom extensions to support the transfer of music files on
USB digital audio players and movie files on USB portable media players.

This package provides the udev rules file and the FreeDesktop.org Device
Information Files file (used by HAL).
"""

The quickest test would be to disable /remove it.

Continuing with my quick test here, (Debian 8 Jessie - no libmtp installed) ...

I'm not running the owfs.py driver on this machine so I have no udev rule.
I've just done a brand new install of owfs.py.

If I then query the 1-wire I get a result.

09:27:57 : read only:root@weewx-public:/usr/share/weewx/user #
PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/owfs.py
--readings
B2352D000000
_usePath: /81.B2352D000000
_type: DS1420
_path: /81.B2352D000000
_useCache: True
/81.B2352D000000/family: 81
/81.B2352D000000/locator: FFFFFFFFFFFFFFFF
/81.B2352D000000/type: DS1420
/81.B2352D000000/crc8: 78
/81.B2352D000000/r_id: 0000002D35B2
/81.B2352D000000/address: 81B2352D00000078
/81.B2352D000000/r_address: 780000002D35B281
/81.B2352D000000/r_locator: FFFFFFFFFFFFFFFF
/81.B2352D000000/id: B2352D000000





Cheers
Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie
> --
> 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.

vince

unread,
Dec 11, 2017, 6:41:41 PM12/11/17
to weewx-user
On Monday, December 11, 2017 at 7:19:15 AM UTC-8, Howard Walter wrote:
I recently decided to upgrade my RPi running weewx 3.5 on the Debian 8 Wheezy based Raspbian to weewx 3.8 running on the new Debian 9 Stretch Raspbian.



Changing two things at once can be challenging.  Is it possible you missed installing a dpkg in your debian 9 os possibly ?
 

Howard Walter

unread,
Dec 11, 2017, 7:05:19 PM12/11/17
to weewx-user


Miguel,
    Hopefully a solution to my issue will also solve your problem.

Glenn and Vince,
    Thanks for your suggestions. Several libmtp files were installed (by default I assume); first removed libmtp-runtime and then libmtp-common. Rebooted. As Glenn suspected, the mtp-probe messages disappear but unfortunately no 1-wire messages appear and the simple test program above still fails.

Vince's note made me think of owfs which I have never needed to install in order to run a 1-wire weewx system on Debian Wheezy. However, I tried installing it and got the same syslog messages with the test program not working.



Glenn McKechnie

unread,
Dec 11, 2017, 9:47:40 PM12/11/17
to weewx...@googlegroups.com
On 12 December 2017 at 11:05, Howard Walter <hwal...@gmail.com> wrote:
>
>
> Miguel,
> Hopefully a solution to my issue will also solve your problem.
>
> Glenn and Vince,
> Thanks for your suggestions. Several libmtp files were installed (by
> default I assume); first removed libmtp-runtime and then libmtp-common.
> Rebooted. As Glenn suspected, the mtp-probe messages disappear but
> unfortunately no 1-wire messages appear and the simple test program above
> still fails.

Leaving aside the test program.
If you unplug the usb dongle and replug it in, do you get the full
output stating that it's succesfully registered with the kernel,
either dmesg or syslog.
A check here shows that I only get the full message when I first plug it in,
[...] Driver for 1-wire Dallas network protocol.
[...] usbcore: registered new interface driver DS9490R
subsequent inserts skip those messages. It would be nice to know if
yours returned it at least once.

What does the command usb-devices have to say about it?

Also, I know little of udev rules but try removing that from the mix.
There's a possibility that it's changed between OS versions and as I
indicated with my successful run, I have no such entry and it worked
using mwalls owfs.py to query it.

> Vince's note made me think of owfs which I have never needed to install in
> order to run a 1-wire weewx system on Debian Wheezy. However, I tried
> installing it and got the same syslog messages with the test program not
> working.

Ah, you're running the full fledged OWFS software, not the owfs.py of
mwall fame?
That possibly changes things.

If you've now installed mwalls owfs, with wee_extension, and have the
python-ow package installed , then shutdown the OWFS server/s (they
can't co-exist with weewx, only one process / bus query at a time),
disconnect then reconnect the dongle and enter...

PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/owfs.py --readings

That will hopefully return a result.

Howard Walter

unread,
Dec 12, 2017, 11:35:30 AM12/12/17
to weewx-user
Glenn,

Are you running on a Wheezy based Raspbian or a Stretch based Raspian? If it is Stretch, which Raspbian distribution did you use?

To summarize:
I have a fully functioning 1-wire weewx using Matt's owfs running on Wheezy Raspbian. The problem occurs when installing weewx-owfs on the new Stretch based Raspbian.

I started with Matt's owfs.py and get the error messages shown in my first post.The additional 1-wire messages in syslog are shown on Wheezy but not on Stretch.

The test program is a (very!) short version of owfs.py and, by running it as root, I was hoping to bypass any udev issues just as you did when you ran Matt's program as root.

I installed owfs in the unlikely event that Stretch required something else in the owfs package. It is not installed when I run weewx.

usb-devices shows
T:  Bus=01 Lev=02 Prnt=02 Port=03 Cnt=03 Dev#= 10 Spd=12  MxCh= 0
D:  Ver= 1.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS= 8 #Cfgs=  1
P:  Vendor=04fa ProdID=2490 Rev=00.02
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)

So it looks like it can't find the 1-wire driver.
My current theory is that owlib.c which is imported (I think) by python-ow is broken on Stretch.

mwall

unread,
Dec 12, 2017, 12:21:47 PM12/12/17
to weewx-user
howard,

you're on the right track.  enumerate the owfs and operating system versions that each of you is using.  i assume you are all using the latest weewx-owfs (v0.21 as of 12dec2017).

the weewx-owfs extension (driver and service) depends on the owfs libraries.

if you are lucky, you can install owfs using apt or yum.

i had to compile owfs on some arm systems, since the owfs that shipped with them was too old or was broken.

you can easily build owfs without messing up your system.  download the owfs source, then build it like this:

./configure --prefix=/opt/owfs-x.y ...
make
make install

for a complete list of the options to configure that matter, see the end of the owfs wiki page 


most of the stuff in owfs is not needed by the weewx-owfs driver/service, so i always disable it.

to use your compiled version of owfs instead of whatever the system provides, put it in the path.  for example:

LD_LIBRARY_PATH=/opt/owfs-x.y PYTHONPATH=/home/weewx/bin python /home/weewx/bin/user/owfs.py --sensors

when you get that to work, put the LD_LIBRARY_PATH into the weewx rc script or whatever you use to run weewx as a daemon.

m

mixpc75

unread,
Dec 12, 2017, 12:33:08 PM12/12/17
to weewx...@googlegroups.com
Howard, I cannot prove your theory but can add my tests and inn my case usb-devices shows

2.0 root hub
SMC9512/9514 USB Hub
SMSC9512/9514 Fast Ethernet Adapter
which is just the Raspberry Pi. So no trace of DS18B20.

pi@raspberrypi:~ $ tail /var/log/syslog
Dec 12 18:12:13 raspberrypi weewx[573]: Stopping weewx weather system: weewx not running....
Dec 12 18:12:13 raspberrypi systemd[1]: Stopped LSB: weewx weather system.
Dec 12 18:12:40 raspberrypi OWFS[594]: DEFAULT: owlib.c:(208) Cannot open USB bus master
Dec 12 18:12:40 raspberrypi OWFS[594]: DEFAULT: owlib.c:(52) No valid 1-wire buses found
Dec 12 18:13:18 raspberrypi OWFS[603]: DEFAULT: owlib.c:(52) No valid 1-wire buses found
Dec 12 18:14:51 raspberrypi OWFS[630]: DEFAULT: owlib.c:(52) No valid 1-wire buses found
Dec 12 18:15:14 raspberrypi OWFS[639]: DEFAULT: owlib.c:(208) Cannot open USB bus master
Dec 12 18:15:14 raspberrypi OWFS[639]: DEFAULT: owlib.c:(52) No valid 1-wire buses found


Matthew, in my case:
weewx-owfs-0.21.tgz

OS version
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

If you could provide with the owfs source (I am more of Debian newbie) I could try to compile, run tests and share output.

Regards,


--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.

mwall

unread,
Dec 12, 2017, 12:50:52 PM12/12/17
to weewx-user
miguel,

to install owfs on debian systems do:

sudo apt-get install python-ow

to see what is installed, do:

dpkg --list | grep ow

these systems are working properly for me:

Debian GNU/Linux 7

Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.89-2 x86_64 GNU/Linux

owfs                                 2.8p15-1

owfs-common                          2.8p15-1

python-ow                            2.8p15-1


Debian GNU/Linux 6.0

Linux 2.6.34.9 #1 PREEMPT Thu Jun 23 10:15:49 PHT 2011 armv5tel GNU/Linux

owfs-2.9p5 (compiled from source)


i compiled owfs-2.9p5 using these options:

./configure --prefix=/opt/owfs-2.9p5 --disable-owhttpd --disable-owftpd --di

sable-owserver --disable-owperl --disable-owphp --disable-owtcl --disable-i2c --

disable-w1 --disable-parport --disable-owcapi --disable-owmon --disable-owtap --

disable-owshell --disable-owexternal --disable-debug --disable-ownet --disable-o

wnetlib --enable-owpython --enable-usb



mwall

unread,
Dec 12, 2017, 12:52:16 PM12/12/17
to weewx-user
btw, you can download the code for owfs software (not the weewx-owfs driver/service) from sourceforge:



mixpc75

unread,
Dec 12, 2017, 2:07:33 PM12/12/17
to weewx...@googlegroups.com
Matthew,

Thank you for the link. File owfs-3.2p1.tar.gz downloaded from sourceforge

Please, kindly have a look at attached .txt file for the compilation output. It took a bit.

After compilation:

pi@raspberrypi:~/owfs-3.2p1 $ sudo LD_LIBRARY_PATH=/opt/owfs-2.9p5/ PYTHONPATH=/home/weewx/bin python /home/weewx/bin/user/owfs.py --sensors
python: can't open file '/home/weewx/bin/user/owfs.py': [Errno 2] No such file or directory


pi@raspberrypi:~/owfs-3.2p1 $ sudo LD_LIBRARY_PATH=/opt/owfs-2.9p5/ PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/owfs.py --sensors
Traceback (most recent call last):
  File "/usr/share/weewx/user/owfs.py", line 618, in <module>
    main()
  File "/usr/share/weewx/user/owfs.py", line 578, in main
    ow.init(iface)
  File "/usr/lib/python2.7/dist-packages/ow/__init__.py", line 224, in init
    raise exNoController
ow.exNoController

pi@raspberrypi:~/owfs-3.2p1 $ sudo LD_LIBRARY_PATH=/opt/owfs-2.9p5/lib PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/owfs.py --sensors
Traceback (most recent call last):
  File "/usr/share/weewx/user/owfs.py", line 618, in <module>
    main()
  File "/usr/share/weewx/user/owfs.py", line 578, in main
    ow.init(iface)
  File "/usr/lib/python2.7/dist-packages/ow/__init__.py", line 224, in init
    raise exNoController
ow.exNoController

Any indication or tip is welcome, of course.

Regards,



On 12 December 2017 at 18:52, mwall <mw...@users.sourceforge.net> wrote:
btw, you can download the code for owfs software (not the weewx-owfs driver/service) from sourceforge:



compileoutput.txt

Glenn McKechnie

unread,
Dec 13, 2017, 5:47:29 PM12/13/17
to weewx...@googlegroups.com

Howard, Miguel

Okay. The details of the pi I ran the working test on are...

PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"

Linux weewx-public 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
owfs-common                      2.9p8-6       all
python-ow                            2.9p8-6       armhf
weewx                                  3.7.1-1        all
owfs  0.21

I've since done a fresh install of Raspian lite on another pi

Raspbian Stretch Lite

Minimal image based on Debian Stretch
Version: November 2017
Release date: 2017-11-29
Linux raspberrypi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux


PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"

with the packages defaulting to

libow-3.1-5_3.1p5-1_armhf.deb
owfs-common_3.1p5-1_all.deb
python-ow_3.1p5-1_armhf.deb

weewx                           3.8.0-1
owfs 0.21

If I then run...
root@raspberrypi:~/owpkg9# PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/owfs.py --sensors

Traceback (most recent call last):
  File "/usr/share/weewx/user/owfs.py", line 618, in <module>
    main()
  File "/usr/share/weewx/user/owfs.py", line 578, in main
    ow.init(iface)
  File "/usr/lib/python2.7/dist-packages/ow/__init__.py", line 224, in init
    raise exNoController
ow.exNoController

with syslog stating that...
Dec 13 22:04:35 raspberrypi OWFS[2440]: DEFAULT: owlib.c:(208) Cannot open USB bus master
Dec 13 22:04:35 raspberrypi OWFS[2440]: DEFAULT: owlib.c:(52) No valid 1-wire buses found

So I'm getting the same result as you.

If then do the following...
 apt-get remove libow-3.1-5 python-ow owfs-common

and copy the equivalent packages (in /var/cache/apt/archives/) from the Debian 8 install on the that working machine ...

libow-2.9-8_2.9p8-6_armhf.deb
owfs-common_2.9p8-6_all.deb
python-ow_2.9p8-6_armhf.deb

Cross the fingers and hope that the nothing breaks with such an ugly manoeuvre.

dpkg --install owfs-common_2.9p8-6_all.deb
dpkg --install libow-2.9-8_2.9p8-6_armhf.deb
dpkg --install python-ow_2.9p8-6_armhf.deb

and run the same command as before, I get a result!
root@raspberrypi:~/owpkg8# PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/owfs.py --sensors
B2352D000000: /81.B2352D000000 DS1420

If I connect my 1-wire network into the dongle, I get...
root@raspberrypi:~#  PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/owfs.py --iface u --sensors
B2352D000000: /81.B2352D000000 DS1420
E953E7000000: /1F.4C6905000000/main/26.E953E7000000 DS2438
0B930C000000: /1F.4C6905000000/main/1D.0B930C000000 DS2423
67110D000000: /1F.4C6905000000/main/1D.67110D000000 DS2423
DE9813020800: /1F.4C6905000000/aux/10.DE9813020800 DS18S20
B0F7F1000000: /1F.4C6905000000/aux/26.B0F7F1000000 DS2438
816E0F000000: /1F.CC6705000000/main/1D.816E0F000000 DS2423
7FCF0F000000: /1F.CC6705000000/main/1D.7FCF0F000000 DS2423
7EA2ED010800: /1F.455805000000/main/10.7EA2ED010800 DS18S20
EC46E7000000: /1F.455805000000/main/26.EC46E7000000 DS2438
AB79BC000000: /1F.455805000000/aux/26.AB79BC000000 DS2438


So, besides the ugly kludge, which was really just to try and zero in on the issue. It does appear to be a problem with those latest versions, and surprisingly, the older ones will drop in and work.

I'm not suggesting that replacing them with the 2.9p8-6 versions is a fix, but if you want to test it for yourself the files are here...

http://203.213.243.61/weewx/owpkg/owpkg.tar.gz




Miguel,

I think I now know why you were getting a result via localhost:4304.  The owfs.conf has an entry

# ...and owserver uses the real hardware, by default fake devices
# This part must be changed on real installation
server: FAKE = DS18S20,DS2405

and you were picking that up.

Also your manual build of owfs earlier in this thread is broken.
If you check the .config output you'll see that owpython is DISABLED, it has an umet dependency of the swig package.

Howard Walter

unread,
Dec 14, 2017, 3:41:23 PM12/14/17
to weewx-user
Nice detective work Glenn!

I'll have a chance in the next few days to try the older versions.



mixpc75

unread,
Dec 15, 2017, 3:56:13 AM12/15/17
to weewx...@googlegroups.com
Glen,

That is fantastic! :) Clasp, clasp, clasp! :) I thank you for your two messages, this one and the one in the other thread. I preferred getting back to topic after trying from my side and let you know. I have not been as successful as you on mi RP1 and since I think I have folowed the steps correctly (again, writing a new image to SD, enabling 1-Wire, running a python script test it etc.). And I am beginning to wonder whether it might not work on a RPi1 but work successfully on a RPi3... I think I will mirror your steps in a RPi3 later on today and will get back with output.

I have made myself sure I have installed your .deb packages

My package versions matched yours

pi@raspberrypi:~ $ dpkg --list | grep ow
ii  libow-3.1-5:armhf               3.1p5-1                      armhf        1-Wire File System full library
ii  owfs-common                     3.1p5-1                      all          common files used by any of the OWFS programs
ii  python-ow                       3.1p5-1                      armhf        Dallas 1-wire support: Python bindings

And we are on the same version weewx-owfs-0.21.tgz as well and, of course, same weewx version.

sudo apt-get remove libow-3.1-5 owfs-common python-ow
sudo reboot
sudo dpkg --install owfs-common_2.9p8-6_all.deb (this deb first)
sudo dpkg --install libow-2.9-8_2.9p8-6_armhf.deb
sudo dpkg --install python-ow_2.9p8-6_armhf.deb

Here is a linked to a bash'ed log with every command issued. The -sensors commands are towards the botton, of course.
https://pastebin.com/Nkk5Th6V


Please, mind I'm running my tests on a RPi1 armv61.

Thank you once more and regards,




On 14 December 2017 at 21:41, Howard Walter <hwal...@gmail.com> wrote:
Nice detective work Glenn!

I'll have a chance in the next few days to try the older versions.



Glenn McKechnie

unread,
Dec 15, 2017, 5:45:15 AM12/15/17
to weewx...@googlegroups.com
The first couple of lines at pastebin are revealing...
 
pi@raspberrypi:~ $ python temp_ds18b20.py
(21.812, 71.2616)
(21.812, 71.2616)
^CTraceback (most recent call last):
  File "temp_ds18b20.py", line 30, in <module>
    time.sleep(1)
KeyboardInterrupt

That indicates that you aren't using an owfs compatabile interface (bus master)

http://owfs.org/index.php?page=bus-masters

which means that, to my knowledge, running mwalls owfs driver, or any OWFS software won't help you.

I could certainly be wrong but I don't think the GPIO and 1-wire kernel module (enabled via raspi-config) talk to OWFS.

That shouldn't mean that you can't use it with weewx but you need to approach it differently.

You've got a value being returned via your script (is it this https://github.com/simonmonk/raspberrypi_cookbook_ed2/blob/master/temp_DS18B20.py ?) so you're half way there.  You need to find or write a script that will enable you to present that data ( temperature value) and have it read by weewx. 
The fileparse driver could be a good starting point for the slurp end?  https://github.com/weewx/weewx/tree/master/examples/fileparse with your script writing the data?

Or

Perhaps Horacio's work may speed you along.





Cheers
 Glenn

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

mixpc75

unread,
Dec 15, 2017, 10:50:10 AM12/15/17
to weewx...@googlegroups.com
Glenn,

We're on the right track! I noticed Horacio's message and tried to implement it in an earlier attempt but maybe I messed it up or maybe - as I think of it now - it was just a matter of getting

owfs-common_2.9p8-6_all.deb
libow-2.9-8_2.9p8-6_armhf.deb
python-ow_2.9p8-6_armhf.deb

as you brilliantly noted. The fact is that I have tried that approach now (just hope Matthew won't be upset about not using fileparse.py) and

sudo nano /usr/share/weewx/user/ds18b20.py with Horacio's code
edited self.filename to show my ds18b20 id

sudo nano /etc/weewx/weewx.conf
added to [[services]] the line
data_services = user.ds18b20.ds18b20_Service
and commented
#data_services = ,
to avoid duplication

No ther changes done so [OWFS] section remains the same as well as [Station] showing station_type = Simulator

The fact is that starting weewx now produces no error!

pi@raspberrypi:~ $ sudo systemctl start weewx.service

pi@raspberrypi:~ $ sudo systemctl status weewx.service
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated; vendor preset: enabled)
   Active: active (running) since Fri 2017-12-15 12:23:34 CET; 6s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 821 ExecStop=/etc/init.d/weewx stop (code=exited, status=0/SUCCESS)
  Process: 852 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/weewx.service
           └─867 python /usr/bin/weewxd --daemon --pidfile=/var/run/weewx.pid /etc/weewx/weewx.conf

Dec 15 12:23:34 raspberrypi weewx[867]: manager: Starting backfill of daily summaries
Dec 15 12:23:35 raspberrypi weewx[867]: restx: StationRegistry: Registration not requested.
Dec 15 12:23:35 raspberrypi weewx[867]: restx: Wunderground: Posting not enabled.
Dec 15 12:23:35 raspberrypi weewx[867]: restx: PWSweather: Posting not enabled.
Dec 15 12:23:35 raspberrypi weewx[867]: restx: CWOP: Posting not enabled.
Dec 15 12:23:35 raspberrypi weewx[867]: restx: WOW: Posting not enabled.
Dec 15 12:23:35 raspberrypi weewx[867]: restx: AWEKAS: Posting not enabled.
Dec 15 12:23:35 raspberrypi weewx[867]: engine: Starting up weewx version 3.8.0
Dec 15 12:23:35 raspberrypi weewx[867]: engine: Clock error is -0.73 seconds (positive is fast)
Dec 15 12:23:35 raspberrypi weewx[867]: engine: Starting main packet loop.

And a few minutes later...

pi@raspberrypi:~ $ sudo systemctl status weewx.service
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated; vendor preset: enabled)
   Active: active (running) since Fri 2017-12-15 12:23:34 CET; 11min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 821 ExecStop=/etc/init.d/weewx stop (code=exited, status=0/SUCCESS)
  Process: 852 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/weewx.service
           └─867 python /usr/bin/weewxd --daemon --pidfile=/var/run/weewx.pid /etc/weewx/weewx.conf

Dec 15 12:25:18 raspberrypi weewx[867]: manager: Added record 2017-12-15 12:25:00 CET (1513337100) to database 'weewx.sdb'
Dec 15 12:25:18 raspberrypi weewx[867]: manager: Added record 2017-12-15 12:25:00 CET (1513337100) to daily summary in 'weewx.sdb'
Dec 15 12:25:47 raspberrypi weewx[867]: cheetahgenerator: Generated 14 files for report StandardReport in 27.19 seconds
Dec 15 12:26:11 raspberrypi weewx[867]: imagegenerator: Generated 36 images for StandardReport in 21.48 seconds
Dec 15 12:26:11 raspberrypi weewx[867]: copygenerator: copied 9 files to /var/www/html/weewx
Dec 15 12:30:17 raspberrypi weewx[867]: manager: Added record 2017-12-15 12:30:00 CET (1513337400) to database 'weewx.sdb'
Dec 15 12:30:17 raspberrypi weewx[867]: manager: Added record 2017-12-15 12:30:00 CET (1513337400) to daily summary in 'weewx.sdb'
Dec 15 12:30:27 raspberrypi weewx[867]: cheetahgenerator: Generated 14 files for report StandardReport in 8.06 seconds
Dec 15 12:30:31 raspberrypi weewx[867]: imagegenerator: Generated 12 images for StandardReport in 3.48 seconds
Dec 15 12:30:31 raspberrypi weewx[867]: copygenerator: copied 0 files to /var/www/html/weewx


and...

pi@raspberrypi:~ $ sudo systemctl status weewx.service
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated; vendor preset: enabled)
   Active: active (running) since Fri 2017-12-15 12:23:34 CET; 13min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 821 ExecStop=/etc/init.d/weewx stop (code=exited, status=0/SUCCESS)
  Process: 852 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/weewx.service
           └─867 python /usr/bin/weewxd --daemon --pidfile=/var/run/weewx.pid /etc/weewx/weewx.conf

Dec 15 12:30:17 raspberrypi weewx[867]: manager: Added record 2017-12-15 12:30:00 CET (1513337400) to database 'weewx.sdb'
Dec 15 12:30:17 raspberrypi weewx[867]: manager: Added record 2017-12-15 12:30:00 CET (1513337400) to daily summary in 'weewx.sdb'
Dec 15 12:30:27 raspberrypi weewx[867]: cheetahgenerator: Generated 14 files for report StandardReport in 8.06 seconds
Dec 15 12:30:31 raspberrypi weewx[867]: imagegenerator: Generated 12 images for StandardReport in 3.48 seconds
Dec 15 12:30:31 raspberrypi weewx[867]: copygenerator: copied 0 files to /var/www/html/weewx
Dec 15 12:35:17 raspberrypi weewx[867]: manager: Added record 2017-12-15 12:35:00 CET (1513337700) to database 'weewx.sdb'
Dec 15 12:35:17 raspberrypi weewx[867]: manager: Added record 2017-12-15 12:35:00 CET (1513337700) to daily summary in 'weewx.sdb'
Dec 15 12:35:27 raspberrypi weewx[867]: cheetahgenerator: Generated 14 files for report StandardReport in 8.12 seconds
Dec 15 12:35:31 raspberrypi weewx[867]: imagegenerator: Generated 12 images for StandardReport in 3.55 seconds
Dec 15 12:35:31 raspberrypi weewx[867]: copygenerator: copied 0 files to /var/www/html/weewx

As the guideline
https://github.com/weewx/weewx/wiki/add-sensor
indicates: "The data will not be displayed on the weather station console, but they will be displayed in WeeWX reports." So needless to run:

PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/owfs.py --sensors
sudo PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/owfs.py --sensors

So temperature readings are taking place every 5 minutes, great! :) But they are not being displayed by the webserver 192.16.1.2 which shows the default weewx webpage:

This station uses a Simulator, controlled by 'weewx', an experimental weather software system written in Python [...]

But since it configured as a service, how should weewx.conf be edited so that it takes values from Horacio's script?

In the case of an OWFSS service the website
is precise about how to configure the weewx.conf section [OWFS]

But what about this particular case? Editing station_type = DS18B20 and then adding a [DS18B20] tag at the end of the file?

[OWFS]
        interface = u
        [[sensor_map]]
            outTemp = extraTemp1 # variable from /usr/share/weewx/user/ds18b20.py


I'm a bit lost at this stage but very glad to see how close we are to get it done :)

Regards,


Howard Walter

unread,
Dec 15, 2017, 3:34:34 PM12/15/17
to weewx-user
A bug report about this issue has been sent to the owfs-developers email list.

Glenn McKechnie

unread,
Dec 15, 2017, 4:15:03 PM12/15/17
to weewx...@googlegroups.com
Howard,

Good. I've subscribed and will follow the issue there.

Miguel,

I'll reply to your issue back on your original thread at
https://groups.google.com/forum/#!topic/weewx-user/yO-z8aqzcU0
as it's unrelated to Howards problem here.


Cheers
Glenn

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


On 16 December 2017 at 07:34, Howard Walter <hwal...@gmail.com> wrote:
> A bug report about this issue has been sent to the owfs-developers email
> list.
>
> --
> 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.

Howard Walter

unread,
Dec 20, 2017, 4:28:14 PM12/20/17
to weewx-user
The OWFS developers replied back with the news that python-ow is no longer supported. You can read the discussion at https://sourceforge.net/p/owfs/mailman/message/36159169/

However, Stefano Miccoli was kind enough to take the time to provide a detailed workaround. The following is his guidance (with a few edits and additional output) which is working perfectly on my Stretch RPi weewx system:

  - Start from a fresh system (no other owfs components installed) and install owserver and ow-shell:
  $ sudo apt install owserver ow-shell

  - Delete (as root) the hyper-verbose default debian /etc/owfs.conf file and use this minimal config:
  server: usb = all
  server: port = 4304

  - Enable and start the owserver
  $ sudo systemctl stop owserver
  $ sudo systemctl enable owserver
  $ sudo systemctl start owserver

  - Confirm that owserver is running:
  $ systemctl status owserver
  owserver.service - LSB: 1-wire TCP server
   Loaded: loaded (/etc/init.d/owserver; generated; vendor preset: enabled)
   Active: active (running) since Tue 2017-12-19 12:39:53 PST; 23h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 545 ExecStart=/etc/init.d/owserver start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/owserver.service
           └─573 /usr/bin/owserver -c /etc/owfs.conf --pid-file /var/run/owfs/owserver.pid

  Dec 19 12:39:51 wx systemd[1]: Starting LSB: 1-wire TCP server...
  Dec 19 12:39:52 wx OWFS[573]: DEFAULT: ow_daemon.c:(144) Entered background mode, quitting.
  Dec 19 12:39:52 wx OWFS[573]: DEFAULT: ow_usb_msg.c:(214) Opened USB DS9490 bus master at ...
  Dec 19 12:39:52 wx OWFS[573]: DEFAULT: ow_usb_cycle.c:(128) Set DS9490 1:5 unique id ...
  Dec 19 12:39:53 wx owserver[545]: Starting 1-Wire TCP Server: owserver.
  Dec 19 12:39:53 wx systemd[1]: Started LSB: 1-wire TCP server.

  - Test your setup
  $ owdir
  /81.380F31000000
  /1F.A84D02000000
  /1F.235602000000
  /1F.D74E02000000
  /bus.0
  /uncached
  /settings
  /system
  /statistics
  /structure

 - Install and test owpython. (Run the python client as an unprivileged user, no need to run as root or install a permissions file in /etc/udev/rules.d/.)
  $ sudo apt install python-ow
  $ python
  >>> import ow
  >>> ow.init('localhost:4304')
  >>> ow.owfs_get('/')
  You should not see any error messages.

Finally change weewx.conf
from
  [OWFS]
        interface = u
to
  [OWFS]
        interface = localhost:4304

Run weewx. As mentioned above, this worked for me.

Reply all
Reply to author
Forward
0 new messages