python3-ow for OWFS

107 views
Skip to first unread message

Gazza

unread,
May 21, 2020, 6:55:21 AM5/21/20
to weewx-user

I am trying to get the OWFS service installed on a new Weewx 4 install on a Raspberry Pi with Buster.

When I try to install the required python3-ow package I get an error that it "Unable to locate package python3-ow"

Do I have to add some other repository to get this package ??

pi@raspberrypi:~ $ sudo apt install python3-ow
Reading package lists... Done
Building dependency tree
Reading state information... Done
E
: Unable to locate package python3-ow



Gary

Tom Keffer

unread,
May 21, 2020, 8:51:49 AM5/21/20
to weewx-user
Best I can tell, python3-ow was not included in buster, or any other stable release. There is an unstable release, but it seems to support the Power-PC architecture only.

PyPi offers 1-wire wrapper for Python 2 and 3 called onewire, but it seems to use a completely different API.

I'm afraid you're stuck with Python 2. :-(

-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.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/85259404-2d6a-4d7c-9399-d8f4c840f0fb%40googlegroups.com.

Glenn McKechnie

unread,
May 21, 2020, 9:54:02 AM5/21/20
to weewx...@googlegroups.com
That's odd it was there, but it really does seem to have gone missing
from the repos, and there's no record of it (or one I can find). I've
had a look in the local cache but it's not in there either.

Looks like it's time to switch to using owfs.py with ow-server and pyownet.
That combination works here with a tweaked driver, but try it with the
ported original at
https://github.com/matthewwall/weewx-owfs (mine needs a little tidying :)

You may have to install pyownet via pip / pip3
08:51 AM $ pip3 show pyownet
Name: pyownet
Version: 0.10.0.post1
Summary: Python OWFS client library (owserver protocol)
Home-page: https://github.com/miccoli/pyownet
Author: Stefano Miccoli
Author-email: stefano...@polimi.it
License: LGPLv3
Location: /usr/local/lib/python3.7/dist-packages


If you're unfamiliar with the installation of owserver have a look in
this groups history for various mentions of it.
If there are still questions we'll follow up in the morning (mine?)

Basically, it's a case of pointing owserver (/etc/owfs.conf) at your
1-wire interface (usb=ALL /dev/ttyS? /dev/i2c-1...), and point
owfs.py to talk to owserver (localhost:4304)

=============

07:36 AM $ apt install python3-ow
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-ow is already the newest version (3.2p3+dfsg1-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

==========

08:11 AM $ apt show python3-ow
Package: python3-ow
Version: 3.2p3+dfsg1-2
Priority: optional
Section: python
Source: owfs
Maintainer: Vincent Danjean <vdan...@debian.org>
Installed-Size: 140 kB
Provides: python3.6-ow, python3.7-ow
Depends: libc6 (>= 2.4), libow-3.2-3, libpython3.6 (>= 3.6.5),
libpython3.7 (>= 3.7.0), python3 (<< 3.8), python3 (>= 3.6~),
python3:any
Homepage: http://owfs.org/
Download-Size: 33.2 kB
APT-Manual-Installed: yes
APT-Sources: http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
Description: Dallas 1-wire support: Python 3 bindings
The 1-Wire bus is a cheap low-speed bus for devices like weather
sensors, access control, etc. It can be attached to your system via
serial, USB, I2C, and other interfaces.
.
Python 3 bindings for the OWFS 1-Wire support library have been produced
with SWIG and allow access to libow functions from Python code.

===============

07:40 AM $ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib
non-free rpi

===============

07:38 AM $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
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"
> --
> 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/85259404-2d6a-4d7c-9399-d8f4c840f0fb%40googlegroups.com.
>


--


Cheers
Glenn

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

Gazza

unread,
May 21, 2020, 11:32:27 PM5/21/20
to weewx-user

Thanks for the info, I also want to add a BME280 sensor and have had a look at the bme280wx driver by WJCarpenter and it seems to be python2 only at this stage.

So for the time being I will go back to using python 2.

How do I get the systemd service for run weewx in python2 mode ??

Tom Keffer

unread,
May 22, 2020, 7:16:47 AM5/22/20
to weewx-user
If you did a package install, look in /etc/default/weewx

--
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.

Gazza

unread,
May 22, 2020, 7:24:35 AM5/22/20
to weewx-user
I did a setup.py install.

Tom Keffer

unread,
May 22, 2020, 7:53:13 AM5/22/20
to weewx-user
It's pretty simple, really. Your weewx.service file will have a section that looks like

[Service]
ExecStart=/home/weewx/bin/weewxd --daemon --pidfile=/var/run/weewx.pid /home/weewx/weewx.conf
ExecReload=/bin/kill -HUP $MAINPID
Type=forking
PIDFile=/var/run/weewx.pid

You want to invoke python explicitly, instead of relying on the "shebang" inside /home/weewx/bin/weewxd. Change the file to something like

[Service]
ExecStart=/usr/bin/python2 /home/weewx/bin/weewxd --daemon --pidfile=/var/run/weewx.pid /home/weewx/weewx.conf
ExecReload=/bin/kill -HUP $MAINPID
Type=forking
PIDFile=/var/run/weewx.pid

I'm just guessing that the path to your Python 2 interpreter is /usr/bin/python2. Adjust as necessary.

-tk

On Fri, May 22, 2020 at 4:24 AM Gazza <gaz...@gmail.com> wrote:
I did a setup.py install.

--
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.

Gazza

unread,
May 22, 2020, 8:04:00 AM5/22/20
to weewx-user
 Thanks for that I was not sure if i needed to point to python or python2. Just looked in that location and both of those files are links to python2.7.

So far have a new V4 python 2 install running with all the SDR stuff receiving data and about to try the OWFS service again.


Gaz
Reply all
Reply to author
Forward
0 new messages