[weewx-user] Re: Save reports to a temporary file system

2018-04-08 Thread Andrew Milner
there is also this one:
https://github.com/glennmckechnie/rorpi-raspberrypi/wiki/Rorpi-Home

and you could always move root and everything to a usb hard drive to the 
rpi and just do initial bootload from the sd



On Monday, 9 April 2018 08:47:40 UTC+3, Janez Kranjski wrote:

> After SD card failure, my idea is to change the system to have less writes 
> to SD card. 
> Is this (https://github.com/weewx/weewx/wiki/Minimize-writes-on-SD-cards) 
> still the simplest solution?
>
> AFAIK, I will have to change path */home/weewx* to */etc/weewx* and use 
> *systemctl 
> restart weewx* for restart Weewx.
> Something else?
>

-- 
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.


[weewx-user] Save reports to a temporary file system

2018-04-08 Thread Janez Kranjski
After SD card failure, my idea is to change the system to have less writes 
to SD card. 
Is this (https://github.com/weewx/weewx/wiki/Minimize-writes-on-SD-cards) 
still the simplest solution?

AFAIK, I will have to change path */home/weewx* to */etc/weewx* and use 
*systemctl 
restart weewx* for restart Weewx.
Something else?

-- 
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.


[weewx-user] rtl_433 and acurite 5 n 1

2018-04-08 Thread doug110144

Hi,

I have a 5 n 1 and would like to access it by internet. I have an sdr 
receiver and raspberry pi. I have read I need  rtl_433 fto tune in the 5n1 
signal. I know little programming and looking for a compiled versionn of 
the 433. Some instruction on compiling the source code in cmake would also 
be useful.

Cheers, Doug

-- 
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.


Re: [weewx-user] Re: weewx crashes with error: unpack requires a string of len 104

2018-04-08 Thread vk3anz
Mmmm - I'll have a look to see if there is an issue with the delay setting.

I've had a look at the log file and I can't see any reason why it should 
just stop like that. I fact, how do you know that it *has* stopped? Can you 
do a 'ps' or 'top' to se if the process is still running, or if you are 
using systemd, then do a status on weewx to see what has happened.

As far as I know (and in like with the original title of this thread) if 
there was an error then it should have displayed that and then continued. 
In my (limited) experience, Python code only stops when the program exits 
normally.

Susan

On Saturday, April 7, 2018 at 6:44:11 PM UTC+10, Graham Seward wrote:
>
> Hi Susan
> Your last comment got me to thinking about the loop delay so I reset 
> weewx.conf to a loop delay of 15 secs. It has now been running for 14 hours 
> without a glitch so it looks like I had caused the problem but I’m not sure 
> how. I will leave it as is.
> Thanks 
> Graham 
>
> Sent from my iPad
>
> On 5 Apr 2018, at 03:37, vk3...@gmail.com  wrote:
>
> You are not being a nuisance at all, but it is a bit hard to do 'remote 
> diagnostics'.
>
> The log file would be useful but not the whole thing: just the part a bit 
> before you start weewx until just after it has stopped will be enough.
>
> Where are you setting the loop delay value and can you show us the 
> file/line in question?
>
> Susan
>
> On Thursday, April 5, 2018 at 2:20:53 AM UTC+10, Graham Seward wrote:
>>
>> Hi Susan
>>
>> Regret to say that weewx stopped running again without writing anything 
>> to syslog, messages or user.log. Syslog shows that when weewx starts it is 
>> using the correct version of the driver, so I’m puzzled as to what is going 
>> on. Would you like a copy of the syslog file in it’s entirety to see if 
>> that throws up any clues?
>>
>>  
>>
>> I’m going to run weewx again but with your original driver to see what 
>> happens this time. Incidentally if I set the loop-delay to 60 secs the 
>> program doesn’t run at all – currently set at 30secs. 
>>
>>  
>>
>> Sorry to be a nuisance!
>>
>> Graham
>>
>>  
>>
>> *From:* weewx...@googlegroups.com  *On Behalf 
>> Of *vk3...@gmail.com
>> *Sent:* 04 April 2018 03:50
>> *To:* weewx-user 
>> *Subject:* Re: [weewx-user] Re: weewx crashes with error: unpack 
>> requires a string of len 104
>>
>>  
>>
>> G - too long since I wrote the code and I made a stupid mistake. The 
>> two 'loginf' lines should read
>>
>>  
>>
>> loginf('Bad data: length = {0}'.format(len(rxData)))
>>
>> loginf('Bad data: "{0}"'.format(rxData))
>>
>>  
>>
>> I've attached your file with the correction in it.
>>
>>  
>>
>> Sorry about that.
>>
>>  
>>
>> Susan
>>
>>  
>>
>> -- 
>> 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.
>> 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+...@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.


[weewx-user] Re: Pond.py multi senor watt and temp

2018-04-08 Thread Andrew Milner
1.  replace -max line length with -10 or whatever your max line length 
actually is ie set the amount to go back from the end of the file
2. replace f.readline()[-1] with f.readlines()[-1]

3. google for 'python read last line of text file' and there are several 
possible solutions similar to this one!!





On Monday, 9 April 2018 01:41:55 UTC+3, vigilancewx wrote:

> Thanks for your input Andrew
>
> your additional comments have removed the indentation errors but for some 
> reason weewx.sbd has stopped being populated by pond.py and the modified 
> lines
>
> but again thanks
>
>   
>
> On Saturday, April 7, 2018 at 9:51:39 PM UTC+1, vigilancewx wrote:
>>
>> Hello
>>
>>
>> I have a current cost electricity meter connect to a linux computer via a 
>> usb cable
>>
>> On the linux computer is a script that every 20seconds loggs the watt and 
>> temp readings from the current cost meter to a txt file and RRD file
>>
>>
>> I can generate the RRD graphs into the weewx public_html directory and 
>> display them accrodingly
>>
>>
>> I know that weewx is predominatly for displaying weather data but I would 
>> like weewx to handle the watt data, so I have tried to save the readings 
>> into the weewx.sdb 
>>
>>
>> I found this version of pond.py from the weewx user groups and it works 
>> with no errors
>>
>>
>>
>> Following advice given in the weewx help files I can now display the data 
>> in the various html files display graphs etc
>>
>>
>> I have one problem, pond.py takes the readings from the first line in the 
>> txt file (readings.txt)
>>
>>
>> how do I modify pond.py to take its readings from the last line of the 
>> txt file, because file the last line of my txt file holds the latest data
>>
>>
>> thank you for any help
>>
>>
>> import syslog
>>
>> import weewx
>>
>> from weewx.wxengine import StdService
>>
>>
>> class PondService(StdService):
>>
>> def __init__(self, engine, config_dict):
>>
>> super(PondService, self).__init__(engine, config_dict)
>>
>> d = config_dict.get('PondService', {})
>>
>> self.filename = d.get('filename', '/var/www/html/data/reading.txt')
>>
>> syslog.syslog(syslog.LOG_INFO, "pond: using %s" % self.filename)
>>
>> self.bind(weewx.NEW_ARCHIVE_RECORD, self.read_file)
>>
>>
>> def read_file(self, event):
>>
>> try:
>>
>> with open(self.filename) as f:
>>
>> #value = f.read()
>>
>> line = f.readline()
>>
>> value = line.split(',')
>>
>> syslog.syslog(syslog.LOG_DEBUG, "pond: found value of %s" % value)
>>
>> event.record['ccwatt'] = float(value[0])
>>
>> event.record['cctemp'] = float(value[1])
>>
>> except Exception, e:
>>
>> syslog.syslog(syslog.LOG_ERR, "pond: cannot read value: %s" % e)
>>
>

-- 
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.


[weewx-user] Re: Pond.py multi senor watt and temp

2018-04-08 Thread vigilancewx
Thanks for your input Andrew

your additional comments have removed the indentation errors but for some 
reason weewx.sbd has stopped being populated by pond.py and the modified 
lines

but again thanks

  

On Saturday, April 7, 2018 at 9:51:39 PM UTC+1, vigilancewx wrote:
>
> Hello
>
>
> I have a current cost electricity meter connect to a linux computer via a 
> usb cable
>
> On the linux computer is a script that every 20seconds loggs the watt and 
> temp readings from the current cost meter to a txt file and RRD file
>
>
> I can generate the RRD graphs into the weewx public_html directory and 
> display them accrodingly
>
>
> I know that weewx is predominatly for displaying weather data but I would 
> like weewx to handle the watt data, so I have tried to save the readings 
> into the weewx.sdb 
>
>
> I found this version of pond.py from the weewx user groups and it works 
> with no errors
>
>
>
> Following advice given in the weewx help files I can now display the data 
> in the various html files display graphs etc
>
>
> I have one problem, pond.py takes the readings from the first line in the 
> txt file (readings.txt)
>
>
> how do I modify pond.py to take its readings from the last line of the txt 
> file, because file the last line of my txt file holds the latest data
>
>
> thank you for any help
>
>
> import syslog
>
> import weewx
>
> from weewx.wxengine import StdService
>
>
> class PondService(StdService):
>
> def __init__(self, engine, config_dict):
>
> super(PondService, self).__init__(engine, config_dict)
>
> d = config_dict.get('PondService', {})
>
> self.filename = d.get('filename', '/var/www/html/data/reading.txt')
>
> syslog.syslog(syslog.LOG_INFO, "pond: using %s" % self.filename)
>
> self.bind(weewx.NEW_ARCHIVE_RECORD, self.read_file)
>
>
> def read_file(self, event):
>
> try:
>
> with open(self.filename) as f:
>
> #value = f.read()
>
> line = f.readline()
>
> value = line.split(',')
>
> syslog.syslog(syslog.LOG_DEBUG, "pond: found value of %s" % value)
>
> event.record['ccwatt'] = float(value[0])
>
> event.record['cctemp'] = float(value[1])
>
> except Exception, e:
>
> syslog.syslog(syslog.LOG_ERR, "pond: cannot read value: %s" % e)
>

-- 
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.


[weewx-user] Re: How can I find out why "Outside Humidity" isn't on graph?

2018-04-08 Thread Janez Kranjski
Thank you. Solved :-)
Somehow I failed when I move/rename/copy archive file and "skin.conf" was 
an old one (which was changed by someone :-)).
Great support and super software.

-- 
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.


[weewx-user] Re: extension to calculate rainstorm info: total rainfall, ending time, duration

2018-04-08 Thread Manuel
Hello Rich I have been stealing the second file storm.py and I have this 
error when generating the report: 

Apr  8 02:56:24 raspberrypi weewx[3785]: reportengine: Caught unrecoverable 
exception ingenerator weewx.cheetahgenerator.CheetahGenerator
Apr  8 02:56:24 raspberrypi weewx[3785]:   time data 
'2017-07-05 16:00:00-PST' does not match format '%Y-%m-%d %H:%M:%S-%Z'
Apr  8 02:56:24 raspberrypi weewx[3785]:   Traceback (most 
recent call last):
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/reportengine.py", line 239, in run
Apr  8 02:56:24 raspberrypi weewx[3785]:   obj.start()
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/reportengine.py", line 273, in start
Apr  8 02:56:24 raspberrypi weewx[3785]:   self.run()
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/cheetahgenerator.py", line 158, in run
Apr  8 02:56:24 raspberrypi weewx[3785]:   ngen = 
self.generate(gen_dict[section_name], self.gen_ts)
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/cheetahgenerator.py", line 232, in generate
Apr  8 02:56:24 raspberrypi weewx[3785]:   ngen += 
self.generate(section[subsection], gen_ts)
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/cheetahgenerator.py", line 232, in generate
Apr  8 02:56:24 raspberrypi weewx[3785]:   ngen += 
self.generate(section[subsection], gen_ts)
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/cheetahgenerator.py", line 320, in generate
Apr  8 02:56:24 raspberrypi weewx[3785]:   default_binding)
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/cheetahgenerator.py", line 372, in _getSearchList
Apr  8 02:56:24 raspberrypi weewx[3785]:   searchList += 
obj.get_extension_list(timespan, db_lookup)
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/user/storm.py", line 100, in get_extension_list
Apr  8 02:56:24 raspberrypi weewx[3785]:   StructTime  = 
time.strptime('2017-07-05 16:00:00-PST', '%Y-%m-%d %H:%M:%S-%Z')
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/lib/python2.7/_strptime.py", line 467, in _strptime_time
Apr  8 02:56:24 raspberrypi weewx[3785]:   return 
_strptime(data_string,format)[0]
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/lib/python2.7/_strptime.py", line 325, in _strptime
Apr  8 02:56:24 raspberrypi weewx[3785]:   (data_string, 
format))
Apr  8 02:56:24 raspberrypi weewx[3785]:   ValueError: time 
data '2017-07-0516:00:00-PST' does not match format '%Y-%m-%d %H:%M:%S-%Z'
Apr  8 02:56:24 raspberrypi weewx[3785]:   Generator terminated
Apr  8 02:56:24 raspberrypi weewx[3785]: reportengine: Caught unrecoverable 
exception ingenerator weewx.cheetahgenerator.CheetahGenerator
Apr  8 02:56:24 raspberrypi weewx[3785]:   time data 
'2017-07-05 16:00:00-PS' does not match format '%Y-%m-%d %H:%M:%S-%Z'
Apr  8 02:56:24 raspberrypi weewx[3785]:   Traceback (most 
recent call last):
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/reportengine.py", line 239, in run
Apr  8 02:56:24 raspberrypi weewx[3785]:   obj.start()
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/reportengine.py", line 273, in start
Apr  8 02:56:24 raspberrypi weewx[3785]:   self.run()
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/cheetahgenerator.py", line 158, in run
Apr  8 02:56:24 raspberrypi weewx[3785]:   ngen = 
self.generate(gen_dict[section_name], self.gen_ts)
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/cheetahgenerator.py", line 232, in generate
Apr  8 02:56:24 raspberrypi weewx[3785]:   ngen += 
self.generate(section[subsection], gen_ts)
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/cheetahgenerator.py", line 232, in generate
Apr  8 02:56:24 raspberrypi weewx[3785]:   ngen += 
self.generate(section[subsection], gen_ts)
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/cheetahgenerator.py", line 320, in generate
Apr  8 02:56:24 raspberrypi weewx[3785]:   default_binding)
Apr  8 02:56:24 raspberrypi weewx[3785]: File 
"/usr/share/weewx/weewx/cheetahgenerator.py", line 372, in _getSearchList
Apr  8 02:56:24 raspberrypi weewx[3785]:   searchList += 
obj.get_extension_list(timespan, db_lookup)
Apr  8 02:56:24 raspberrypi weewx[3785]: File 

Re: [weewx-user] Re: WeeWx changing time on Davis Vantage Vue Console?

2018-04-08 Thread Andrew Milner
on the pi set timezone by using raspi_config
or see this thread
http://aryo.lecture.ub.ac.id/configure-timezone-settings-on-raspberry-pi-raspbian-wheezy/


On Sunday, 8 April 2018 19:04:26 UTC+3, Matt wrote:

> Gary,
> I think you're right.  I don't have a local time set.  After some digging 
> I'm stuck at a bigger problem.  
>
> I first did a 
>
> pi@raspberrypi:~ $ sudo raspi-config
> received an error when trying to set the timezone through the gui
>
> tried this too, no luck .  I've also tried updating libraries and 
> dependencies and started all over and get the same errors. Thoughts?
>
> pi@raspberrypi:~ $ sudo dpkg-reconfigure tzdata
> Use of uninitialized value $value in substitution (s///) at 
> /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 1.
> Use of uninitialized value $item in hash element at 
> /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.
> dpkg-query: package 'tzdata' is not installed and no information is 
> available
> Use dpkg --info (= dpkg-deb --info) to examine archive files,
> and dpkg --contents (= dpkg-deb --contents) to list their contents.
> /usr/sbin/dpkg-reconfigure: tzdata is not installed
>
>
> On Wednesday, March 28, 2018 at 3:14:08 PM UTC-7, gjr80 wrote:
>>
>> This sounds like a timezone issue to me. You wouldn't happen to be 7 
>> hours behind GMT would you? What timezone is running on your RPi and what 
>> timezone are you putting in the console? Judging by the log something is 
>> running on GMT (UTC).
>>
>> Gary
>>
>

-- 
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.


[weewx-user] Re: How can I find out why "Outside Humidity" isn't on graph?

2018-04-08 Thread Andrew Milner
1. make sure the skin is trying to create the .png file
2. make sure the log is not showing any errors
3. I presume you meant dayhumidity.png rather than dayhumidity.html


On Sunday, 8 April 2018 18:11:34 UTC+3, Janez Kranjski wrote:

> I forgot to mention, that I change my weather station and server. There 
> were some blackouts in that time, but now everything (except outside 
> humidity) works fine.
> I have checked "backward" - in */var/www/html *I can see 
> *dayhumidity.html* from 27th March (all other files are correct).
> Here is list of files with content "humidity":
>
>
> 
>
>
>
>
>

-- 
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.


Re: [weewx-user] Re: WeeWx changing time on Davis Vantage Vue Console?

2018-04-08 Thread Matt
Gary,
I think you're right.  I don't have a local time set.  After some digging 
I'm stuck at a bigger problem.  

I first did a 

pi@raspberrypi:~ $ sudo raspi-config
received an error when trying to set the timezone through the gui

tried this too, no luck .  I've also tried updating libraries and 
dependencies and started all over and get the same errors. Thoughts?

pi@raspberrypi:~ $ sudo dpkg-reconfigure tzdata
Use of uninitialized value $value in substitution (s///) at 
/usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 1.
Use of uninitialized value $item in hash element at 
/usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.
dpkg-query: package 'tzdata' is not installed and no information is 
available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
/usr/sbin/dpkg-reconfigure: tzdata is not installed


On Wednesday, March 28, 2018 at 3:14:08 PM UTC-7, gjr80 wrote:
>
> This sounds like a timezone issue to me. You wouldn't happen to be 7 hours 
> behind GMT would you? What timezone is running on your RPi and what 
> timezone are you putting in the console? Judging by the log something is 
> running on GMT (UTC).
>
> Gary
>

-- 
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.


[weewx-user] Re: Pond.py multi senor watt and temp

2018-04-08 Thread Andrew Milner
indentation is significant in python

try:

def read_file(self, event):
try:
with open(self.filename) as f:
#  value = f.read()
#  line = f.readline()

f.seek(-max_line_length, os.SEEK_END)
line = f.readline()[-1]

value = line.split(',')
syslog.syslog(syslog.LOG_DEBUG, "pond: found value of %s" % 
value)
event.record['ccwatt'] = float(value[0])


On Sunday, 8 April 2018 15:35:59 UTC+3, vigilancewx wrote:

> Thank you for your reply Andrew
>
> i assume its my error on how i have tried to make the changes to pond py
> now its is generating this error
>
> Apr  8 13:23:37 pi-X2 OWFS[21349]:   
> self.loadServices(config_dict)
> Apr  8 13:23:37 pi-X2 OWFS[21349]: File 
> "/home/weewx/bin/weewx/engine.py", line 141, in loadServices
> Apr  8 13:23:37 pi-X2 OWFS[21349]:   
> self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
> Apr  8 13:23:37 pi-X2 OWFS[21349]: File 
> "/home/weewx/bin/weeutil/weeutil.py", line 1132, in _get_object
> Apr  8 13:23:37 pi-X2 OWFS[21349]:   mod = __import__(module)
> Apr  8 13:23:37 pi-X2 OWFS[21349]: File 
> "/home/weewx/bin/user/pond.py", line 24
> Apr  8 13:23:37 pi-X2 OWFS[21349]:   value = line.split(',')
> Apr  8 13:23:37 pi-X2 OWFS[21349]: ^
> Apr  8 13:23:37 pi-X2 OWFS[21349]:   IndentationError: unindent 
> does not match any outer indentation level
> Apr  8 13:23:37 pi-X2 OWFS[21349]:   Exiting.
>
>
> I have tried to alter pond.py as follows obviously incorrectly could you 
> define were please
>
> thanks
>
> import syslog
> import weewx
> from weewx.wxengine import StdService
>
> class PondService(StdService):
> def __init__(self, engine, config_dict):
> super(PondService, self).__init__(engine, config_dict)
> d = config_dict.get('PondService', {})
> self.filename = d.get('filename', '/var/www/html/data/reading.txt')
> syslog.syslog(syslog.LOG_INFO, "pond: using %s" % self.filename)
> self.bind(weewx.NEW_ARCHIVE_RECORD, self.read_file)
>
> def read_file(self, event):
> try:
> with open(self.filename) as f:
> #value = f.read()
> ###line = f.readline()
>
> f.seek(-max_line_length, os.SEEK_END)
> line = f.readline()[-1]
>
> value = line.split(',')
> syslog.syslog(syslog.LOG_DEBUG, "pond: found value of %s" % 
> value)
> event.record['ccwatt'] = float(value[0])
> event.record['cctemp'] = float(value[1])
> except Exception, e:
> syslog.syslog(syslog.LOG_ERR, "pond: cannot read value: %s" % 
> e)
>
>
>
>
>
>
>
> On Saturday, April 7, 2018 at 9:51:39 PM UTC+1, vigilancewx wrote:
>>
>> Hello
>>
>>
>> I have a current cost electricity meter connect to a linux computer via a 
>> usb cable
>>
>> On the linux computer is a script that every 20seconds loggs the watt and 
>> temp readings from the current cost meter to a txt file and RRD file
>>
>>
>> I can generate the RRD graphs into the weewx public_html directory and 
>> display them accrodingly
>>
>>
>> I know that weewx is predominatly for displaying weather data but I would 
>> like weewx to handle the watt data, so I have tried to save the readings 
>> into the weewx.sdb 
>>
>>
>> I found this version of pond.py from the weewx user groups and it works 
>> with no errors
>>
>>
>>
>> Following advice given in the weewx help files I can now display the data 
>> in the various html files display graphs etc
>>
>>
>> I have one problem, pond.py takes the readings from the first line in the 
>> txt file (readings.txt)
>>
>>
>> how do I modify pond.py to take its readings from the last line of the 
>> txt file, because file the last line of my txt file holds the latest data
>>
>>
>> thank you for any help
>>
>>
>> import syslog
>>
>> import weewx
>>
>> from weewx.wxengine import StdService
>>
>>
>> class PondService(StdService):
>>
>> def __init__(self, engine, config_dict):
>>
>> super(PondService, self).__init__(engine, config_dict)
>>
>> d = config_dict.get('PondService', {})
>>
>> self.filename = d.get('filename', '/var/www/html/data/reading.txt')
>>
>> syslog.syslog(syslog.LOG_INFO, "pond: using %s" % self.filename)
>>
>> self.bind(weewx.NEW_ARCHIVE_RECORD, self.read_file)
>>
>>
>> def read_file(self, event):
>>
>> try:
>>
>> with open(self.filename) as f:
>>
>> #value = f.read()
>>
>> line = f.readline()
>>
>> value = line.split(',')
>>
>> syslog.syslog(syslog.LOG_DEBUG, "pond: found value of %s" % value)
>>
>> event.record['ccwatt'] = float(value[0])
>>
>> event.record['cctemp'] = float(value[1])
>>
>> except Exception, e:
>>
>> syslog.syslog(syslog.LOG_ERR, "pond: cannot read value: %s" % e)
>>
>

-- 
You received this message because 

[weewx-user] Re: How can I find out why "Outside Humidity" isn't on graph?

2018-04-08 Thread Andrew Milner
the graph does not seem to have been generated since 27th March so I would 
check that it is still included in your skin and also check the log to see 
if any errors are being thrown



On Sunday, 8 April 2018 15:16:34 UTC+3, Janez Kranjski wrote:

> I checked and I can see data for Outside Humidity in the database.
>
>
> 
>
>
> But as you can see on http://izo.amebis.si, there is something wrong on 
> the graph. 
>
> How can I find out what is wrong?
>

-- 
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.


[weewx-user] Re: Pond.py multi senor watt and temp

2018-04-08 Thread vigilancewx
Thank you for your reply Andrew

i assume its my error on how i have tried to make the changes to pond py
now its is generating this error

Apr  8 13:23:37 pi-X2 OWFS[21349]:   
self.loadServices(config_dict)
Apr  8 13:23:37 pi-X2 OWFS[21349]: File 
"/home/weewx/bin/weewx/engine.py", line 141, in loadServices
Apr  8 13:23:37 pi-X2 OWFS[21349]:   
self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
Apr  8 13:23:37 pi-X2 OWFS[21349]: File 
"/home/weewx/bin/weeutil/weeutil.py", line 1132, in _get_object
Apr  8 13:23:37 pi-X2 OWFS[21349]:   mod = __import__(module)
Apr  8 13:23:37 pi-X2 OWFS[21349]: File 
"/home/weewx/bin/user/pond.py", line 24
Apr  8 13:23:37 pi-X2 OWFS[21349]:   value = line.split(',')
Apr  8 13:23:37 pi-X2 OWFS[21349]: ^
Apr  8 13:23:37 pi-X2 OWFS[21349]:   IndentationError: unindent 
does not match any outer indentation level
Apr  8 13:23:37 pi-X2 OWFS[21349]:   Exiting.


I have tried to alter pond.py as follows obviously incorrectly could you 
define were please

thanks

import syslog
import weewx
from weewx.wxengine import StdService

class PondService(StdService):
def __init__(self, engine, config_dict):
super(PondService, self).__init__(engine, config_dict)
d = config_dict.get('PondService', {})
self.filename = d.get('filename', '/var/www/html/data/reading.txt')
syslog.syslog(syslog.LOG_INFO, "pond: using %s" % self.filename)
self.bind(weewx.NEW_ARCHIVE_RECORD, self.read_file)

def read_file(self, event):
try:
with open(self.filename) as f:
#value = f.read()
###line = f.readline()

f.seek(-max_line_length, os.SEEK_END)
line = f.readline()[-1]

value = line.split(',')
syslog.syslog(syslog.LOG_DEBUG, "pond: found value of %s" % 
value)
event.record['ccwatt'] = float(value[0])
event.record['cctemp'] = float(value[1])
except Exception, e:
syslog.syslog(syslog.LOG_ERR, "pond: cannot read value: %s" % e)







On Saturday, April 7, 2018 at 9:51:39 PM UTC+1, vigilancewx wrote:
>
> Hello
>
>
> I have a current cost electricity meter connect to a linux computer via a 
> usb cable
>
> On the linux computer is a script that every 20seconds loggs the watt and 
> temp readings from the current cost meter to a txt file and RRD file
>
>
> I can generate the RRD graphs into the weewx public_html directory and 
> display them accrodingly
>
>
> I know that weewx is predominatly for displaying weather data but I would 
> like weewx to handle the watt data, so I have tried to save the readings 
> into the weewx.sdb 
>
>
> I found this version of pond.py from the weewx user groups and it works 
> with no errors
>
>
>
> Following advice given in the weewx help files I can now display the data 
> in the various html files display graphs etc
>
>
> I have one problem, pond.py takes the readings from the first line in the 
> txt file (readings.txt)
>
>
> how do I modify pond.py to take its readings from the last line of the txt 
> file, because file the last line of my txt file holds the latest data
>
>
> thank you for any help
>
>
> import syslog
>
> import weewx
>
> from weewx.wxengine import StdService
>
>
> class PondService(StdService):
>
> def __init__(self, engine, config_dict):
>
> super(PondService, self).__init__(engine, config_dict)
>
> d = config_dict.get('PondService', {})
>
> self.filename = d.get('filename', '/var/www/html/data/reading.txt')
>
> syslog.syslog(syslog.LOG_INFO, "pond: using %s" % self.filename)
>
> self.bind(weewx.NEW_ARCHIVE_RECORD, self.read_file)
>
>
> def read_file(self, event):
>
> try:
>
> with open(self.filename) as f:
>
> #value = f.read()
>
> line = f.readline()
>
> value = line.split(',')
>
> syslog.syslog(syslog.LOG_DEBUG, "pond: found value of %s" % value)
>
> event.record['ccwatt'] = float(value[0])
>
> event.record['cctemp'] = float(value[1])
>
> except Exception, e:
>
> syslog.syslog(syslog.LOG_ERR, "pond: cannot read value: %s" % e)
>

-- 
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.


[weewx-user] Re: Lets see if I can get a response to this post. Installing new skins

2018-04-08 Thread Greg from Oz
Yes it is a great skin.
What are you running it on? What operating system?
I use that skin abut I have changed it 
slightly. https://weather.ubeaut.work/

I use mysql and not sqlite running on Ubuntu

You also have to add an extra column in the database.
Below is a script I did August 2017 so I could remember how to do it again:
#!/bin/bash
apt install python-dateutil python-ephem
echo this is to get Responsive skin to work.
wget https://github.com/dcapslock/weewx-responsive-skin/archive/master.zip
echo if you use responsive skin you have to add another column otherwise 
you get lots of errors
echo use mysql weewx database
echo alter table archive add column appTemp REAL;
echo copy aussearch.py to /usr/share/weewx/user
echo mkdir /var/lib/weewx/aussearch
echo uncomment  search_list_extensions = user.aussearch.ausutils in 
skin.conf

Don't know if that will help or not.


On Saturday, 7 April 2018 21:36:30 UTC+10, Kimberly Olsen wrote:
>
> I am very interested in a skin I saw at Carlingford weather 
> https://carlingfordweather.sydney/ but I can't follow his instructions, 
> nor those in the weewx docs. 
>
> His instructions are
>
> Welcome to Sydney! To install a report skin in weewx, you just need to 
> grab the skin and copy to the skins directory under weewx config. See 
> http://www.weewx.com/docs/customizing.htm#_The_standard_reporting_service,_StdReport___
>  for 
> some loose instructions around this.
>
>  
>
> You can grab the ZIP of the skin via 
> https://github.com/dcapslock/weewx-responsive-skin/archive/master.zip
>
>  
>
> If you wish to use the Australian extensions for forecast etc. follow the 
> instructions at 
> https://github.com/dcapslock/weewx-responsive-skin/wiki/Australian-%27Search%27-Extensions
>
>  
>
> I hope that helps.
>
> I downloaded the ZIP and extracted it to downloads and attempted to move 
> it to /etc/weewx/skins but I get permission denied. I attempted to extract 
> to the same folder with the same result. The weewx instructions are not 
> helpful to me.
>
> I'm not sure what I am doing wrong
>
> KImberly
>

-- 
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.


[weewx-user] How can I find out why "Outside Humidity" isn't on graph?

2018-04-08 Thread Janez Kranjski


I checked and I can see data for Outside Humidity in the database.




But as you can see on http://izo.amebis.si, there is something wrong on 
the graph. 

How can I find out what is wrong?

-- 
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.


[weewx-user] Re: Error reading lock file /etc/weewx/.weewx.conf.swp: Not enough data read

2018-04-08 Thread Kimberly Olsen
Hi Glenn


Yep did all of that. No sign of a swap file. I edited weewx.conf and all is 
fine

K

On Saturday, 7 April 2018 12:48:18 UTC+10, Kimberly Olsen wrote:
>
> I've been attempting to get ftp working this morning and suddenly when 
> attempting to edit weewx.conf, I get the message below
>
> This is when I am ssh-ing in from my Mac.
> When I attempt to edit the file directly on the pi, I cannot save it
>
> Any ideas ?
>
> Error reading lock file /etc/weewx/.weewx.conf.swp: Not enough data read 
>

-- 
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.


Re: [weewx-user] Re: Error reading lock file /etc/weewx/.weewx.conf.swp: Not enough data read

2018-04-08 Thread Andrew Milner
if you are working on a local network there should be no noticeable lag at 
all when editing a file - perhaps you should investigate the cause of the 
lag.

do ensure all your rpi sw is up to date though

i use putty to ssh into all my pis and pizeros - and have never had an 
issue with lag even when weewx is running together with web server and 
MySQL or a gui is running to display on a touchscreen - never any issues at 
all, although on two of the rpi's I do use a hard disk rather than the sd.



On Sunday, 8 April 2018 08:45:59 UTC+3, Glenn McKechnie wrote:

> Apparently an older version of nano would return that error at 
> seemingly random times, possibly due to file corruption. 
> If you were suffering extreme lag in the connection then perhaps it is 
> related to that. 
> Check your version of nano, or update it if you feel it's an older one. 
> I really can't help much more with nano as I don't use it. 
>
> vi (vim) 
> In the absence of a suitable user config file, the default action is 
> to place it in the same directory as the file you are editiing, so in 
> this case it would be in /etc/weewx 
> If you ignore the lock file warning and decide to edit the file 
> anyway, you'll create another swp file - ending as .swo . Rinse repeat 
> for the next letter. 
> if vi is giving no clues about the swap files location then try using 
> find. 
>
> sudo find /etc/weewx -name *.sw[nop] 
> If that fails to return anything, broaden the search to... 
> sudo find / -name *.sw[nop] 
>
>
> Cheers 
>  Glenn 
>
> rorpi - read only raspberry pi & various weewx addons 
> https://github.com/glennmckechnie 
>
>
> On 8 April 2018 at 14:16, Kimberly Olsen  > wrote: 
> > Glenn, 
> > 
> > I can see no swap file despite vi insisting there is. No amount of ls 
> -la 
> > will find one 
> > 
> > K 
> > 
> > On Saturday, 7 April 2018 12:48:18 UTC+10, Kimberly Olsen wrote: 
> >> 
> >> I've been attempting to get ftp working this morning and suddenly when 
> >> attempting to edit weewx.conf, I get the message below 
> >> 
> >> This is when I am ssh-ing in from my Mac. 
> >> When I attempt to edit the file directly on the pi, I cannot save it 
> >> 
> >> Any ideas ? 
> >> 
> >> Error reading lock file /etc/weewx/.weewx.conf.swp: Not enough data 
> read 
> > 
> > -- 
> > 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 . 
> > 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.