Glen,

Thank you for your support all along. It's fantastic.

I have read and follow your indications, so here we go:

[OWFS] uninstalled
pi@raspberrypi:~ $ sudo wee_extension --uninstall owfs
Request to remove extension 'owfs'
Finished removing extension 'owfs'


pi@raspberrypi:~ $ sudo nano /usr/share/weewx/user/ds18b20.py
edited as indicated DEBUG > INFO

pi@raspberrypi:~ $ sudo systemctl restart 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 Sat 2017-12-16 00:16:56 CET; 3min 55s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1149 ExecStop=/etc/init.d/weewx stop (code=exited,
status=0/SUCCESS)
  Process: 1180 ExecStart=/etc/init.d/weewx start (code=exited,
status=0/SUCCESS)
   CGroup: /system.slice/weewx.service
           └─1195 python /usr/bin/weewxd --daemon
--pidfile=/var/run/weewx.pid /etc/weewx/weewx.conf

Dec 16 00:16:57 raspberrypi weewx[1195]: restx: CWOP: Posting not enabled.
Dec 16 00:16:57 raspberrypi weewx[1195]: restx: WOW: Posting not enabled.
Dec 16 00:16:57 raspberrypi weewx[1195]: restx: AWEKAS: Posting not enabled.
Dec 16 00:16:57 raspberrypi weewx[1195]: engine: Starting up weewx version
3.8.0
Dec 16 00:16:57 raspberrypi weewx[1195]: engine: Clock error is -0.57
seconds (positive is fast)
Dec 16 00:16:57 raspberrypi weewx[1195]: engine: Starting main packet loop.
Dec 16 00:20:18 raspberrypi weewx[1195]: ds18b20: found value of 71.4866
Dec 16 00:20:18 raspberrypi weewx[1195]: manager: Added record 2017-12-16
00:20:00 CET (1513380000) to database 'weewx.sdb'
Dec 16 00:20:18 raspberrypi weewx[1195]: manager: Added record 2017-12-16
00:20:00 CET (1513380000) to daily summary in 'weewx.sdb'
Dec 16 00:20:49 raspberrypi weewx[1195]: cheetahgenerator: Generated 14
files for report StandardReport in 27.79 seconds

pi@raspberrypi:~ $ tail /var/log/syslog
Dec 16 00:16:57 raspberrypi weewx[1195]: engine: Starting up weewx version
3.8.0
Dec 16 00:16:57 raspberrypi weewx[1195]: engine: Clock error is -0.57
seconds (positive is fast)
Dec 16 00:16:57 raspberrypi weewx[1195]: engine: Starting main packet loop.
Dec 16 00:17:01 raspberrypi CRON[1204]: (root) CMD (   cd / && run-parts
--report /etc/cron.hourly)
Dec 16 00:20:18 raspberrypi weewx[1195]: ds18b20: found value of 71.4866
Dec 16 00:20:18 raspberrypi weewx[1195]: manager: Added record 2017-12-16
00:20:00 CET (1513380000) to database 'weewx.sdb'
Dec 16 00:20:18 raspberrypi weewx[1195]: manager: Added record 2017-12-16
00:20:00 CET (1513380000) to daily summary in 'weewx.sdb'
Dec 16 00:20:49 raspberrypi weewx[1195]: cheetahgenerator: Generated 14
files for report StandardReport in 27.79 seconds
Dec 16 00:20:53 raspberrypi weewx[1195]: imagegenerator: Generated 12
images for StandardReport in 4.09 seconds
Dec 16 00:20:53 raspberrypi weewx[1195]: copygenerator: copied 9 files to
/var/www/html/weewx

Great! 71.48F So temperature readings are indeed being read and stored.

I will have a good look at Customizing reports, thank you for the link.
Looks very interesting.

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

pi@raspberrypi:~ $ sudo /usr/share/weewx/weewxd /etc/weewx/weewx.conf
LOOP:   2017-12-16 00:30:12 CET (1513380612) altimeter: 31.0947369861,
appTemp: 28.2105115068, barometer: 31.0999349264, cloudbase: 1246.45336708,
dateTime: 1513380612, dewpoint: 26.9858954849, heatindex: 32.4558545686,
humidex: 32.4558545686, inDewpoint: 31.0785201424, inHumidity:
29.9973971396, inTemp: 63.0013014302, maxSolarRad: None, outHumidity:
79.9980477911, outTemp: 32.4558545686, pressure: 31.0999349264, radiation:
0, rain: 0.0, rainRate: 0.04, usUnits: 1, UV: 0, windchill: 32.4558545686,
windDir: 359.988286747, windGust: 0.000390441770883, windGustDir:
359.988286747, windSpeed: 0.000325368142403
LOOP:   2017-12-16 00:30:15 CET (1513380615) altimeter: 31.0947359449,
appTemp: 28.2085542481, barometer: 31.0999338852, cloudbase: 1246.44544679,
dateTime: 1513380615, dewpoint: 26.9841848881, heatindex: 32.4541091226,
humidex: 32.4541091226, inDewpoint: 31.0785039227, inHumidity:
29.9973554963, inTemp: 63.0013222519, maxSolarRad: None, outHumidity:
79.9980165566, outTemp: 32.4541091226, pressure: 31.0999338852, radiation:
0, rain: 0.0, rainRate: 0.04, usUnits: 1, UV: 0, windchill: 32.4541091226,
windDir: 359.98809934, windGust: 0.000396688671222, windGustDir:
359.98809934, windSpeed: 0.000330573892684
REC:    2017-12-16 00:30:00 CET (1513380600) altimeter: 31.0947817327,
appTemp: 28.3384578077, barometer: 31.0999796687, cloudbase: 1247.01954441,
dateTime: 1513380600.0, dewpoint: 27.0975535731, ET: 0.0, extraTemp1:
71.2616, heatindex: 32.5700038371, humidex: 32.5700038371, inDewpoint:
31.0792171359, inHumidity: 29.9991867618, inTemp: 63.0004066191, interval:
5, maxSolarRad: None, outHumidity: 79.9993900603, outTemp: 32.5700038371,
pressure: 31.0999796687, radiation: 0.0, rain: 0.0, rainRate: 0.04,
usUnits: 1, UV: 0.0, windchill: 32.5700038371, windDir: 359.99346725,
windGust: 0.000359950916684, windGustDir: 359.989201472, windrun:
1.6074832444e-05, windSpeed: 0.000101656621008

Yes, there it is! REC: and extraTemp1 71.2616
Wether they should be seen under LOOP: As I see it LOOP: prints out reading
values every 2-3 seconds while extraTemp1 value is being read every 5 min.
Yes, I have been staring at the screen for about 5min just to see that REC:
displayed. So maybe there is no real need to have extraTemp1 value
displayed so often as it is being aligned with read/store timing.

In regards to the last part of your message, yes, I do agree with your
view. First and foremost, as I see it, weewx is oriented towards weather
stations as per se. The listing of weewx-friendly weather stations during
install makes it just so clear. And that is great. The case you mention
which I think is the most frequent case is a sensor that is added as an
extra sensor to a weather station, but in my scenario that sensor _is_ the
weather station. That is why I was asking about editing weewx.conf
weather_station = DS18B20 and so on. Basically, implementing it as a
driver. As you suggest and I fully agree, now that data is being read
(finally! :) and stored, I think it is much more practical working on
customizing report first. And that is what I plan to do. Afterall, reading
and storing data, and displaying reports plus uploading to a remote server
(eg. Weather Underground) is all I need. wunderfixer comes in as a very
helpful tool. Remaping extraTemp1 to outTemp and implementing a driver...
maybe later on.

I'll write back after working on it.

Glen, once more, I appreciate your generous support. Thumbs up!

Regards,



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

> Returning from the discusion at https://groups.google.com/
> forum/#!topic/weewx-user/CfhGLIF8aaU
>
>
> On 16 December 2017 at 02:49, mixpc75 <mixp...@gmail.com> wrote:
> >
> > 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
>
> [...]
>
> Just so we are clear on it - those packages don't apply to your case
> anymore. Neither owfs or OWFS are relevant here.
>
> > 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
> >
>
> [OWFS] is redundant - it no longer applies as you are not using the owfs
> driver/service. Use wee_extension --uninstall owfs to remove it cleanly
> (unless you hand edited back in?). Either way remove it.
> Using the Simulator is okay at this stage, you are using it to allow weewx
> to start and run.
>
>
> > 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
>
> [...]
>
> Yep, while I dislike systemd's logging. Those summaries do show it's
> working. :-)
>
>
> [...]
>
> > 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
>
> Needless. Yes, these are only of use if you're using mwalls driver with a
> 1-wire bus master.
>
> >
> > 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:
>
> There are several things - not necessarily in order.
>
> A quick and temporary way to see if the script is returning a value is to
> change DEBUG to INFO around line 39 -ish...
>             [...]
>             syslog.syslog(syslog.LOG_DEBUG, "ds18b20: found value of %s"
> % value)
> becomes
>            # syslog.syslog(syslog.LOG_DEBUG, "ds18b20: found value of %s"
> % value)
>             syslog.syslog(syslog.LOG_INFO, "ds18b20: found value of %s" %
> value)
>
> and run tail -f /var/log/syslog in another terminal. You should see that
> message pop up, with a value every 5 minutes.
>
> From Horacios post...
>
> >> As a result the extraTemp1 value is available in weewx. It is possible
> to change the event label in the third line from the bottom of ds18b20.py
>
> You don't want to change the event label until you're more confident with
> weewx, but as it is now you should have values being placed into the
> database under extraTemp1
> If they are there, then it's reading and storing the value. You can then
> use them in your reports by configuring your skin.conf and the
> index.html.tmpl accordingly.
> http://www.weewx.com/docs/customizing.htm#customizing_reports
>
> Also.
> From Horacios ds18b20.py script...
>       [...]
>         self.bind(weewx.NEW_ARCHIVE_RECORD, self.read_temp)
>
> Shows that they should be showing up in the archive record.
>
> stop weewx and run it directly ( http://www.weewx.com/docs/
> usersguide.htm#Running_directly ) using...
>
>  /usr/share/weewx/weewxd  /etc/weewx/weewx.conf
>
> You'll see lines starting with LOOP: and REC:  REC is the
> NEW_ARCHIVE_RECORD and that's where they should show up. They won't be seen
> under LOOP: as the driver doesn't use that - (perhaps it should?)
>
> [...]
>
> > But since it configured as a service, how should weewx.conf be edited so
> that it takes values from Horacio's script?
>
> [...]
>
> > But what about this particular case? Editing station_type = DS18B20
>
> Short answer - No.
> Long answer: Not sure how you go running one sensor like this. Usually
> it's supplementing an exisiting stations data. That's a question for those
> more knowledgeable although the documentation has a section showing how to
> implement it as a driver :)
> http://www.weewx.com/docs/customizing.htm#Implement_the_driver
>
> > 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
>
> Nope. ds18b20.py doesn't use section headings (such as [DS18B20]) so it
> won't be looking for any user additions to the weewx.conf file. If it was a
> driver in it's own right then you could have and use a [DS18B20] section.
>
> However you may be able to remap extraTemp1 to outTemp ...
>
> extraTemp1 instead of outTemp sensor
> https://groups.google.com/forum/#!msg/weewx-user/iHaBv9cceEk/jTjMWCLYCgAJ;
> context-place=topic/weewx-user/140WrtGfMMs
>
> But that may be adding a whole new level of complexity at this stage. Try
> it but I'd work on adding it, as extraTemp1, by customizing the report
> first.
>
> >
> > I'm a bit lost at this stage but very glad to see how close we are to
> get it done :)
> >
> > Regards,
>
>
>
> Cheers
>  Glenn
>
> rorpi - read only raspberry pi & various weewx addons
> https://github.com/glennmckechnie
>
> There's no more from me below, the rest is context for this post - from
> the other thread.
>
> >
> >
> >
> > 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.
>
>
>
> Cheers
>  Glenn
>
> rorpi - read only raspberry pi & various weewx addons
> https://github.com/glennmckechnie
>
> On 13 December 2017 at 09:23, Glenn McKechnie <glenn.mckech...@gmail.com>
> wrote:
>
>> Well, it's a bit of a puzzle
>>
>> We know you have had it working with owfs.py as your first post shows
>> it returning a result when you used the --iface localhost:4304
>>
>>
>> On 12 December 2017 at 23:32, mixpc75 <mixp...@gmail.com> wrote:
>> > Dear Glenn,
>> >
>> [...]
>>
>> > PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/owfs.py
>> --sensors
>> > gives the usual error:
>> > 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
>>
>> you've forgotten to add the --iface string ' --iface localhost:4304 '
>> . Add that and see if it works again.
>>
>> [...]
>>
>> > PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/owfs.py --iface
>> > localhost:4304 --sensors
>> > PYTHONPATH=/usr/share/weewx sudo python /usr/share/weewx/user/owfs.py
>> > --iface localhost:4304 --sensors
>> > result in the same respective errors as indicated above
>>
>> Now I'm really confused, because you had it working before with that
>> exact same command...
>>
>> pi@raspberrypi:~ $ sudo PYTHONPATH=/usr/share/weewx python
>> /usr/share/weewx/user/owfs.py --iface localhost:4304 --sensors
>> 67C6697351FF: /10.67C6697351FF DS18S20
>> 4AEC29CDBAAB: /05.4AEC29CDBAAB DS2405
>>
>> although I note that you've switched sudos positioning.
>>
>> [...]
>>
>> > Just to check weewx status I run
>> > 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 (exited) since Tue 2017-12-12 13:20:34 CET; 1min 53s
>> ago
>> >      Docs: man:systemd-sysv-generator(8)
>> >   Process: 249 ExecStart=/etc/init.d/weewx start (code=exited,
>> > status=0/SUCCESS)
>> >    CGroup: /system.slice/weewx.service
>> >
>> > Dec 12 13:20:34 raspberrypi weewx[349]: owfs: driver version is 0.21
>> > Dec 12 13:20:34 raspberrypi weewx[349]: owfs: interface is
>> localhost:4304
>> > Dec 12 13:20:34 raspberrypi weewx[349]: owfs: sensor map is {}
>> > Dec 12 13:20:34 raspberrypi weewx[349]: owfs: sensor type map is {}
>> > Dec 12 13:20:34 raspberrypi weewx[349]: owfs: polling interval is 10
>> > Dec 12 13:20:34 raspberrypi weewx[349]: owfs: sensor unit system is
>> metric
>> > Dec 12 13:20:39 raspberrypi OWFS[349]: DEFAULT: owlib.c:(52) No valid
>> 1-wire
>> > buses found
>> > Dec 12 13:20:39 raspberrypi OWFS[349]: import of driver failed:  (<class
>> > 'ow.exNoController'>)
>> > Dec 12 13:20:39 raspberrypi OWFS[349]: engine: Unable to load driver:
>> > Dec 12 13:20:39 raspberrypi OWFS[349]:     ****  Exiting...
>> >
>> > So there it is, the same error. So it seems now there is no way to get
>> the
>> > --sensors value... I have attached a link to the three config files:
>>
>> Indeed, it's not working. I wonder if changing to an IP would make a
>> difference?
>>
>> interface = 127.0.0.1:4304
>>
>> The port 4304 was working before and is the one in the owfs.conf file
>> so that should be correct.
>> If you run...
>> netstat -nlp
>> you can check and confirm if it's actually listening there. The
>> owfs.py notes suggest 3003 but...?
>>
>> [...]
>>
>> In summary
>> we know you had it working from the command line
>> we know it's at (or was at)  localhost:4304 and that --iface
>> localhost:4304  worked
>> It appears that - weewx.conf is not accepting that as the interface entry?
>>
>> I see the other thread has become active and offers further insight ,
>> I shall move there - if required!
>>
>>
>> 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+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