Realtime.txt, realtime.xml and sunbird.txt

603 views
Skip to first unread message

Janez Kranjski

unread,
Dec 16, 2016, 12:22:41 PM12/16/16
to weewx-user
Last week I retired my old laptop with Windows XP and Cumulus.
I bought Raspberry PI, installed Linux (Jessie) and Weewx with my old Oregon WMR200 weather station.
Almost everything works, but there are (as always) some issues. 
On my weather webpage I have many visitors and many of them also uses Android phones with Weather Station for Cumulus App
As many of you knows, Cumulus uses three files for some devices ("realtime.txt", "realtime.xml" and "sunbird.txt"). 

Any idea how to get those files with Weewx? 
I tried with Wee Extension named CRT, but it prepares only "realtime.txt" (as promised also in documentation).
Then I tried with this thread from this forum, but it also don't prepare all three files. To be more specific - it prepares "realtime.txt" and "sunbird.txt", but not "realtime.xml". 
In log file I can see next lines:
cheetahgenerator: **** Ignoring template /etc/weewx/skins/Standars/realtime.txt.tmpl
cheetahgenerator: **** Reason: cannot find 'forecast'
**** Trackback (most recent call last):
**** File "/usr/share/weewx/weewx/cheetahgenerator.py", line 315, in generate
**** print >> _file, text
**** File "/usr/lib/python2.7/dis-packages/Cheetah/Template.py", line 1005, in __str__
**** rc = getattr(self, mainMethName) ()
**** File "_etc_weewx_skins_Standars_realtime_txt_tmpl.py", line 85, in respond
**** NotFound: cannot find 'forecast'

Any idea? 
Maybe another approach? This second try was from thread which is quite old (2013) ...

Thank you for your advices.

mwall

unread,
Dec 16, 2016, 12:37:41 PM12/16/16
to weewx-user
On Friday, December 16, 2016 at 12:22:41 PM UTC-5, Janez Kranjski wrote:
Last week I retired my old laptop with Windows XP and Cumulus.
I bought Raspberry PI, installed Linux (Jessie) and Weewx with my old Oregon WMR200 weather station.
Almost everything works, but there are (as always) some issues. 
On my weather webpage I have many visitors and many of them also uses Android phones with Weather Station for Cumulus App
As many of you knows, Cumulus uses three files for some devices ("realtime.txt", "realtime.xml" and "sunbird.txt"). 

Any idea how to get those files with Weewx? 
I tried with Wee Extension named CRT, but it prepares only "realtime.txt" (as promised also in documentation).

janez,

if you could point me to an official specification for realtime.xml and sunbird.txt, i can update the crt extension to emit realtime.xml and sunbird.txt in addition to realtime.txt

m

Janez Kranjski

unread,
Dec 16, 2016, 2:22:55 PM12/16/16
to weewx-user
That should be the best solution. I will prepare specifications (if I remember, it very clean and propably won't be a problem). I'm sure that many users will benefit from it. Stay tuned :-)

Janez Kranjski

unread,
Dec 17, 2016, 12:38:24 PM12/17/16
to weewx-user
I find those two files:

Can you add this to CRT extension? Usually all three files are used.

Janez Kranjski

unread,
Dec 28, 2016, 3:31:45 AM12/28/16
to weewx-user


On Friday, December 16, 2016 at 6:37:41 PM UTC+1, mwall wrote:
if you could point me to an official specification for realtime.xml and sunbird.txt, i can update the crt extension to emit realtime.xml and sunbird.txt in addition to realtime.txt

m

@mwall:
Any news?
:-) 

Janez Kranjski

unread,
Jan 5, 2017, 10:52:30 PM1/5/17
to weewx-user
:-) 
mwall :-) is this still developing ... just to that topic won't be forgotten.

mwall

unread,
Jan 8, 2017, 7:00:02 PM1/8/17
to weewx-user
On Thursday, January 5, 2017 at 10:52:30 PM UTC-5, Janez Kranjski wrote:
:-) 
mwall :-) is this still developing ... just to that topic won't be forgotten.

hi janez,

i have not forgotten.  but it will probably be another week before i can do this.

m

Janez Kranjski

unread,
Jan 8, 2017, 11:00:36 PM1/8/17
to weewx-user
Super. Take a time ... don't hurry.

mwall

unread,
Jan 21, 2017, 7:55:28 PM1/21/17
to weewx-user
janez,

please try the attached crt 0.19rc1

it implements realtime.xml (except for yesterday hi/lo and record hi/lo) and sunbird

there are still many ambiguities, for example:

which time zone are the sunbird values supposed to be in?
what format are the date/time in sunbird supposed to be?
what precision is required for the values in realtime.xml?
what should be used when a reading is NULL?
are the units supposed to be included or not?
are the units case sensitive?

the two files you posted are not specifications - they are templates.

where is the specification for sunbird?
where is the specification for realtime.xml?

the only specification i know are these two pages:

http://wiki.sandaysoft.com/a/Realtime.txt

http://wiki.sandaysoft.com/a/Webtags

and, as documented in crt.py, they are ambiguous.

in lieu of specifications, you'll have to find a whole bunch of examples, with corner cases, to figure out the ambiguities.

m


crt-0.19rc1.py

Janez Kranjski

unread,
Jan 22, 2017, 9:19:07 AM1/22/17
to weewx-user
I tried ... but ... do I need a "sunbird.txt.tmpl"?

mwall

unread,
Jan 22, 2017, 10:16:41 AM1/22/17
to weewx-user


On Sunday, January 22, 2017 at 9:19:07 AM UTC-5, Janez Kranjski wrote:
I tried ... but ... do I need a "sunbird.txt.tmpl"?

by default, only the realtime (in txt format) will be emitted.

to get realtime.xml or sunbird, you must specify them.  for example, if you want all three files:

[CumulusRealTime]
    ...
    realtime_txt = /var/tmp/realtime.txt
    realtime_xml = /var/tmp/realtime.xml
    sunbird_txt = /var/tmp/sunbird


btw, if the only thing you need is sunbird, you can do that trivially using the standard weewx reporting system (but you'll only get it at every archive interval, not at every loop)

also btw, the actual usefulness of sunbird is questionable - it provides only sunrise, sunset, and the time the data were last updated.  calculating sunrise and sunset is trivial to do, and a timestamp without the rest of the data is of marginal value (once again, just emit a timestamp to file in one of your regular weewx reports).

m

Janez Kranjski

unread,
Jan 23, 2017, 12:04:40 AM1/23/17
to weewx-user
Sorry - but now I don't understand your lines bellow. Until now, I use the convention mentioned on https://github.com/weewx/weewx/wiki/crt (2. Modify weeex.conf).
Your specification mentioned bellow is somewhat different.

Should I try with another filename line?
filename = /var/tmp/sunbird

Bye.



On Sunday, January 22, 2017 at 4:16:41 PM UTC+1, mwall wrote:

to get realtime.xml or sunbird, you must specify them.  for example, if you want all three files:

[CumulusRealTime]
    ...
    realtime_txt = /var/tmp/realtime.txt
    realtime_xml = /var/tmp/realtime.xml
    sunbird_txt = /var/tmp/sunbird


m

mwall

unread,
Jan 23, 2017, 12:37:46 AM1/23/17
to weewx-user
On Monday, January 23, 2017 at 12:04:40 AM UTC-5, Janez Kranjski wrote:
Sorry - but now I don't understand your lines bellow. Until now, I use the convention mentioned on https://github.com/weewx/weewx/wiki/crt (2. Modify weeex.conf).
Your specification mentioned bellow is somewhat different.

Should I try with another filename line?


if you just want to emit a file with the text (non-xml) formatted realtime, then do this:

[CumulusRealTime]
    realtime_txt = /var/tmp/realtime.txt

if you want to emit two files, one in the xml format and the other in txt format, then do this:

[CumulusRealTime]

    realtime_txt = /var/tmp/realtime.txt
    realtime_xml = /var/tmp/realtime.xml


if you just want to emit the sunbird file, then do this:

[CumulusRealTime]
    sunbird_txt = /var/tmp/sunbird

if you want to emit all three, then do this:

[CumulusRealTime]

    realtime_txt = /var/tmp/realtime.txt
    realtime_xml = /var/tmp/realtime.xml
    sunbird_txt = /var/tmp/sunbird


the parameter 'realtime_txt' is a synonym for 'filename'; for backward compatibility, 'filename' is still recognized.

m

Janez Kranjski

unread,
Jan 23, 2017, 2:55:27 AM1/23/17
to weewx-user
Tnx.
Now another problem :-)

Check attached log file (realtime.xml problem).
weewx-mwall.log

mwall

unread,
Jan 23, 2017, 7:48:15 AM1/23/17
to weewx-user
On Monday, January 23, 2017 at 2:55:27 AM UTC-5, Janez Kranjski wrote:
Tnx.
Now another problem :-)

Check attached log file (realtime.xml problem).


please try the attached 0.19rc2

i have not tested with hardware that emits partial packets, so there might be more key errors like that.

one of these days we need to add a 'partial packets' mode to the simulator...

m

 
crt-0.19rc2.py

Janez Kranjski

unread,
Jan 23, 2017, 8:06:40 AM1/23/17
to weewx-user
This time without error in log ... but still without XML file.
And yes, I almost forget - it looks like sunbird.txt works (my colleague (author of Android Weather Station app) said so, I don't have any devices available :-) ).

Bye. So only check why XML file isn't prepared.

mwall

unread,
Jan 23, 2017, 8:15:28 AM1/23/17
to weewx-user
On Monday, January 23, 2017 at 8:06:40 AM UTC-5, Janez Kranjski wrote:
This time without error in log ... but still without XML file.
And yes, I almost forget - it looks like sunbird.txt works (my colleague (author of Android Weather Station app) said so, I don't have any devices available :-) ).

Bye. So only check why XML file isn't prepared.

if you cannot figure it out, then please post the [CumulusRealTime] section of your weewx.conf, and please post the log file from when you start weewx until after a few loop packets.

m

Janez Kranjski

unread,
Jan 23, 2017, 8:45:59 AM1/23/17
to weewx-user
Attached ...

Bye
weewx.log
weewx-part.conf

mwall

unread,
Jan 23, 2017, 8:59:13 AM1/23/17
to weewx-user
please try 0.19rc3


crt-0.19rc3.py

Janez Kranjski

unread,
Jan 23, 2017, 9:49:53 AM1/23/17
to weewx-user
It looks that "realtime.xml" is now on its way :-)

I have to leave now, but I will be back with reports/bugs.
Thank you very much for your time.

Bye

On Monday, January 23, 2017 at 2:59:13 PM UTC+1, mwall wrote:
please try 0.19rc3


Janez Kranjski

unread,
Jan 24, 2017, 4:36:06 AM1/24/17
to weewx-user
 I gave it to my colleague to test. It works, but he has two small remarks:
1.  You can omit "date" and "seconds" in SUNBIRD.TXT in fields where sunrise and sunset are.
So, instead "2017.01.24 16:54:35", it can be "16:54"

2. You can round off some data in REALTIME.XML.

Otherwise, a big thanks.

 

a552...@drdrb.net

unread,
Jan 27, 2017, 11:28:20 AM1/27/17
to weewx-user
Could it also be possible to create the realtimeguages.txt file for the steel gauges?
I like how this add-on creates the files at the Loop Interval.
I have attached the template files for Cumulus 1.9.4 and CumulusMX.

realtimegaugesT.txt
realtimegaugesTMX.txt
Reply all
Reply to author
Forward
0 new messages