Re: [weewx-user] Help debugging alarm.py

2017-02-13 Thread Brent Phillips
Thanks… it’s running ok as a service, but would like to do a bit more 
debugging… It seemed near the bottom of the module there are some instructions 
on running stand alone for testing.  But if not possible, then will ignore that 
bit.  

if __name__ == '__main__':
"""This section is used for testing the code. “”"




> On Feb 13, 2017, at 8:24 PM, Thomas Keffer  wrote:
> 
> The "alarm" example is intended to be run as a service within weewx. The 
> assignment to "None" only happens if you try to run alarm as a standalone 
> program.
> 
> Follow the instructions at the top of the file alarm.py. It will cause weewx 
> to load it and run it as a service.
> 
> -tk
> 
> On Mon, Feb 13, 2017 at 2:04 PM, Brent Phillips  > wrote:
> Hi trying to test Alarm.py (version = 3.6.2)
> 
> I cannot seem to get this running.. it does not like that the "engine" is set 
> to None on line 209 in alarm.py, how can I get this working?
> 
> >engine = None
> alarm = MyAlarm(engine, config_dict)
> 
> Here is the traceback:
> 
> root@raspberrypi_weather:/home/weewx/bin/user# python alarm.py 
> ../../weewx.conf 
> 
> Traceback (most recent call last):
> 
>   File "alarm.py", line 210, in 
> 
> alarm = MyAlarm(engine, config_dict)
> 
>   File "alarm.py", line 93, in __init__
> 
> self.bind(weewx.NEW_ARCHIVE_RECORD, self.newArchiveRecord)# NOTE 1
> 
>   File "/home/weewx/bin/weewx/engine.py", line 279, in bind
> 
> self.engine.bind(event_type, callback)
> 
> AttributeError: 'NoneType' object has no attribute 'bind'
> 
> 
> -- 
> 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 a topic in the Google 
> Groups "weewx-user" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/weewx-user/ABc64bFdxh0/unsubscribe 
> .
> To unsubscribe from this group and all its topics, 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.


Re: [weewx-user] Help debugging alarm.py

2017-02-13 Thread Thomas Keffer
The "alarm" example is intended to be run as a service within weewx. The
assignment to "None" only happens if you try to run alarm as a standalone
program.

Follow the instructions at the top of the file alarm.py. It will cause
weewx to load it and run it as a service.

-tk

On Mon, Feb 13, 2017 at 2:04 PM, Brent Phillips 
wrote:

> Hi trying to test Alarm.py (version = 3.6.2)
>
> I cannot seem to get this running.. it does not like that the "engine" is
> set to None on line 209 in alarm.py, how can I get this working?
>
> >engine = None
> alarm = MyAlarm(engine, config_dict)
>
> Here is the traceback:
>
> root@raspberrypi_weather:/home/weewx/bin/user# python alarm.py
> ../../weewx.conf
>
> Traceback (most recent call last):
>
>   File "alarm.py", line 210, in 
>
> alarm = MyAlarm(engine, config_dict)
>
>   File "alarm.py", line 93, in __init__
>
> self.bind(weewx.NEW_ARCHIVE_RECORD, self.newArchiveRecord)# NOTE 1
>
>   File "/home/weewx/bin/weewx/engine.py", line 279, in bind
>
> self.engine.bind(event_type, callback)
>
> AttributeError: 'NoneType' object has no attribute 'bind'
>
> --
> 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.


[weewx-user] Help debugging alarm.py

2017-02-13 Thread Brent Phillips
Hi trying to test Alarm.py (version = 3.6.2)

I cannot seem to get this running.. it does not like that the "engine" is 
set to None on line 209 in alarm.py, how can I get this working?

>engine = None
alarm = MyAlarm(engine, config_dict)

Here is the traceback:

root@raspberrypi_weather:/home/weewx/bin/user# python alarm.py 
../../weewx.conf 

Traceback (most recent call last):

  File "alarm.py", line 210, in 

alarm = MyAlarm(engine, config_dict)

  File "alarm.py", line 93, in __init__

self.bind(weewx.NEW_ARCHIVE_RECORD, self.newArchiveRecord)# NOTE 1

  File "/home/weewx/bin/weewx/engine.py", line 279, in bind

self.engine.bind(event_type, callback)

AttributeError: 'NoneType' object has no attribute 'bind'

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