Cannot get Weewx to run on a Raspberry Pi 4

191 views
Skip to first unread message

michael form

unread,
Apr 16, 2020, 1:38:54 PM4/16/20
to weewx-user
Hello - I am running into problems getting WEEWX to work on a new 2 GB Raspberry Pi 4 running the latest version of Raspbian Buster. It boots from the SD card and then runs from a 525 GB SD card using a USB port.I am planning on using 1-Wire sensors using the DS9490R USB to 1_wire interface.

1. I installed Weewx following the directions from "http://weewx.com/docs/debian.htm". 
Then I followed directions from "https://github.com/weewx/weewx/wiki/owfs" to install the one wire stuff.

2. The Pi sees the DS9490R as running as "lsusb" shows:
pi@raspberrypi:~ $ lsusb
Bus 002 Device 002: ID 174c:55aa ASMedia Technology Inc. Name: ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge, ASM1153E SATA 6Gb/s bridge
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 001 Device 006: ID 04fa:2490 Dallas Semiconductor DS1490F 2-in-1 Fob, 1-Wire adapter
Bus 001 Device 004: ID 050d:0233 Belkin Components 
Bus 001 Device 003: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

3. Here is part of my weewx.conf file:

[Station]

    # Description of the station location
    location = " Valley Road, Southborough, MA 01772"

    # Latitude and longitude in decimal degrees
    latitude = 40.000
    longitude = -71.000

    # Altitude of the station, with unit it is in. This is downloaded from
    # from the station if the hardware supports it.
    altitude = 350, foot

    # 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


4. However, when running the following:
pi@raspberrypi:~ $ sudo 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 223, in init
    raise exNoController
ow.exNoController

gives the "exNoController" error. I looked into postings about this and nothing seems to be any of my problems. At least as far as I can see.

5. Doing "service weewx status" gives the following:

pi@raspberrypi:~ $ service weewx status
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated)
   Active: active (exited) since Thu 2020-04-16 12:55:32 EDT; 45s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1195 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)

Apr 16 12:55:32 raspberrypi weewx[1210]: owfs: interface is u
Apr 16 12:55:32 raspberrypi weewx[1210]: owfs: sensor map is {'outTemp': '/uncached/28.6E175D040000/temperature'}
Apr 16 12:55:32 raspberrypi weewx[1210]: owfs: sensor type map is {}
Apr 16 12:55:32 raspberrypi weewx[1210]: owfs: polling interval is 10
Apr 16 12:55:32 raspberrypi weewx[1210]: owfs: sensor unit system is metric
Apr 16 12:55:32 raspberrypi OWFS[1210]: DEFAULT: owlib.c:(208) Cannot open USB bus master
Apr 16 12:55:32 raspberrypi OWFS[1210]: DEFAULT: owlib.c:(52) No valid 1-wire buses found
Apr 16 12:55:32 raspberrypi OWFS[1210]: engine: Import of driver failed:  (<class 'ow.exNoController'>)
Apr 16 12:55:32 raspberrypi OWFS[1210]: engine: Unable to load driver:
Apr 16 12:55:32 raspberrypi OWFS[1210]:     ****  Exiting...


So, I am confused. The DS9490R USB bus master is seen by "lsusb" but "service weewx status" complains it cannot open it. 

I moved the DS9490R to an externally powered hub thinking that maybe this is a power issue, but no help. I installed Weewx on a old ATOM based machine running Xubuntu following the same procedure as described above and everything works fine. 

I admit that I am a novice Linux user, I design hardware, but I was wondering if anyone can point me in the direction of where to look to solve this problem. I was also wondering if anyone has had success in getting Weewx to work on the Pi 4 running Buster and using the DS9490R?

Thanks in advance for any help or suggestions

vince

unread,
Apr 16, 2020, 2:13:43 PM4/16/20
to weewx-user
> No valid 1-wire buses found

The mention of "/uncached/28.6E175D040000/temperature" got my attention.
I'm wondering if your sensor map doesn't match how the pi mapped the one-wire stuff.

michael form

unread,
Apr 16, 2020, 2:26:31 PM4/16/20
to weewx-user
The sensor value of the DS18B20 was obtained from the second system (ATOM 510 running Xubuntu) that worked fine. I included it in the Sensor Map section of weewx.conf as a temperature sensor. 

I am not sure how the pi maps the 1-wire stuff but as I posted, it does not seem to even see the DS9490R in "service weewx status". If it cannot see the DS9490R, I don't blame it for not working. Then again,
why can't it see the DS9490R since it shows up in "lsusb"? I can only think that I left something out along the way. However, a complete re-install of Weewx (after removal) yields the same result and as I said, 
an installation of exactly the same software on another PC running Xubuntu  works.

Thanks for your response.

p q

unread,
Apr 16, 2020, 2:38:04 PM4/16/20
to weewx...@googlegroups.com
Did you configure the raspi to turn on the one-wire interface using the raspi-config utility?

--
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/b90da255-f520-4979-a207-54e03f129cfc%40googlegroups.com.


--
Peter Quinn
(415)794-2264

michael form

unread,
Apr 16, 2020, 2:45:02 PM4/16/20
to weewx-user
I am using a DS9490R USB to 1-Wire controller, not the 1-Wire interface on the Pi using a GPIO pin. 

So, no, I did not configure it using raspi-config.

The answer is probably something simple related to the Pi or Buster since the same configuration works on an old PC running Linux.

Thanks.


On Thursday, April 16, 2020 at 2:38:04 PM UTC-4, p q wrote:
Did you configure the raspi to turn on the one-wire interface using the raspi-config utility?

On Thu, Apr 16, 2020 at 11:26 AM michael form <mike...@gmail.com> wrote:
The sensor value of the DS18B20 was obtained from the second system (ATOM 510 running Xubuntu) that worked fine. I included it in the Sensor Map section of weewx.conf as a temperature sensor. 

I am not sure how the pi maps the 1-wire stuff but as I posted, it does not seem to even see the DS9490R in "service weewx status". If it cannot see the DS9490R, I don't blame it for not working. Then again,
why can't it see the DS9490R since it shows up in "lsusb"? I can only think that I left something out along the way. However, a complete re-install of Weewx (after removal) yields the same result and as I said, 
an installation of exactly the same software on another PC running Xubuntu  works.

Thanks for your response.

On Thursday, April 16, 2020 at 2:13:43 PM UTC-4, vince wrote:
> No valid 1-wire buses found

The mention of "/uncached/28.6E175D040000/temperature" got my attention.
I'm wondering if your sensor map doesn't match how the pi mapped the one-wire stuff.

--
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...@googlegroups.com.


--
Peter Quinn
(415)794-2264

Glenn McKechnie

unread,
Apr 16, 2020, 7:03:00 PM4/16/20
to weewx...@googlegroups.com
On 17/04/2020, michael form <mike...@gmail.com> wrote:
> I am using a DS9490R USB to 1-Wire controller, not the 1-Wire interface on
> the Pi using a GPIO pin.
>
> So, no, I did not configure it using raspi-config.
>
> The answer is probably something simple related to the Pi or Buster since
> the same configuration works on an old PC running Linux.

Your problem sounds very like the one encountered by Howard Walter and
described at "weewx-owfs failure with new Raspbian Stretch"
https://groups.google.com/d/msg/weewx-user/CfhGLIF8aaU/W5fEscuPBQAJ
That link points to the last post in the thread with a confirmed
solution. Step through the method there and see if it then works
again.

In short, everything was setup as it should have been (as it was when
working before) except for those same error messages.

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'>)

The solution is to install and run owserver, then point owfs.py to use
that through ' interface = localhost:4304 ' rather than ' interface =
u '. It still uses the usb dongle, just via a different route.

Before you implement that change. What version of python-ow and
owserver (if installed) are you running at the moment?

apt show ow-python
apt show python-ow

also run them after the change has been implemented to catch owserver
if it was missing (and any update to python-ow.)

And, can you also post the section from weewx.conf that lists your
OWFS configuration ... [OWFS]



Good luck!

--


Cheers
Glenn

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

michael form

unread,
Apr 16, 2020, 7:45:25 PM4/16/20
to weewx-user
Glenn:

Thank you for your response. 

apt show ow-python  <<< does not show anything

apt show python-ow   <<< returns 3.2p3+dfg1-2

apt show owserver  returns info so I assume that owserver is installed. 

Do I need to uninstall things as per the referred post??

  - 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


Current {OWFS}
interface = u
driver = user.owfs
[[sensor map]]
outTemp = /uncached/28.6E175D040000/temperature


Do I just need to change the "u" to localhost:4304 or any other changes need to be made??

Sorry for all of the questions as I said that I design hardware and am familiar with Windows. Linux is a new experience for me. 
Then again, I might as well spend the time at home learning new things. :)

Thanks again.

Glenn McKechnie

unread,
Apr 16, 2020, 8:15:01 PM4/16/20
to weewx...@googlegroups.com
On 17/04/2020, michael form <mike...@gmail.com> wrote:
> Glenn:
>
> Thank you for your response.
>
> apt show ow-python <<< does not show anything

Ah, that's just me and the keyboard having issues again!

> apt show python-ow <<< returns 3.2p3+dfg1-2
>
> apt show owserver returns info so I assume that owserver is installed.

Ah, actually. I've given you the wrong command. To list installed
packages try the following

apt list --installed | grep owserver
apt list --installed | grep python-ow

Post the results of those commands

> Do I need to uninstall things as per the referred post??
>
> - Start from a fresh system (no other owfs components installed) and
> install owserver and ow-shell:
> $ sudo apt install owserver ow-shell

Nope. For a start, just give it try with...
sudo apt install owserver ow-shell

That should replace anything stale, or that's considered to clash.

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

Definitely do the above.
Those 2 lines are all that needs to be in the /etc/owfs.conf file for
this configuration to work.

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

You could add a status check just to make sure it's all good

sudo systemctl status owserver # that should work, but I'm not a systemctl user.


> Current {OWFS}
> interface = u
> driver = user.owfs
> [[sensor map]]
> outTemp = /uncached/28.6E175D040000/temperature
>
>
> Do I just need to change the "u" to localhost:4304 or any other changes
> need to be made??

That's it
[OWFS]
interface = localhost:4304
driver = user.owfs
[[sensor map]]
outTemp = /uncached/28.6E175D040000/temperature

(Although I have had one configuration baulk at localhost, using
127.0.0.1 worked ? interface = 127.0.0.1:4304)

> Sorry for all of the questions as I said that I design hardware and am
> familiar with Windows. Linux is a new experience for me.
> Then again, I might as well spend the time at home learning new things. :)

Agreed. An opportunity for us all :-)
Message has been deleted

Glenn McKechnie

unread,
Apr 17, 2020, 9:02:50 AM4/17/20
to weewx...@googlegroups.com
[...]
>
> pi@raspberrypi:~ $ sudo systemctl status owserver
> ● owserver.service - Backend server for 1-wire control
> Loaded: loaded (/lib/systemd/system/owserver.service; enabled; vendor
> preset: enabled)
> Active: failed (Result: signal) since Wed 2020-04-15 22:58:23 EDT; 22h
> ago
> Docs: man:owserver(1)
> Process: 549 ExecStart=/usr/bin/owserver -c /etc/owfs.conf (code=killed,
> signal=SEGV)
> Main PID: 549 (code=killed, signal=SEGV)

A SEGV is not good.

How did the installation of owserver go? And what's the version?

apt list --installed | grep owserver

> Apr 15 22:58:23 raspberrypi systemd[1]: owserver.service: Service
> RestartSec=100ms expired, scheduling restart.
> Apr 15 22:58:23 raspberrypi systemd[1]: owserver.service: Scheduled restart
>
> job, restart counter is at 5.
> Apr 15 22:58:23 raspberrypi systemd[1]: Stopped Backend server for 1-wire
> control.
> Apr 15 22:58:23 raspberrypi systemd[1]: owserver.service: Start request
> repeated too quickly.
> Apr 15 22:58:23 raspberrypi systemd[1]: owserver.service: Failed with
> result 'signal'.
> Apr 15 22:58:23 raspberrypi systemd[1]: Failed to start Backend server for
> 1-wire control.

[...]
>
> OWFS.CONF Follows:
>

That appears okay.

[...]

> WEEWX.CONF follows:
>
> Options for extension 'owfs'
> [OWFS]
> interface = localhost:4304
> driver = user.owfs
> [[sensor_type]]
> [[sensor_map]]
> outTemp = /uncached/28.6E175D040000/temperature

And that appears okay as well.

> Again, thank you for all of your help. I really appreciate it. The thing
> that confuses me is that everything works on a PC running Ubuntu but not on

Somethings not right on the Pi, and if the owserver won't start , nor python-ow?

Do you have the pi's 1-wire interface enabled? If so try disabling it.

sudo raspi-config
Option 5? Interfacing options
P7 1-wire enable or disable.
(or something like that). You are after the option to enable/disable
one-wire interface. Disable it.

Then see if owserver starts after you reboot the Pi

Glenn McKechnie

unread,
Apr 17, 2020, 8:07:42 PM4/17/20
to weewx...@googlegroups.com
On 17/04/2020, Glenn McKechnie <glenn.m...@gmail.com> wrote:

> Do you have the pi's 1-wire interface enabled? If so try disabling it.
>
> sudo raspi-config
> Option 5? Interfacing options
> P7 1-wire enable or disable.
> (or something like that). You are after the option to enable/disable
> one-wire interface. Disable it.

I forgot that you answered that one in an earlier reply. And the
answer is that it's off.

Refreshing my memory further, there have been issues with owserver and
Pi4 on this list, but not quite the same failure. Same outcome though.
https://groups.google.com/d/msg/weewx-user/4EZRDyPoBH8/gN23K0feDAAJ

We can attempt to see what owserver is actually failing on by running
the following from the terminal.

sudo /usr/bin/owserver -c /etc/owfs.conf --debug

and you'll get output to the screen. Hopefully it will be meaningful,
or at least offer a clue.

You can redirect it to a file and attach that file (/tmp/owdebug.log)
to your next post.

sudo /usr/bin/owserver -c /etc/owfs.conf --debug > /tmp/owdebug.log 2>&1

Glenn McKechnie

unread,
Apr 17, 2020, 8:11:16 PM4/17/20
to weewx...@googlegroups.com
Forgot to add how to stop the output / command (either one)
Use Ctrl-C at the terminal

michael form

unread,
Apr 17, 2020, 8:24:59 PM4/17/20
to weewx-user
Thanks again. A little while ago I checked to see if 1-wire was disabled in raspi-config, as you suggested. I explicitly disabled it anyway and rebooted. 

The magic of re-booting---Now things seem to be working, at least for my test setup. I will see if it can start up again and work and add additional 1-Wire sensors.I have no definite idea on why 
seems to work now. It would be good, if it hasn't already been done, to modify the doc so that no one has to go through the headaches that I did.I would do it myself if I knew anything much
about Linux. :)

Thank you for all of your help. If you were local and restaurants were open, I'd take you out for lunch.

Stay well.

Michael

vince

unread,
Apr 17, 2020, 8:51:29 PM4/17/20
to weewx-user
On Friday, April 17, 2020 at 5:24:59 PM UTC-7, michael form wrote:
The magic of re-booting---Now things seem to be working, at least for my test setup

Before you continue your Windows habits, please do 'not' in the habit of this on Linux.  It is almost never needed.  Really.

For the future, whenever you start fiddling with all the knobs and dials, (a) save yourself a backup of the SD card that you can easily revert to and (b) write everything down.  Everything.   It's likely you had multiple things tweaked that conflicted.

But glad it's working ! 

Glenn McKechnie

unread,
Apr 17, 2020, 8:53:14 PM4/17/20
to weewx...@googlegroups.com
On 18/04/2020, michael form <mike...@gmail.com> wrote:
> Thanks again. A little while ago I checked to see if 1-wire was disabled in
>
> raspi-config, as you suggested. I explicitly disabled it anyway and
> rebooted.
>
> The magic of re-booting---Now things seem to be working, at least for my
> test setup. I will see if it can start up again and work and add additional
>
> 1-Wire sensors.I have no definite idea on why
> seems to work now. It would be good, if it hasn't already been done, to
> modify the doc so that no one has to go through the headaches that I did.I
> would do it myself if I knew anything much
> about Linux. :)


The reboot was an easy way to unload the 1-wire kernel module from
memory, if there was a change to make. Under linux, that can be done
from the command line but it's at the risk of introducing errors and
further confusion. A reboot is far simpler.

Sadly, that seems to be the outcome for those who have run into
problems with owfs and Pi4's (or Buster installations).
There's been no real solution except a vague, hand waving reboot.
That's hard to document with a straight face, and certainly with any
authority :-)

Still, it works now, and hopefully it will keep working.

And yes... stay well.
Reply all
Reply to author
Forward
0 new messages