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
https://github.com/weewx/weewx/wiki/owfss
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,



On 15 December 2017 at 11:45, Glenn McKechnie <glenn.mckech...@gmail.com>
wrote:

> 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.
>
> How to add a ds18b20 thermometer to raspberry pi and weewx
> https://groups.google.com/forum/#!searchin/weewx-user/
> ds18b20|sort:date/weewx-user/n1BbF3FAKh8/XxdPovR3AgAJ
>
>
>
>
>
>
>
> Cheers
>  Glenn
>
> rorpi - read only raspberry pi & various weewx addons
> https://github.com/glennmckechnie
>
> On 15 December 2017 at 19:55, mixpc75 <mixp...@gmail.com> wrote:
>
>> 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 <hwalt...@gmail.com> wrote:
>>
>>> Nice detective work Glenn!
>>>
>>> I'll have a chance in the next few days to try the older versions.
>>>
>>>
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to