pyownet ... pip refuses to add it

92 views
Skip to first unread message

messyp...@gmail.com

unread,
Feb 19, 2025, 8:44:48 PM2/19/25
to weewx-user
new install of 4.9.1 (I like it and don't want to change if I don't have to)
Raspberry pi running "Debian GNU/Linux 12 (bookworm)"
(Note: I just did this yesterday to another rpi4 running Linux 11/bullseye and everything loaded perfectly)
Is there something about bookworm that breaks getting what we need to run 1wire on our pis with weewx? To wit:
pi@raspberrypi4b:~ $ sudo python3
Python 3.11.2 (main, Nov 30 2024, 21:22:50) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyownet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pyownet'

>>>

or
sudo apt-get install pyownet  
E: Unable to locate package pyownet
if it is not available via apt-get then uses pip3 (apt-get install pip3-python to install pip3 )
pip3 install pyownet
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.


My "production" wx server is a pi4 running bullseye w/ weewx 4.9.1 and I have the system setup running weewx, Vantage driver; I just haven't installed my Sheepwalk 1wire hat yet, soon as I do I'll add those 4 sensors to my weewx.conf ... FYI I had this setup a couple years ago working fine for about 6 years but lightning strike took out my ow hat, pi, and I rebuilt it to 4.9.1 albeit without my onewire stuff. Now I want to add them (3 temps, 1 lightning strike counter).
I must mention my observation that trying to follow the history and stories about what it takes to setup owfs so my weewx/pi4 can start reading them.  I haven't seen where anyone (yet) has brought the latest owfs stuff together in *one* place for us to follow. So meanwhile I'm at a roadblock with pyownet.
Thanks for anyone's help.
Phil




Glenn McKechnie

unread,
Feb 19, 2025, 9:23:58 PM2/19/25
to weewx...@googlegroups.com
For bookworm, Pyownet is definitely a pip install. I'm not sure if they ever had it as a Debian package, at least not for a couple of versions.

I have it installed here with weewx5, and previously with v4.x, but always as a pip install.
My current installation of weewx is using the weewx-venv method so I don't get that management warning.

I'm assuming you've installed the deb package of weewx to be getting that warning?
While I'm no expert on python and venv's , I'd be surprised if forcing an install of pyownet via pip would actually break anything, It's one solitary package that shouldn't be pulling anything else in, nor should any other software be confused by it. So while it may be less than ideal, nothing should actually "break"

While it might sound dire, doing a forced install shouldn't get you hung. The last line of that pip3 warning message tells you how to do that ... use --break-system-packages

If you want to stay inside the white line then do the weewx installation via pip. It works very well.

As for *one* place for info; have a look at the following link, it's got pretty much everything to get 1-wire working with a fork of Mathew Walls owfs. It's what I use.


And for sheepdog gear, I've had a humidity sensor working here. I'd be very surprised if it doesn't work with the owfs driver.

Cheers
 Glenn

Various WeeWx addons at
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.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/da8ca7d8-2ca3-4415-a730-e044df2bad70n%40googlegroups.com.

messyp...@gmail.com

unread,
Feb 19, 2025, 9:24:34 PM2/19/25
to weewx-user
Update: I just read from https://github.com/glennmckechnie/weewx-owfs  where Glen mentions the warning, and, basically to ignore it. I overthought it when I didn't have the issue with a bullseye install, but did with bookworm.  I will now proceed with
1) fetch the package: wget -O weewx-owfs-master.zip https://github.com/glennmckechnie/weewx-owfs/archive/refs/heads/master.zip
. . .
and hope all goes well.

messyp...@gmail.com

unread,
Feb 19, 2025, 9:34:41 PM2/19/25
to weewx-user
I finished the last couple of items and now my weewx.conf has the proper entry in it, all I have to do now is get the ow hat & some DS18B20's plugged into it, read their addresses, and edit this.
[OWFS]
    driver = user.owfs
    [[sensor_map]]
    [[sensor_type]]

Thousand thanks.
Phil

messyp...@gmail.com

unread,
Feb 19, 2025, 9:51:37 PM2/19/25
to weewx-user
The proof is after a weewx restart without errors, and these owfs entries in syslog look appropriate:
Feb 19 20:47:53 raspberrypi4b weewxd[38721]: weewx[38721] INFO user.owfs: service version is 0.23.8 (pyownet)
Feb 19 20:47:53 raspberrypi4b weewxd[38721]: weewx[38721] INFO user.owfs: binding is archive
Feb 19 20:47:53 raspberrypi4b weewxd[38721]: weewx[38721] INFO user.owfs: interface starts as None
Feb 19 20:47:53 raspberrypi4b weewxd[38721]: weewx[38721] INFO user.owfs: sensor map is {}
Feb 19 20:47:53 raspberrypi4b weewxd[38721]: weewx[38721] INFO user.owfs: sensor type map is {}
Feb 19 20:47:53 raspberrypi4b weewxd[38721]: weewx[38721] INFO user.owfs: dallas direction map is {}
Feb 19 20:47:53 raspberrypi4b weewxd[38721]: weewx[38721] INFO user.owfs: sensor unit system is metric
Feb 19 20:47:53 raspberrypi4b weewxd[38721]: weewx[38721] INFO user.owfs: pyownet interface set as localhost:4304


messyp...@gmail.com

unread,
Feb 19, 2025, 10:46:32 PM2/19/25
to weewx-user
Okay I've got a believed-to-be-good i2c onewire device (sheepwalk electronics' RPI3v2) with some temp sensors on the bus, and the old methods of reading what it's collecting isn't working. I used to be able to
hit a port with my browser and it would enumerate the sensor tree. How can I read the various sensors I have on it now, so I can get their addresses and put them in the [OWFS] section?

messyp...@gmail.com

unread,
Feb 19, 2025, 10:57:46 PM2/19/25
to weewx-user
I cannot figure out how to eunumerate my sensors.
Here is my /etc/owfs.conf:
pi@raspberrypi4b:~ $ cat /etc/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
server: device /dev/i2c-1 # for a pi using i2c-1
#
# USB device: DS9490
#server: usb = all
#
# Serial port: DS9097
#server: device = /dev/ttyS1
#
# owserver tcp address
server: server = 192.168.2.165: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

Messy Potamia

unread,
Feb 19, 2025, 11:41:42 PM2/19/25
to weewx...@googlegroups.com
I found it --
> --
> 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/rJx7lzh5cuQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/weewx-user/f3484642-8ced-45ad-9637-ac9d246e6a8fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages