[weewx-user] Re: How to revive 'frozen' WeeWX?

2023-10-17 Thread Ton vanN
Vince,
The results of the suggested checks.

*raspberrypi9*:~ $ sudo du -sm /var/log
25977   /var/log
*raspberrypi9:~ $ *sudo du -sm /tmp
1   /tmp
*raspberrypi9:~ $* sudo du -sm /home/pi
53  /home/pi
*raspberrypi9:~ $* sudo du -sm /var/tmp
1   /var/tmp

IMHO contents of checked files are minimal 
Wondering why /dev/root full, with this Raspberry only running WeeWX plus 2 
auxiliary Python-scripts (sized 2KB and 1KB), serving periodic upload of 
weewx.sdb to a remote, backup server

Guessing/speculation:
might expansion of the file system (via raspi-config) have had some effects?
Op maandag 16 oktober 2023 om 20:58:56 UTC+2 schreef vince:

> Your / partition is full. You have 29G Size and 29G Used and 0 
> Available.
>
> *raspberrypi9:~ $* df -h
> Bestandssysteem Grootte Gebruikt Besch Geb% Aangekoppeld op
> /dev/root   29G  29G 0 100% /
> devtmpfs   430M0  430M   0% /dev
> tmpfs  462M0  462M   0% /dev/shm
> tmpfs  462M  47M  415M  11% /run
> tmpfs  5,0M 4,0K  5,0M   1% /run/lock
> tmpfs  462M0  462M   0% /sys/fs/cgroup
> /dev/mmcblk0p1 253M  49M  204M  20% /boot
> tmpfs   93M0   93M   0% /run/user/1000
>
> Check your /var/log partition to see what its size is:
>
> sudo du -sm /var/log
>
> If it is not many GB, check your /home/pi and /tmp and /var/tmp 
> directories the same way.
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/2311e7cb-34e4-40f2-a659-5463b414dffcn%40googlegroups.com.


Re: [weewx-user] Re: How to revive 'frozen' WeeWX?

2023-10-17 Thread Tom Keffer
The "-m" option to du means that sizes are in *megabytes*. Your /var/log
directory has 26 *gigabytes* in it.

On Tue, Oct 17, 2023 at 2:12 AM Ton vanN  wrote:

> Vince,
> The results of the suggested checks.
>
> *raspberrypi9*:~ $ sudo du -sm /var/log
> 25977   /var/log
> *raspberrypi9:~ $ *sudo du -sm /tmp
> 1   /tmp
> *raspberrypi9:~ $* sudo du -sm /home/pi
> 53  /home/pi
> *raspberrypi9:~ $* sudo du -sm /var/tmp
> 1   /var/tmp
>
> IMHO contents of checked files are minimal 
> Wondering why /dev/root full, with this Raspberry only running WeeWX plus
> 2 auxiliary Python-scripts (sized 2KB and 1KB), serving periodic upload of
> weewx.sdb to a remote, backup server
>
> Guessing/speculation:
> might expansion of the file system (via raspi-config) have had some
> effects?
> Op maandag 16 oktober 2023 om 20:58:56 UTC+2 schreef vince:
>
>> Your / partition is full. You have 29G Size and 29G Used and 0
>> Available.
>>
>> *raspberrypi9:~ $* df -h
>> Bestandssysteem Grootte Gebruikt Besch Geb% Aangekoppeld op
>> /dev/root   29G  29G 0 100% /
>> devtmpfs   430M0  430M   0% /dev
>> tmpfs  462M0  462M   0% /dev/shm
>> tmpfs  462M  47M  415M  11% /run
>> tmpfs  5,0M 4,0K  5,0M   1% /run/lock
>> tmpfs  462M0  462M   0% /sys/fs/cgroup
>> /dev/mmcblk0p1 253M  49M  204M  20% /boot
>> tmpfs   93M0   93M   0% /run/user/1000
>>
>> Check your /var/log partition to see what its size is:
>>
>> sudo du -sm /var/log
>>
>> If it is not many GB, check your /home/pi and /tmp and /var/tmp
>> directories the same way.
>>
>>
>> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/2311e7cb-34e4-40f2-a659-5463b414dffcn%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEDDJ%2BPczj6Do6%3DuqBiK0X-ej8b80mLwZU_1Qgjzq0NJug%40mail.gmail.com.


[weewx-user] Re: Cannot get weewx + gw1000 working

2023-10-17 Thread Dale Chatham
Is it possible to get an help here?

On Thursday, October 12, 2023 at 9:30:22 PM UTC-5 Dale Chatham wrote:

> I blew it away and started over.
>
> Installed weewx according to: https://weewx.com/docs/redhat.htm Simulator 
> worked fine.
>
> Inst alled Ecowitt Gateway servier according to: 
> https://github.com/gjr80/weewx-gw1000/blob/master/readme.txt
>
> Ran PYTHONPATH=/usr/share/weewx python -m user.gw1000 --test-driver from 
> the above file.
>
> I get this error: 
> Using configuration file /etc/weewx/weewx.conf
>
> Unable to connect to device: Failed to obtain response to command 
> 'CMD_READ_FIRMWARE_VERSION' after 3 attempts
>
> Things to check include that the correct device IP address is being 
> used,
> the device is powered on and the device is not otherwise disconnected 
> from
> the local network.
>
> I used telnet to connect to the IP and port listed in weewx.conf:
> driver = user.gw1000
> ip_address = 192.168.50.41
> port = 45000
>
> I get a connection, but canot get a response to anyting I type (I have no 
> idea if/what should be enteed to get a response.
>
>
>
> On Wednesday, October 11, 2023 at 6:13:20 AM UTC-5 gjr80 wrote:
>
>> I'm not sure what you are trying to do. The link you provided uses a 
>> custom WeeWX data service to parse a text file from the Ecowitt device, but 
>> the log extract you provided contains errors relating to the Ecowitt 
>> gateway driver  which uses the 
>> Ecowitt gateway device API to read data from the Ecowitt gateway device. 
>> You need to choose one method or the other, not both. If your intent is to 
>> utilise the linked page in your original post then you should uninstall the 
>> Ecowitt gateway driver.
>>
>> Gary
>> On Wednesday, 11 October 2023 at 08:41:26 UTC+10 dale.c...@gmail.com 
>> wrote:
>>
>>> Following these instructions:
>>>
>>> https://www.cougar.eu.com/useful-guides/weewx-guides/rasberry-pi/add-ecowitt/modify-weewx.html
>>>
>>> Directory in /var/www/html/weewx/uploads is filling with data, so the 
>>> upload data part is working.  
>>>
>>>
>>>
>>> Here is the pertinent log entries:
>>>
>>> Oct 10 17:37:23 fedora-workstation python3[49897]: weewx[49897] DEBUG 
>>> user.gw1000: Invalid response to attempt 2 to send command 
>>> 'CMD_READ_FIRMWARE_VERSION': Invalid checksum in API response. Expected 
>>> '136' (0x88), received '51' (0x33).
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] DEBUG 
>>> user.gw1000: Invalid response to attempt 3 to send command 
>>> 'CMD_READ_FIRMWARE_VERSION': Invalid checksum in API response. Expected 
>>> '136' (0x88), received '51' (0x33).
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] ERROR 
>>> user.gw1000: Failed to obtain response to command 
>>> 'CMD_READ_FIRMWARE_VERSION' after 3 attempts
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] ERROR 
>>> weewx.engine: Import of driver failed: Failed to obtain response to command 
>>> 'CMD_READ_FIRMWARE_VERSION' after 3 attempts (>> 'user.gw1000.GWIOError'>)
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] CRITICAL 
>>> weewx.engine:   Traceback (most recent call last):
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] CRITICAL 
>>> weewx.engine: File "/usr/share/weewx/weewx/engine.py", line 
>>> 119, in setupStation
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] CRITICAL 
>>> weewx.engine:   self.console = loader_function(config_dict, 
>>> self)
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] CRITICAL 
>>> weewx.engine:  
>>> ^^
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] CRITICAL 
>>> weewx.engine: File "/usr/share/weewx/user/gw1000.py", line 
>>> 1700, in loader
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] CRITICAL 
>>> weewx.engine:   return GatewayDriver(**config_dict[DRIVER_NAME])
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] CRITICAL 
>>> weewx.engine:  ^
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] CRITICAL 
>>> weewx.engine: File "/usr/share/weewx/user/gw1000.py", line 
>>> 2311, in __init__
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] CRITICAL 
>>> weewx.engine:   super(GatewayDriver, self).__init__(**stn_dict)
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] CRITICAL 
>>> weewx.engine: File "/usr/share/weewx/user/gw1000.py", line 
>>> 1014, in __init__
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] CRITICAL 
>>> weewx.engine:   self.collector = 
>>> GatewayCollector(ip_address=self.ip_address,
>>> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] CRITICAL 
>>> weewx.en

[weewx-user] Re: Cannot get weewx + gw1000 working

2023-10-17 Thread Dale Chatham
Another data point:

nmap -sV -p 1-65535 192.168.50.41
Starting Nmap 7.93 ( https://nmap.org ) at 2023-10-17 06:51 CDT
Nmap scan report for ecowitt-weather (192.168.50.41)
Host is up (0.0069s latency).
Not shown: 65533 closed tcp ports (reset)
PORT  STATE SERVICE VERSION
80/tcpopen  nagios-nsca Nagios NSCA
45000/tcp open  asmp?
MAC Address: BC:FF:4D:1C:C0:69 (Espressif)

It appears the port is open on the access point, but it's not answering.  
Any ideas?


On Tuesday, October 17, 2023 at 6:32:48 AM UTC-5 Dale Chatham wrote:

> Is it possible to get an help here?
>
> On Thursday, October 12, 2023 at 9:30:22 PM UTC-5 Dale Chatham wrote:
>
>> I blew it away and started over.
>>
>> Installed weewx according to: https://weewx.com/docs/redhat.htm 
>> Simulator worked fine.
>>
>> Inst alled Ecowitt Gateway servier according to: 
>> https://github.com/gjr80/weewx-gw1000/blob/master/readme.txt
>>
>> Ran PYTHONPATH=/usr/share/weewx python -m user.gw1000 --test-driver from 
>> the above file.
>>
>> I get this error: 
>> Using configuration file /etc/weewx/weewx.conf
>>
>> Unable to connect to device: Failed to obtain response to command 
>> 'CMD_READ_FIRMWARE_VERSION' after 3 attempts
>>
>> Things to check include that the correct device IP address is being 
>> used,
>> the device is powered on and the device is not otherwise disconnected 
>> from
>> the local network.
>>
>> I used telnet to connect to the IP and port listed in weewx.conf:
>> driver = user.gw1000
>> ip_address = 192.168.50.41
>> port = 45000
>>
>> I get a connection, but canot get a response to anyting I type (I have no 
>> idea if/what should be enteed to get a response.
>>
>>
>>
>> On Wednesday, October 11, 2023 at 6:13:20 AM UTC-5 gjr80 wrote:
>>
>>> I'm not sure what you are trying to do. The link you provided uses a 
>>> custom WeeWX data service to parse a text file from the Ecowitt device, but 
>>> the log extract you provided contains errors relating to the Ecowitt 
>>> gateway driver  which uses the 
>>> Ecowitt gateway device API to read data from the Ecowitt gateway device. 
>>> You need to choose one method or the other, not both. If your intent is to 
>>> utilise the linked page in your original post then you should uninstall the 
>>> Ecowitt gateway driver.
>>>
>>> Gary
>>> On Wednesday, 11 October 2023 at 08:41:26 UTC+10 dale.c...@gmail.com 
>>> wrote:
>>>
 Following these instructions:

 https://www.cougar.eu.com/useful-guides/weewx-guides/rasberry-pi/add-ecowitt/modify-weewx.html

 Directory in /var/www/html/weewx/uploads is filling with data, so the 
 upload data part is working.  



 Here is the pertinent log entries:

 Oct 10 17:37:23 fedora-workstation python3[49897]: weewx[49897] DEBUG 
 user.gw1000: Invalid response to attempt 2 to send command 
 'CMD_READ_FIRMWARE_VERSION': Invalid checksum in API response. Expected 
 '136' (0x88), received '51' (0x33).
 Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] DEBUG 
 user.gw1000: Invalid response to attempt 3 to send command 
 'CMD_READ_FIRMWARE_VERSION': Invalid checksum in API response. Expected 
 '136' (0x88), received '51' (0x33).
 Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] ERROR 
 user.gw1000: Failed to obtain response to command 
 'CMD_READ_FIRMWARE_VERSION' after 3 attempts
 Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] ERROR 
 weewx.engine: Import of driver failed: Failed to obtain response to 
 command 
 'CMD_READ_FIRMWARE_VERSION' after 3 attempts (>>> 'user.gw1000.GWIOError'>)
 Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] 
 CRITICAL weewx.engine:   Traceback (most recent call last):
 Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] 
 CRITICAL weewx.engine: File 
 "/usr/share/weewx/weewx/engine.py", 
 line 119, in setupStation
 Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] 
 CRITICAL weewx.engine:   self.console = 
 loader_function(config_dict, self)
 Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] 
 CRITICAL weewx.engine:  
 ^^
 Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] 
 CRITICAL weewx.engine: File "/usr/share/weewx/user/gw1000.py", 
 line 1700, in loader
 Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] 
 CRITICAL weewx.engine:   return 
 GatewayDriver(**config_dict[DRIVER_NAME])
 Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] 
 CRITICAL weewx.engine:  
 ^
 Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] 
 CRITICAL weewx.engine: F

[weewx-user] Re: Cannot get weewx + gw1000 working

2023-10-17 Thread Dale Chatham
Yet another data point:

python -m user.gw1000 --test-service --debug=5 --ip-address=192.168.50.41 
--port=45000
Using configuration file /etc/weewx/weewx.conf
debug level is '5'

IP address obtained from command line options
Port number obtained from command line options
Battery state filtering is 'False' (using the default)
Traceback (most recent call last):
  File "", line 198, in _run_module_as_main
  File "", line 88, in _run_code
  File "/usr/share/weewx/user/gw1000.py", line 8229, in 
main()
  File "/usr/share/weewx/user/gw1000.py", line 8225, in main
direct_gw.process_options()
  File "/usr/share/weewx/user/gw1000.py", line 6745, in process_options
self.test_service()
  File "/usr/share/weewx/user/gw1000.py", line 8047, in test_service
engine = weewx.engine.StdEngine(config)
 ^^
  File "/usr/share/weewx/weewx/engine.py", line 93, in __init__
self.loadServices(config_dict)
  File "/usr/share/weewx/weewx/engine.py", line 161, in loadServices
obj = weeutil.weeutil.get_object(svc)(self, config_dict)
  ^^
  File "/usr/share/weewx/user/gw1000.py", line 1389, in __init__
loginf(' field map is %s' % natural_sort_dict(self.field_map))
  ^^
AttributeError: 'GatewayService' object has no attribute 'field_map'


On Tuesday, October 17, 2023 at 8:08:00 AM UTC-5 Dale Chatham wrote:

> Another data point:
>
> nmap -sV -p 1-65535 192.168.50.41
> Starting Nmap 7.93 ( https://nmap.org ) at 2023-10-17 06:51 CDT
> Nmap scan report for ecowitt-weather (192.168.50.41)
> Host is up (0.0069s latency).
> Not shown: 65533 closed tcp ports (reset)
> PORT  STATE SERVICE VERSION
> 80/tcpopen  nagios-nsca Nagios NSCA
> 45000/tcp open  asmp?
> MAC Address: BC:FF:4D:1C:C0:69 (Espressif)
>
> It appears the port is open on the access point, but it's not answering.  
> Any ideas?
>
>
> On Tuesday, October 17, 2023 at 6:32:48 AM UTC-5 Dale Chatham wrote:
>
>> Is it possible to get an help here?
>>
>> On Thursday, October 12, 2023 at 9:30:22 PM UTC-5 Dale Chatham wrote:
>>
>>> I blew it away and started over.
>>>
>>> Installed weewx according to: https://weewx.com/docs/redhat.htm 
>>> Simulator worked fine.
>>>
>>> Inst alled Ecowitt Gateway servier according to: 
>>> https://github.com/gjr80/weewx-gw1000/blob/master/readme.txt
>>>
>>> Ran PYTHONPATH=/usr/share/weewx python -m user.gw1000 --test-driver from 
>>> the above file.
>>>
>>> I get this error: 
>>> Using configuration file /etc/weewx/weewx.conf
>>>
>>> Unable to connect to device: Failed to obtain response to command 
>>> 'CMD_READ_FIRMWARE_VERSION' after 3 attempts
>>>
>>> Things to check include that the correct device IP address is being 
>>> used,
>>> the device is powered on and the device is not otherwise 
>>> disconnected from
>>> the local network.
>>>
>>> I used telnet to connect to the IP and port listed in weewx.conf:
>>> driver = user.gw1000
>>> ip_address = 192.168.50.41
>>> port = 45000
>>>
>>> I get a connection, but canot get a response to anyting I type (I have 
>>> no idea if/what should be enteed to get a response.
>>>
>>>
>>>
>>> On Wednesday, October 11, 2023 at 6:13:20 AM UTC-5 gjr80 wrote:
>>>
 I'm not sure what you are trying to do. The link you provided uses a 
 custom WeeWX data service to parse a text file from the Ecowitt device, 
 but 
 the log extract you provided contains errors relating to the Ecowitt 
 gateway driver  which uses the 
 Ecowitt gateway device API to read data from the Ecowitt gateway device. 
 You need to choose one method or the other, not both. If your intent is to 
 utilise the linked page in your original post then you should uninstall 
 the 
 Ecowitt gateway driver.

 Gary
 On Wednesday, 11 October 2023 at 08:41:26 UTC+10 dale.c...@gmail.com 
 wrote:

> Following these instructions:
>
> https://www.cougar.eu.com/useful-guides/weewx-guides/rasberry-pi/add-ecowitt/modify-weewx.html
>
> Directory in /var/www/html/weewx/uploads is filling with data, so the 
> upload data part is working.  
>
>
>
> Here is the pertinent log entries:
>
> Oct 10 17:37:23 fedora-workstation python3[49897]: weewx[49897] DEBUG 
> user.gw1000: Invalid response to attempt 2 to send command 
> 'CMD_READ_FIRMWARE_VERSION': Invalid checksum in API response. Expected 
> '136' (0x88), received '51' (0x33).
> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] DEBUG 
> user.gw1000: Invalid response to attempt 3 to send command 
> 'CMD_READ_FIRMWARE_VERSION': Invalid checksum in API response. Expected 
> '136' (0x88), received '51' (0x33).
> Oct 10 17:37:33 fedora-workstation python3[49897]: weewx[49897] ERROR 
> user.gw1000: Failed to obtain 

Re: [weewx-user] Re: Cannot get weewx + gw1000 working

2023-10-17 Thread 'Rainer Lang' via weewx-user
it's difficult to follow what you are/were doing - it would be helpful 
if you
a) provided us with a copy of your weewx.conf (you can  your 
passwords if there are any)

b) set your station to GW1000
c) set debug = 0
d) provided the complete syslog from weewx startup until either the 1st 
report cycle is completed (as a rule after 5 minutes)

or weewx exits because of an unrecoverable error - snippets are not helpful

e) you should check if the IP address of your GW1000 is bound to its MAC 
address
f) you should check if some option in your router to allow intranetwork 
communication is set/untagged etc.


On 17.10.2023 15:20, Dale Chatham wrote:

Yet another data point:

python -m user.gw1000 --test-service --debug=5 
--ip-address=192.168.50.41 --port=45000

Using configuration file /etc/weewx/weewx.conf
debug level is '5'

IP address obtained from command line options
Port number obtained from command line options
Battery state filtering is 'False' (using the default)
Traceback (most recent call last):
  File "", line 198, in _run_module_as_main
  File "", line 88, in _run_code
  File "/usr/share/weewx/user/gw1000.py", line 8229, in 
    main()
  File "/usr/share/weewx/user/gw1000.py", line 8225, in main
    direct_gw.process_options()
  File "/usr/share/weewx/user/gw1000.py", line 6745, in process_options
    self.test_service()
  File "/usr/share/weewx/user/gw1000.py", line 8047, in test_service
    engine = weewx.engine.StdEngine(config)
             ^^
  File "/usr/share/weewx/weewx/engine.py", line 93, in __init__
    self.loadServices(config_dict)
  File "/usr/share/weewx/weewx/engine.py", line 161, in loadServices
    obj = weeutil.weeutil.get_object(svc)(self, config_dict)
          ^^
  File "/usr/share/weewx/user/gw1000.py", line 1389, in __init__
    loginf('     field map is %s' % natural_sort_dict(self.field_map))
^^
AttributeError: 'GatewayService' object has no attribute 'field_map'


On Tuesday, October 17, 2023 at 8:08:00 AM UTC-5 Dale Chatham wrote:

Another data point:

nmap -sV -p 1-65535 192.168.50.41
Starting Nmap 7.93 ( https://nmap.org ) at 2023-10-17 06:51 CDT
Nmap scan report for ecowitt-weather (192.168.50.41)
Host is up (0.0069s latency).
Not shown: 65533 closed tcp ports (reset)
PORT      STATE SERVICE     VERSION
80/tcp    open  nagios-nsca Nagios NSCA
45000/tcp open  asmp?
MAC Address: BC:FF:4D:1C:C0:69 (Espressif)

It appears the port is open on the access point, but it's not
answering.  Any ideas?


On Tuesday, October 17, 2023 at 6:32:48 AM UTC-5 Dale Chatham wrote:

Is it possible to get an help here?

On Thursday, October 12, 2023 at 9:30:22 PM UTC-5 Dale Chatham
wrote:

I blew it away and started over.

Installed weewx according to:
https://weewx.com/docs/redhat.htm Simulator worked fine.

Inst alled Ecowitt Gateway servier according to:
https://github.com/gjr80/weewx-gw1000/blob/master/readme.txt

Ran PYTHONPATH=/usr/share/weewx python -m user.gw1000
--test-driver from the above file.

I get this error:
Using configuration file /etc/weewx/weewx.conf

Unable to connect to device: Failed to obtain response to
command 'CMD_READ_FIRMWARE_VERSION' after 3 attempts

    Things to check include that the correct device IP
address is being used,
    the device is powered on and the device is not
otherwise disconnected from
    the local network.

I used telnet to connect to the IP and port listed in
weewx.conf:
    driver = user.gw1000
    ip_address = 192.168.50.41
    port = 45000

I get a connection, but canot get a response to anyting I
type (I have no idea if/what should be enteed to get a
response.



On Wednesday, October 11, 2023 at 6:13:20 AM UTC-5 gjr80
wrote:

I'm not sure what you are trying to do. The link you
provided uses a custom WeeWX data service to parse a
text file from the Ecowitt device, but the log extract
you provided contains errors relating to the Ecowitt
gateway driver 
which uses the Ecowitt gateway device API to read data
from the Ecowitt gateway device. You need to choose
one method or the other, not both. If your intent is
to utilise the linked page in your original post then
you should uninstall the Ecowitt gateway driver.

Gary
On Wednesday, 11 October 2023 at 08:41:26 UTC+10
dale.c...@gmail.com wrote:

Followi

[weewx-user] Re: Cannot get weewx + gw1000 working

2023-10-17 Thread 'Rainer Lang' via weewx-user

I meant of course
set *debug = 3*



 Forwarded Message 
Subject:Re: [weewx-user] Re: Cannot get weewx + gw1000 working
Date:   Tue, 17 Oct 2023 15:32:48 +0200
From:   Rainer Lang 
To: weewx-user@googlegroups.com



it's difficult to follow what you are/were doing - it would be helpful 
if you
a) provided us with a copy of your weewx.conf (you can  your 
passwords if there are any)

b) set your station to GW1000
c) set debug = 0
d) provided the complete syslog from weewx startup until either the 1st 
report cycle is completed (as a rule after 5 minutes)

or weewx exits because of an unrecoverable error - snippets are not helpful

e) you should check if the IP address of your GW1000 is bound to its MAC 
address
f) you should check if some option in your router to allow intranetwork 
communication is set/untagged etc.


On 17.10.2023 15:20, Dale Chatham wrote:

Yet another data point:

python -m user.gw1000 --test-service --debug=5 
--ip-address=192.168.50.41 --port=45000

Using configuration file /etc/weewx/weewx.conf
debug level is '5'

IP address obtained from command line options
Port number obtained from command line options
Battery state filtering is 'False' (using the default)
Traceback (most recent call last):
  File "", line 198, in _run_module_as_main
  File "", line 88, in _run_code
  File "/usr/share/weewx/user/gw1000.py", line 8229, in 
    main()
  File "/usr/share/weewx/user/gw1000.py", line 8225, in main
    direct_gw.process_options()
  File "/usr/share/weewx/user/gw1000.py", line 6745, in process_options
    self.test_service()
  File "/usr/share/weewx/user/gw1000.py", line 8047, in test_service
    engine = weewx.engine.StdEngine(config)
             ^^
  File "/usr/share/weewx/weewx/engine.py", line 93, in __init__
    self.loadServices(config_dict)
  File "/usr/share/weewx/weewx/engine.py", line 161, in loadServices
    obj = weeutil.weeutil.get_object(svc)(self, config_dict)
          ^^
  File "/usr/share/weewx/user/gw1000.py", line 1389, in __init__
    loginf('     field map is %s' % natural_sort_dict(self.field_map))
^^
AttributeError: 'GatewayService' object has no attribute 'field_map'


On Tuesday, October 17, 2023 at 8:08:00 AM UTC-5 Dale Chatham wrote:

Another data point:

nmap -sV -p 1-65535 192.168.50.41
Starting Nmap 7.93 ( https://nmap.org ) at 2023-10-17 06:51 CDT
Nmap scan report for ecowitt-weather (192.168.50.41)
Host is up (0.0069s latency).
Not shown: 65533 closed tcp ports (reset)
PORT      STATE SERVICE     VERSION
80/tcp    open  nagios-nsca Nagios NSCA
45000/tcp open  asmp?
MAC Address: BC:FF:4D:1C:C0:69 (Espressif)

It appears the port is open on the access point, but it's not
answering.  Any ideas?


On Tuesday, October 17, 2023 at 6:32:48 AM UTC-5 Dale Chatham wrote:

Is it possible to get an help here?

On Thursday, October 12, 2023 at 9:30:22 PM UTC-5 Dale Chatham
wrote:

I blew it away and started over.

Installed weewx according to:
https://weewx.com/docs/redhat.htm Simulator worked fine.

Inst alled Ecowitt Gateway servier according to:
https://github.com/gjr80/weewx-gw1000/blob/master/readme.txt

Ran PYTHONPATH=/usr/share/weewx python -m user.gw1000
--test-driver from the above file.

I get this error:
Using configuration file /etc/weewx/weewx.conf

Unable to connect to device: Failed to obtain response to
command 'CMD_READ_FIRMWARE_VERSION' after 3 attempts

    Things to check include that the correct device IP
address is being used,
    the device is powered on and the device is not
otherwise disconnected from
    the local network.

I used telnet to connect to the IP and port listed in
weewx.conf:
    driver = user.gw1000
    ip_address = 192.168.50.41
    port = 45000

I get a connection, but canot get a response to anyting I
type (I have no idea if/what should be enteed to get a
response.



On Wednesday, October 11, 2023 at 6:13:20 AM UTC-5 gjr80
wrote:

I'm not sure what you are trying to do. The link you
provided uses a custom WeeWX data service to parse a
text file from the Ecowitt device, but the log extract
you provided contains errors relating to the Ecowitt
gateway driver 
which uses the Ecowitt gateway device API to read data
from the Ecowitt gateway device. You need to choose
one method or the other, not both. If your intent is
to utilise the linked page in yo

[weewx-user] Re: Cannot get weewx + gw1000 working

2023-10-17 Thread vince
On Tuesday, October 17, 2023 at 4:32:48 AM UTC-7 Dale Chatham wrote:

Is it possible to get an help here?


It is perhaps less than typically likely with that kind of tone.

 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5978bb1f-5e44-46e4-aeb6-4e82bbdae0f5n%40googlegroups.com.


[weewx-user] can not get weewx to process this formula

2023-10-17 Thread Mks Mk
we want to improve the accuracy of our home energy monitor and we added new 
sensor to read the main line voltage so we got two sensors and the data is 
logged in weewx database.

[[sensor_map]]

ampere = current.***.EfPacket
linevoltage = payload5.*.RadioHeadASKPacket

the database have these columns which we created

consumption
ampere
linevoltage
pf

we want to calculate the energy consumption so we added this correction 

[StdCalibrate] 

[[Corrections]]
# For each type, an arbitrary calibration expression can be given.
# It should be in the units defined in the StdConvert section.
# Example:
foo = foo + 0.2
pf = 0.88
consumption = ((ampere * linevoltage) /1000) * pf

unfortunately weewx did nothing nor it complained about it. can weewx 
process such formula?

thanks

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/26effb7c-ad33-4de8-a9a0-f1390012ec5an%40googlegroups.com.


Re: [weewx-user] can not get weewx to process this formula

2023-10-17 Thread Tom Keffer
The only symbols that can be used in the [[Corrections]] formula are other
types in the archive record. So unless 'ampere', 'linevoltage', and 'pf'
all appear in the record, the correction will not work.

On Tue, Oct 17, 2023 at 9:48 AM Mks Mk  wrote:

> we want to improve the accuracy of our home energy monitor and we added
> new sensor to read the main line voltage so we got two sensors and the data
> is logged in weewx database.
>
> [[sensor_map]]
>
> ampere = current.***.EfPacket
> linevoltage = payload5.*.RadioHeadASKPacket
>
> the database have these columns which we created
>
> consumption
> ampere
> linevoltage
> pf
>
> we want to calculate the energy consumption so we added this correction
>
> [StdCalibrate]
>
> [[Corrections]]
> # For each type, an arbitrary calibration expression can be given.
> # It should be in the units defined in the StdConvert section.
> # Example:
> foo = foo + 0.2
> pf = 0.88
> consumption = ((ampere * linevoltage) /1000) * pf
>
> unfortunately weewx did nothing nor it complained about it. can weewx
> process such formula?
>
> thanks
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/26effb7c-ad33-4de8-a9a0-f1390012ec5an%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEB7PFF_--bbC6_vbtd51FPTEoAAB6qHh_4wc2Rx7DXwmw%40mail.gmail.com.


Re: [weewx-user] Re: How to revive 'frozen' WeeWX?

2023-10-17 Thread Ton vanN
Was on wrong leg, assuming KBs .
Unpleasant surprise, which seems to lead to conclusion that this install 
cannot be saved, but new start required.
What is best practical approach to make new, small configuration while 
'borrowing' from the old configuration the sdb-file and various conf-files?
Somewhere a description for that kind of clean-up/restart?

Obviously keen to avoid the 'error' that lead to this 'saturated' install:
any hint?

Op dinsdag 17 oktober 2023 om 13:06:53 UTC+2 schreef Tom Keffer:

> The "-m" option to du means that sizes are in *megabytes*. Your /var/log 
> directory has 26 *gigabytes* in it.
>
> On Tue, Oct 17, 2023 at 2:12 AM Ton vanN  wrote:
>
>> Vince,
>> The results of the suggested checks.
>>
>> *raspberrypi9*:~ $ sudo du -sm /var/log
>> 25977   /var/log
>> *raspberrypi9:~ $ *sudo du -sm /tmp
>> 1   /tmp
>> *raspberrypi9:~ $* sudo du -sm /home/pi
>> 53  /home/pi
>> *raspberrypi9:~ $* sudo du -sm /var/tmp
>> 1   /var/tmp
>>
>> IMHO contents of checked files are minimal 
>> Wondering why /dev/root full, with this Raspberry only running WeeWX plus 
>> 2 auxiliary Python-scripts (sized 2KB and 1KB), serving periodic upload of 
>> weewx.sdb to a remote, backup server
>>
>> Guessing/speculation:
>> might expansion of the file system (via raspi-config) have had some 
>> effects?
>> Op maandag 16 oktober 2023 om 20:58:56 UTC+2 schreef vince:
>>
>>> Your / partition is full. You have 29G Size and 29G Used and 0 
>>> Available.
>>>
>>> *raspberrypi9:~ $* df -h
>>> Bestandssysteem Grootte Gebruikt Besch Geb% Aangekoppeld op
>>> /dev/root   29G  29G 0 100% /
>>> devtmpfs   430M0  430M   0% /dev
>>> tmpfs  462M0  462M   0% /dev/shm
>>> tmpfs  462M  47M  415M  11% /run
>>> tmpfs  5,0M 4,0K  5,0M   1% /run/lock
>>> tmpfs  462M0  462M   0% /sys/fs/cgroup
>>> /dev/mmcblk0p1 253M  49M  204M  20% /boot
>>> tmpfs   93M0   93M   0% /run/user/1000
>>>
>>> Check your /var/log partition to see what its size is:
>>>
>>> sudo du -sm /var/log
>>>
>>> If it is not many GB, check your /home/pi and /tmp and /var/tmp 
>>> directories the same way.
>>>
>>>
>>> -- 
>> 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.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/2311e7cb-34e4-40f2-a659-5463b414dffcn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/7c457f45-f402-42b4-ad0e-2b0b3d7b55acn%40googlegroups.com.


Re: [weewx-user] Re: How to revive 'frozen' WeeWX?

2023-10-17 Thread vince
Just delete the big logs from /var/log and reboot - that's all you need to 
do.

With you providing no data on which files in /var/log are the big ones, no 
we can't help you much.

On Tuesday, October 17, 2023 at 1:13:19 PM UTC-7 Ton vanN wrote:

> Was on wrong leg, assuming KBs .
> Unpleasant surprise, which seems to lead to conclusion that this install 
> cannot be saved, but new start required.
> What is best practical approach to make new, small configuration while 
> 'borrowing' from the old configuration the sdb-file and various conf-files?
> Somewhere a description for that kind of clean-up/restart?
>
> Obviously keen to avoid the 'error' that lead to this 'saturated' install:
> any hint?
>
> Op dinsdag 17 oktober 2023 om 13:06:53 UTC+2 schreef Tom Keffer:
>
>> The "-m" option to du means that sizes are in *megabytes*. Your /var/log 
>> directory has 26 *gigabytes* in it.
>>
>> On Tue, Oct 17, 2023 at 2:12 AM Ton vanN  wrote:
>>
>>> Vince,
>>> The results of the suggested checks.
>>>
>>> *raspberrypi9*:~ $ sudo du -sm /var/log
>>> 25977   /var/log
>>> *raspberrypi9:~ $ *sudo du -sm /tmp
>>> 1   /tmp
>>> *raspberrypi9:~ $* sudo du -sm /home/pi
>>> 53  /home/pi
>>> *raspberrypi9:~ $* sudo du -sm /var/tmp
>>> 1   /var/tmp
>>>
>>> IMHO contents of checked files are minimal 
>>> Wondering why /dev/root full, with this Raspberry only running WeeWX 
>>> plus 2 auxiliary Python-scripts (sized 2KB and 1KB), serving periodic 
>>> upload of weewx.sdb to a remote, backup server
>>>
>>> Guessing/speculation:
>>> might expansion of the file system (via raspi-config) have had some 
>>> effects?
>>> Op maandag 16 oktober 2023 om 20:58:56 UTC+2 schreef vince:
>>>
 Your / partition is full. You have 29G Size and 29G Used and 0 
 Available.

 *raspberrypi9:~ $* df -h
 Bestandssysteem Grootte Gebruikt Besch Geb% Aangekoppeld op
 /dev/root   29G  29G 0 100% /
 devtmpfs   430M0  430M   0% /dev
 tmpfs  462M0  462M   0% /dev/shm
 tmpfs  462M  47M  415M  11% /run
 tmpfs  5,0M 4,0K  5,0M   1% /run/lock
 tmpfs  462M0  462M   0% /sys/fs/cgroup
 /dev/mmcblk0p1 253M  49M  204M  20% /boot
 tmpfs   93M0   93M   0% /run/user/1000

 Check your /var/log partition to see what its size is:

 sudo du -sm /var/log

 If it is not many GB, check your /home/pi and /tmp and /var/tmp 
 directories the same way.


 -- 
>>> 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.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/2311e7cb-34e4-40f2-a659-5463b414dffcn%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/45d70326-8ad5-4b59-b454-e4dd7fd3461en%40googlegroups.com.


[weewx-user] Re: Cannot get weewx + gw1000 working

2023-10-17 Thread Dale Chatham
My apologies.  However, I'm more than a little frustrated with trying to 
get this up and running.  I had waited four days and seen a good bit of 
traffic.  I will point out that it did have my desired effect.


On Tuesday, October 17, 2023 at 10:12:09 AM UTC-5 vince wrote:

> On Tuesday, October 17, 2023 at 4:32:48 AM UTC-7 Dale Chatham wrote:
>
> Is it possible to get an help here?
>
>
> It is perhaps less than typically likely with that kind of tone.
>
>  
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/74cbdc8e-3eac-438b-93b8-aed45df5fc27n%40googlegroups.com.


Re: [weewx-user] Re: Cannot get weewx + gw1000 working

2023-10-17 Thread Dale Chatham
Thank you for answering.  Responses below:

a.  weewx.conf attached.
b. [Station]

# Description of the station location
location = "Denton, TX"

# Latitude in decimal degrees. Negative for southern hemisphere
latitude = 33.227786
# Longitude in decimal degrees. Negative for western hemisphere.
longitude = -97.093708

# Altitude of the station, with the unit it is in. This is used only
# if the hardware cannot supply a value.
altitude = 600, foot# Choose 'foot' or 'meter' for unit

# Set to type of station hardware. There must be a corresponding stanza
# in this file, which includes a value for the 'driver' option.
station_type = GW1000
c. # This section is for general configuration information.

  # Set to 1 for extra debug info, otherwise comment it out or set to zero
  debug = 3
d. Oct 17 15:25:04 fedora-workstation systemd[1]: Starting weewx.service - 
SYSV: start and stop the weewx weather system...
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Initializing weewx version 4.10.2
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Using Python 3.11.6 (main, Oct  3 2023, 00:00:00) [GCC 13.2.1 
20230728 (Red Hat 13.2.1-1)]
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Located at /bin/python3
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Platform Linux-6.5.6-200.fc38.x86_64-x86_64-with-glibc2.37
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Locale is 'en_US.UTF-8'
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Using configuration file /etc/weewx/weewx.conf
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Debug is 3
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: PID file is /var/run/weewx.pid
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] DEBUG 
__main__: Initializing engine
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
weewx.engine: Loading station type GW1000 (user.gw1000)
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000: GatewayDriver: version is 0.6.0b2
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000:  device address is 192.168.50.41:45000
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000:  poll interval is 10 seconds
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000:  max tries is 3, retry wait time is 10 seconds
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000:  broadcast address is 255.255.255.255:46000, broadcast 
timeout is 5 seconds
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000:  socket timeout is 2 seconds
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000:  field map is {'co2': 'co2', 'co2_24h_avg': 'co2_24h_avg', 
'dateTime': 'datetime', 'daymaxwind': 'daymaxwind', 'dayRain': 't_rainday', 
'dewpoint': 'dewpoint', 'extraHumid1': 'humid1', 'extraHumid2': 'humid2', 
'extraHumid3': 'humid3', 'extraHumid4': 'humid4', 'extraHumid5': 'humid5', 
'extraHumid6': 'humid6', 'extraHumid7': 'humid7', 'extraHumid8': 'humid8', 
'extraHumid17': 'humid17', 'extraTemp1': 'temp1', 'extraTemp2': 'temp2', 
'extraTemp3': 'temp3', 'extraTemp4': 'temp4', 'extraTemp5': 'temp5', 
'extraTemp6': 'temp6', 'extraTemp7': 'temp7', 'extraTemp8': 'temp8', 
'extraTemp9': 'temp9', 'extraTemp10': 'temp10', 'extraTemp11': 'temp11', 
'extraTemp12': 'temp12', 'extraTemp13': 'temp13', 'extraTemp14': 'temp14', 
'extraTemp15': 'temp15', 'extraTemp16': 'temp16', 'extraTemp17': 'temp17', 
'heatindex': 'heatindex', 'inHumidity': 'inhumid', 'inTemp': 'intemp', 
'leafWet1': 'leafwet1', 'leafWet2': 'leafwet2', 'leafWet3': 'leafwet3', 
'leafWet4': 'leafwet4', 'leafWet5': 'leafwet5', 'leafWet6': 'leafwet6', 
'leafWet7': 'leafwet7', 'leafWet8': 'leafwet8', 'leak1': 'leak1', 'leak2': 
'leak2', 'leak3': 'leak3', 'leak4': 'leak4', 'lightning_distance': 
'lightningdist', 'lightning_last_det_time': 'lightningdettime', 
'lightning_strike_count': 'lightning_strike_count', 'lightningcount': 
'lightningcount', 'luminosity': 'light', 'monthRain': 't_rainmonth', 
'outHumidity': 'outhumid', 'outTemp': 'outtemp', 'p_dayRain': 'p_rainday', 
'p_monthRain': 'p_rainmonth', 'p_rain': 'p_rain', 'p_rainRate': 
'p_rainrate', 'p_stormRain': 'p_rainevent', 'p_weekRain': 'p_rainweek', 
'p_yearRain': 'p_rainyear', 'pm2_5': 'pm251', 'pm2_51_24h_avg': 
'pm251_24h_avg', 'pm2_52': 'pm252', 'pm2_52_24h_avg': 'pm252_24h_avg', 
'pm2_53': 'pm253', 'pm2_53_24h_avg': 'pm253_24h_avg', 'pm2_54': 'pm254', 
'pm2_54_24h_avg': 'pm254_24h_avg', 'pm2_55': 'pm255', 'pm2_55_24h_avg': 
'pm255_24h_avg', 'pm10': 'pm10', 'pm10_24h_avg': 'pm10_24h_avg', 
'pressure': 'absbarometer', 'rain': 't_rain'

Re: [weewx-user] Re: Migration from 4.10.2 (setup.py) to 5.0 (pip install) problems

2023-10-17 Thread bgra...@umw.edu
I found the name was actually "python-dateutil" so with that installed in 
venv I'm not getting the error when I run weewxd using 
/home/weewx/weewx.conf.
On to the next step in migration. Thanks Vince and Tom--I'm sure to have 
more questions...

On Monday, October 16, 2023 at 8:08:49 PM UTC-4 Tom Keffer wrote:

> Try installing the date-util package.
>
> *python3 -m pip install date-util*
>
> It would be nice if you showed more of the stack trace. It would tell us 
> which extension uses date-util. There may be others.
>
>
>
> On Mon, Oct 16, 2023 at 4:03 PM bgra...@umw.edu  wrote:
>
>> Thanks Vince and Tom. Below is the listing of packages from a pip 
>> listing. ( bg@n4mrv:~$ python3 -m pip list  followed by  (weewx-venv) 
>> bg@n4mrv:~$ python3 -m pip list ) I  guess the problem is that I have lots 
>> but they need to be inside venv. Sorry, I don't know much about virtual 
>> sessions.
>> Is there a way to move these over or do I need to reinstall one by one? 
>> When I migrate to venv do I reinstall all the extensions? 
>> After installing "requests" and running weewxd I get the following error:
>>
>> ModuleNotFoundError: No module named 'dateutil'
>> (weewx-venv) bg@n4mrv:~$ python3 -m pip install dateutil
>> ERROR: Could not find a version that satisfies the requirement dateutil 
>> (from versions: none)
>> ERROR: No matching distribution found for dateutil
>>
>> Thanks
>> Bob
>>
>> *grattans.org/wx * 
>> bg@n4mrv:~$ python3 -m pip list
>> PackageVersion
>> -- 
>> appdirs1.4.4
>> apturl 0.5.2
>> attrs  21.2.0
>> Babel  2.13.0
>> bcrypt 3.2.0
>> beautifulsoup4 4.10.0
>> beniget0.4.1
>> blinker1.4
>> Brlapi 0.8.3
>> Brotli 1.0.9
>> certifi2020.6.20
>> chardet4.0.0
>> charset-normalizer 3.3.0
>> checkbox-support   0.22
>> Cheetah3   3.2.6
>> chrome-gnome-shell 0.0.0
>> cliapp 1.20180812.1
>> click  8.0.3
>> cmdtest0.32+git
>> colorama   0.4.4
>> command-not-found  0.3
>> configobj  5.0.6
>> cryptography   3.4.8
>> CT33.3.2
>> cupshelpers1.0
>> cycler 0.11.0
>> dbus-python1.2.18
>> decorator  4.4.2
>> defer  1.0.6
>> distro 1.7.0
>> distro-info1.1+ubuntu0.1
>> dnspython  2.1.0
>> duplicity  0.8.21
>> ephem  4.1.3
>> fasteners  0.14.1
>> feedparser 6.0.8
>> fonttools  4.29.1
>> fs 2.4.12
>> future 0.18.2
>> gast   0.5.2
>> geographiclib  1.52
>> geopy  2.2.0
>> ghp-import 2.1.0
>> gpg1.16.0
>> html5lib   1.1
>> httplib2   0.20.2
>> idna   3.3
>> importlib-metadata 4.6.4
>> iotop  0.6
>> jeepney0.7.1
>> Jinja2 3.0.3
>> keyring23.5.0
>> keyrings.alt   4.1.0
>> kiwisolver 1.3.2
>> language-selector  0.1
>> launchpadlib   1.10.16
>> lazr.restfulclient 0.14.4
>> lazr.uri   1.0.6
>> lockfile   0.12.2
>> louis  3.20.0
>> lxml   4.8.0
>> lz43.1.3+dfsg
>> macaroonbakery 1.3.1
>> Mako   1.1.3
>> Markdown   3.3.6
>> MarkupSafe 2.0.1
>> matplotlib 3.5.1
>> mergedeep  1.3.4
>> mkdocs 1.5.3
>> mkdocs-material9.4.6
>> mkdocs-material-extensions 1.2
>> monotonic  1.6
>> more-itertools 8.10.0
>> mpmath 0.0.0
>> netifaces  0.11.0
>> numpy  1.21.5
>> oauthlib   3.2.0
>> onboard1.4.1
>> ovs2.17.7
>> packaging  21.3
>> padme  1.1.1
>> paginate   0.5.6
>> paho-mqtt  1.5.1
>> paramiko   2.9.3
>> pathspec   0.11.2
>> pexpect4.8.0
>> Pillow 9.0.1
>> pip22.0.2
>> platformdirs   3.11.0
>> ply3.11
>> protobuf   3.12.4
>> ptyprocess 0.7.0
>> pyasn1 0.4.8
>> pycairo1.20.1
>> p

Re: [weewx-user] can not get weewx to process this formula

2023-10-17 Thread Mks Mk
Hi Tom

we run weewx directly and found that 'ampere' & 'linevoltage' are in 
different loop because the data are coming from two different sensors by 
sdr.py driver.
how we can combine these loops into one so weewx can process this formula, 
or what can we do to get this calculation done.?

Thank you for your support

On Tuesday, October 17, 2023 at 9:26:38 PM UTC+3 Tom Keffer wrote:

> The only symbols that can be used in the [[Corrections]] formula are other 
> types in the archive record. So unless 'ampere', 'linevoltage', and 'pf' 
> all appear in the record, the correction will not work.
>
> On Tue, Oct 17, 2023 at 9:48 AM Mks Mk  wrote:
>
>> we want to improve the accuracy of our home energy monitor and we added 
>> new sensor to read the main line voltage so we got two sensors and the data 
>> is logged in weewx database.
>>
>> [[sensor_map]]
>>
>> ampere = current.***.EfPacket
>> linevoltage = payload5.*.RadioHeadASKPacket
>>
>> the database have these columns which we created
>>
>> consumption
>> ampere
>> linevoltage
>> pf
>>
>> we want to calculate the energy consumption so we added this correction 
>>
>> [StdCalibrate] 
>>
>> [[Corrections]]
>> # For each type, an arbitrary calibration expression can be given.
>> # It should be in the units defined in the StdConvert section.
>> # Example:
>> foo = foo + 0.2
>> pf = 0.88
>> consumption = ((ampere * linevoltage) /1000) * pf
>>
>> unfortunately weewx did nothing nor it complained about it. can weewx 
>> process such formula?
>>
>> thanks
>>
>> -- 
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/26effb7c-ad33-4de8-a9a0-f1390012ec5an%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/43ebabf0-db3e-4715-99a8-14f1ac7927f8n%40googlegroups.com.


Re: [weewx-user] Re: Cannot get weewx + gw1000 working

2023-10-17 Thread gjr80
My apologies, sometime life gets in the road of hobbies and around here 
hobbies take a back seat :)

I will need to sit down and look at the responses in detail, but on the 
face of it this is not a network/router/firewall issue but either a gateway 
device or driver issue. There was some re-factoring of some code in putting 
together v0.6.0, but nothing that altered the checksum coding. I need some 
time to sit down and decipher the responses to see where the issue is. I 
should have some time over the next two days.

Gary

On Wednesday, 18 October 2023 at 06:35:37 UTC+10 dale.c...@gmail.com wrote:

> Thank you for answering.  Responses below:
>
> a.  weewx.conf attached.
> b. [Station]
>
> # Description of the station location
> location = "Denton, TX"
>
> # Latitude in decimal degrees. Negative for southern hemisphere
> latitude = 33.227786
> # Longitude in decimal degrees. Negative for western hemisphere.
> longitude = -97.093708
>
> # Altitude of the station, with the unit it is in. This is used only
> # if the hardware cannot supply a value.
> altitude = 600, foot# Choose 'foot' or 'meter' for unit
>
> # Set to type of station hardware. There must be a corresponding stanza
> # in this file, which includes a value for the 'driver' option.
> station_type = GW1000
> c. # This section is for general configuration information.
>
>   # Set to 1 for extra debug info, otherwise comment it out or set to zero
>   debug = 3
> d. Oct 17 15:25:04 fedora-workstation systemd[1]: Starting weewx.service - 
> SYSV: start and stop the weewx weather system...
> Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
> __main__: Initializing weewx version 4.10.2
> Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
> __main__: Using Python 3.11.6 (main, Oct  3 2023, 00:00:00) [GCC 13.2.1 
> 20230728 (Red Hat 13.2.1-1)]
> Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
> __main__: Located at /bin/python3
> Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
> __main__: Platform Linux-6.5.6-200.fc38.x86_64-x86_64-with-glibc2.37
> Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
> __main__: Locale is 'en_US.UTF-8'
> Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
> __main__: Using configuration file /etc/weewx/weewx.conf
> Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
> __main__: Debug is 3
> Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
> __main__: PID file is /var/run/weewx.pid
> Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] DEBUG 
> __main__: Initializing engine
> Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
> weewx.engine: Loading station type GW1000 (user.gw1000)
> Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
> user.gw1000: GatewayDriver: version is 0.6.0b2
> Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
> user.gw1000:  device address is 192.168.50.41:45000
> Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
> user.gw1000:  poll interval is 10 seconds
> Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
> user.gw1000:  max tries is 3, retry wait time is 10 seconds
> Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
> user.gw1000:  broadcast address is 255.255.255.255:46000, broadcast 
> timeout is 5 seconds
> Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
> user.gw1000:  socket timeout is 2 seconds
> Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
> user.gw1000:  field map is {'co2': 'co2', 'co2_24h_avg': 'co2_24h_avg', 
> 'dateTime': 'datetime', 'daymaxwind': 'daymaxwind', 'dayRain': 't_rainday', 
> 'dewpoint': 'dewpoint', 'extraHumid1': 'humid1', 'extraHumid2': 'humid2', 
> 'extraHumid3': 'humid3', 'extraHumid4': 'humid4', 'extraHumid5': 'humid5', 
> 'extraHumid6': 'humid6', 'extraHumid7': 'humid7', 'extraHumid8': 'humid8', 
> 'extraHumid17': 'humid17', 'extraTemp1': 'temp1', 'extraTemp2': 'temp2', 
> 'extraTemp3': 'temp3', 'extraTemp4': 'temp4', 'extraTemp5': 'temp5', 
> 'extraTemp6': 'temp6', 'extraTemp7': 'temp7', 'extraTemp8': 'temp8', 
> 'extraTemp9': 'temp9', 'extraTemp10': 'temp10', 'extraTemp11': 'temp11', 
> 'extraTemp12': 'temp12', 'extraTemp13': 'temp13', 'extraTemp14': 'temp14', 
> 'extraTemp15': 'temp15', 'extraTemp16': 'temp16', 'extraTemp17': 'temp17', 
> 'heatindex': 'heatindex', 'inHumidity': 'inhumid', 'inTemp': 'intemp', 
> 'leafWet1': 'leafwet1', 'leafWet2': 'leafwet2', 'leafWet3': 'leafwet3', 
> 'leafWet4': 'leafwet4', 'leafWet5': 'leafwet5', 'leafWet6': 'leafwet6', 
> 'leafWet7': 'leafwet7', 'leafWet8': 'leafwet8', 'leak1': 'leak1', 'leak2': 
> 'leak2', 'leak3': 'leak3', 'leak4': 'leak4', 'lightning_distance': 
> 'lightningdist', 'lightning_last_det_time': 'lightningd

Re: [weewx-user] can not get weewx to process this formula

2023-10-17 Thread gjr80
So what does

consumption = ((ampere * linevoltage) /1000) * 0.88

do?

Gary
On Wednesday, 18 October 2023 at 08:26:25 UTC+10 mksm...@gmail.com wrote:

> Hi Tom
>
> we run weewx directly and found that 'ampere' & 'linevoltage' are in 
> different loop because the data are coming from two different sensors by 
> sdr.py driver.
> how we can combine these loops into one so weewx can process this formula, 
> or what can we do to get this calculation done.?
>
> Thank you for your support
>
> On Tuesday, October 17, 2023 at 9:26:38 PM UTC+3 Tom Keffer wrote:
>
>> The only symbols that can be used in the [[Corrections]] formula are 
>> other types in the archive record. So unless 'ampere', 'linevoltage', and 
>> 'pf' all appear in the record, the correction will not work.
>>
>> On Tue, Oct 17, 2023 at 9:48 AM Mks Mk  wrote:
>>
>>> we want to improve the accuracy of our home energy monitor and we added 
>>> new sensor to read the main line voltage so we got two sensors and the data 
>>> is logged in weewx database.
>>>
>>> [[sensor_map]]
>>>
>>> ampere = current.***.EfPacket
>>> linevoltage = payload5.*.RadioHeadASKPacket
>>>
>>> the database have these columns which we created
>>>
>>> consumption
>>> ampere
>>> linevoltage
>>> pf
>>>
>>> we want to calculate the energy consumption so we added this correction 
>>>
>>> [StdCalibrate] 
>>>
>>> [[Corrections]]
>>> # For each type, an arbitrary calibration expression can be 
>>> given.
>>> # It should be in the units defined in the StdConvert section.
>>> # Example:
>>> foo = foo + 0.2
>>> pf = 0.88
>>> consumption = ((ampere * linevoltage) /1000) * pf
>>>
>>> unfortunately weewx did nothing nor it complained about it. can weewx 
>>> process such formula?
>>>
>>> thanks
>>>
>>> -- 
>>> 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.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/26effb7c-ad33-4de8-a9a0-f1390012ec5an%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/b604c7a7-eeef-4037-823f-7fbdee63b546n%40googlegroups.com.


Re: [weewx-user] Re: Cannot get weewx + gw1000 working

2023-10-17 Thread 'Rainer Lang' via weewx-user
it appears that the console you are connected to (IP 192.168.50.41) is 
NOT a console with the Ecowitt local Gateway API (aka GW1000 API) but 
another console

with the WiFi firmware EasyWeatherPro_V5.1.3

e.g. a HP25x0 console with the new WiFi modem.

Therefore the GW1000/Ecowitt API driver cannot get a proper response 
resp. misreads the API response as this console doesn't have the Ecowitt 
Gateway API.


I suggest that you connect a GW1x00/GW2000 gateway (if you have one).
Otherwise you will need to the extended version of the Interceptor driver


On 17.10.2023 22:35, Dale Chatham wrote:

Thank you for answering.  Responses below:

a.  weewx.conf attached.
b. [Station]

    # Description of the station location
    location = "Denton, TX"

    # Latitude in decimal degrees. Negative for southern hemisphere
    latitude = 33.227786
    # Longitude in decimal degrees. Negative for western hemisphere.
    longitude = -97.093708

    # Altitude of the station, with the unit it is in. This is used only
    # if the hardware cannot supply a value.
    altitude = 600, foot    # Choose 'foot' or 'meter' for unit

    # Set to type of station hardware. There must be a corresponding 
stanza

    # in this file, which includes a value for the 'driver' option.
    station_type = GW1000
c. # This section is for general configuration information.

  # Set to 1 for extra debug info, otherwise comment it out or set to zero
  debug = 3
d. Oct 17 15:25:04 fedora-workstation systemd[1]: Starting 
weewx.service - SYSV: start and stop the weewx weather system...
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Initializing weewx version 4.10.2
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Using Python 3.11.6 (main, Oct  3 2023, 00:00:00) [GCC 
13.2.1 20230728 (Red Hat 13.2.1-1)]
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Located at /bin/python3
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Platform Linux-6.5.6-200.fc38.x86_64-x86_64-with-glibc2.37
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Locale is 'en_US.UTF-8'
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Using configuration file /etc/weewx/weewx.conf
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: Debug is 3
Oct 17 15:25:04 fedora-workstation python3[53512]: weewx[53512] INFO 
__main__: PID file is /var/run/weewx.pid
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] DEBUG 
__main__: Initializing engine
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
weewx.engine: Loading station type GW1000 (user.gw1000)
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000: GatewayDriver: version is 0.6.0b2
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000:      device address is 192.168.50.41:45000
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000:      poll interval is 10 seconds
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000:      max tries is 3, retry wait time is 10 seconds
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000:      broadcast address is 255.255.255.255:46000, 
broadcast timeout is 5 seconds
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000:      socket timeout is 2 seconds
Oct 17 15:25:04 fedora-workstation python3[53515]: weewx[53515] INFO 
user.gw1000:      field map is {'co2': 'co2', 'co2_24h_avg': 
'co2_24h_avg', 'dateTime': 'datetime', 'daymaxwind': 'daymaxwind', 
'dayRain': 't_rainday', 'dewpoint': 'dewpoint', 'extraHumid1': 
'humid1', 'extraHumid2': 'humid2', 'extraHumid3': 'humid3', 
'extraHumid4': 'humid4', 'extraHumid5': 'humid5', 'extraHumid6': 
'humid6', 'extraHumid7': 'humid7', 'extraHumid8': 'humid8', 
'extraHumid17': 'humid17', 'extraTemp1': 'temp1', 'extraTemp2': 
'temp2', 'extraTemp3': 'temp3', 'extraTemp4': 'temp4', 'extraTemp5': 
'temp5', 'extraTemp6': 'temp6', 'extraTemp7': 'temp7', 'extraTemp8': 
'temp8', 'extraTemp9': 'temp9', 'extraTemp10': 'temp10', 
'extraTemp11': 'temp11', 'extraTemp12': 'temp12', 'extraTemp13': 
'temp13', 'extraTemp14': 'temp14', 'extraTemp15': 'temp15', 
'extraTemp16': 'temp16', 'extraTemp17': 'temp17', 'heatindex': 
'heatindex', 'inHumidity': 'inhumid', 'inTemp': 'intemp', 'leafWet1': 
'leafwet1', 'leafWet2': 'leafwet2', 'leafWet3': 'leafwet3', 
'leafWet4': 'leafwet4', 'leafWet5': 'leafwet5', 'leafWet6': 
'leafwet6', 'leafWet7': 'leafwet7', 'leafWet8': 'leafwet8', 'leak1': 
'leak1', 'leak2': 'leak2', 'leak3': 'leak3', 'leak4': 'leak4', 
'lightning_distance': 'lightningdist', 'lightning_last_det_time': 
'lightningdettime', 'lightning_strike_count': 
'lightning_strike_count', 'lightningcount': 'lightningcount', 
'luminosity': 'light', 'monthRain': 't_rainmonth', 'ou

Re: [weewx-user] Re: Cannot get weewx + gw1000 working

2023-10-17 Thread Dale Chatham
Thank you.  I think I'm a lot closer now:
python -m user.gw1000 --test-driver
Using configuration file /etc/weewx/weewx.conf
debug level is '3'

IP address obtained from station config
Port number obtained from station config
Battery state filtering is 'False' (using the default)
/usr/share/weewx/user/gw1000.py:2751: DeprecationWarning: setDaemon() is 
deprecated, set the daemon attribute instead
  self.thread.setDaemon(True)
/usr/share/weewx/user/gw1000.py:2752: DeprecationWarning: setName() is 
deprecated, set the name attribute instead
  self.thread.setName('GatewayCollectorThread')

Interrogating GW2000 at 192.168.50.143:45000

2023-10-17 18:46:29 CDT (1697586389): 'dateTime': '1697586389', 
'daymaxwind': '0.8', 'inHumidity': '36', 'inTemp': '27.4', 
'lightning_distance': 'None', 'lightning_last_det_time': 'None', 
'lightning_strike_count': 'None', 'lightningcount': '0', 'luminosity': 
'850.0', 'outHumidity': '33', 'outTemp': '20.3', 'p_dayRain': '0.0', 
'p_monthRain': '0.0', 'p_rain': 'None', 'p_rainRate': '0.0', 'p_stormRain': 
'0.0', 'p_weekRain': '0.0', 'p_yearRain': '0.0', 'pressure': '994.1', 
'relbarometer': '994.1', 'usUnits': '17', 'UV': '0', 'uvradiation': '0.0', 
'wh57_batt': '5', 'wh57_sig': '4', 'windDir': '44', 'windGust': '0.5', 
'windSpeed': '0.0', 'ws90_batt': '3.16', 'ws90_sig': '4'
2023-10-17 18:46:39 CDT (1697586399): 'dateTime': '1697586399', 
'daymaxwind': '0.8', 'inHumidity': '36', 'inTemp': '27.4', 
'lightning_distance': 'None', 'lightning_last_det_time': 'None', 
'lightning_strike_count': '0', 'lightningcount': '0', 'luminosity': 
'830.0', 'outHumidity': '34', 'outTemp': '20.3', 'p_dayRain': '0.0', 
'p_monthRain': '0.0', 'p_rain': '0.0', 'p_rainRate': '0.0', 'p_stormRain': 
'0.0', 'p_weekRain': '0.0', 'p_yearRain': '0.0', 'pressure': '994.1', 
'relbarometer': '994.1', 'usUnits': '17', 'UV': '0', 'uvradiation': '0.0', 
'wh57_batt': '5', 'wh57_sig': '4', 'windDir': '79', 'windGust': '0.5', 
'windSpeed': '0.0', 'ws90_batt': '3.16', 'ws90_sig': '4'

systemctl restart weewx
[root@fedora-workstation weewx]# python -m user.gw1000 --test-driver
Using configuration file /etc/weewx/weewx.conf
debug level is '3'

IP address obtained from station config
Port number obtained from station config
Battery state filtering is 'False' (using the default)
/usr/share/weewx/user/gw1000.py:2751: DeprecationWarning: setDaemon() is 
deprecated, set the daemon attribute instead
  self.thread.setDaemon(True)
/usr/share/weewx/user/gw1000.py:2752: DeprecationWarning: setName() is 
deprecated, set the name attribute instead
  self.thread.setName('GatewayCollectorThread')

Interrogating GW2000 at 192.168.50.143:45000

2023-10-17 18:48:08 CDT (1697586488): 'dateTime': '1697586488', 
'daymaxwind': '0.8', 'inHumidity': '36', 'inTemp': '27.4', 
'lightning_distance': 'None', 'lightning_last_det_time': 'None', 
'lightning_strike_count': 'None', 'lightningcount': '0', 'luminosity': 
'730.0', 'outHumidity': '34', 'outTemp': '20.2', 'p_dayRain': '0.0', 
'p_monthRain': '0.0', 'p_rain': 'None', 'p_rainRate': '0.0', 'p_stormRain': 
'0.0', 'p_weekRain': '0.0', 'p_yearRain': '0.0', 'pressure': '993.9', 
'relbarometer': '993.9', 'usUnits': '17', 'UV': '0', 'uvradiation': '0.0', 
'wh57_batt': '5', 'wh57_sig': '4', 'windDir': '76', 'windGust': '0.0', 
'windSpeed': '0.0', 'ws90_batt': '3.16', 'ws90_sig': '4'
2023-10-17 18:48:18 CDT (1697586498): 'dateTime': '1697586498', 
'daymaxwind': '0.8', 'inHumidity': '36', 'inTemp': '27.4', 
'lightning_distance': 'None', 'lightning_last_det_time': 'None', 
'lightning_strike_count': '0', 'lightningcount': '0', 'luminosity': 
'720.0', 'outHumidity': '34', 'outTemp': '20.2', 'p_dayRain': '0.0', 
'p_monthRain': '0.0', 'p_rain': '0.0', 'p_rainRate': '0.0', 'p_stormRain': 
'0.0', 'p_weekRain': '0.0', 'p_yearRain': '0.0', 'pressure': '993.9', 
'relbarometer': '993.9', 'usUnits': '17', 'UV': '0', 'uvradiation': '0.0', 
'wh57_batt': '5', 'wh57_sig': '4', 'windDir': '76', 'windGust': '0.0', 
'windSpeed': '0.0', 'ws90_batt': '3.16', 'ws90_sig': '4'
2023-10-17 18:48:28 CDT (1697586508): 'dateTime': '1697586508', 
'daymaxwind': '0.8', 'inHumidity': '36', 'inTemp': '27.4', 
'lightning_distance': 'None', 'lightning_last_det_time': 'None', 
'lightning_strike_count': '0', 'lightningcount': '0', 'luminosity': 
'710.0', 'outHumidity': '34', 'outTemp': '20.2', 'p_dayRain': '0.0', 
'p_monthRain': '0.0', 'p_rain': '0.0', 'p_rainRate': '0.0', 'p_stormRain': 
'0.0', 'p_weekRain': '0.0', 'p_yearRain': '0.0', 'pressure': '993.9', 
'relbarometer': '993.9', 'usUnits': '17', 'UV': '0', 'uvradiation': '0.0', 
'wh57_batt': '5', 'wh57_sig': '4', 'windDir': '76', 'windGust': '0.0', 
'windSpeed': '0.0', 'ws90_batt': '3.16', 'ws90_sig': '4'




On Tuesday, October 17, 2023 at 5:38:03 PM UTC-5 Rainer Lang wrote:

> it appears that the console you are connected to (IP 192.168.50.41) is 
> NOT a console with the Ecowitt local Gateway API (aka GW1000 API) but 
> another console
> with the WiFi firmware EasyWeatherPro_V5.1.3

Re: [weewx-user] can not get weewx to process this formula

2023-10-17 Thread Tom Keffer
Even if all types don't appear in the LOOP packets, they should all be
appearing in the archive records. Run weewxd directly from the command line
 and see
exactly what's in the archive record.

I apologize that the error diagnostics for [[Corrections]] are pretty
crappy. Still, is there anything in the log?

Your other option is to write a weewx service that caches values.

On Tue, Oct 17, 2023 at 3:26 PM Mks Mk  wrote:

> Hi Tom
>
> we run weewx directly and found that 'ampere' & 'linevoltage' are in
> different loop because the data are coming from two different sensors by
> sdr.py driver.
> how we can combine these loops into one so weewx can process this formula,
> or what can we do to get this calculation done.?
>
> Thank you for your support
>
> On Tuesday, October 17, 2023 at 9:26:38 PM UTC+3 Tom Keffer wrote:
>
>> The only symbols that can be used in the [[Corrections]] formula are
>> other types in the archive record. So unless 'ampere', 'linevoltage', and
>> 'pf' all appear in the record, the correction will not work.
>>
>> On Tue, Oct 17, 2023 at 9:48 AM Mks Mk  wrote:
>>
>>> we want to improve the accuracy of our home energy monitor and we added
>>> new sensor to read the main line voltage so we got two sensors and the data
>>> is logged in weewx database.
>>>
>>> [[sensor_map]]
>>>
>>> ampere = current.***.EfPacket
>>> linevoltage = payload5.*.RadioHeadASKPacket
>>>
>>> the database have these columns which we created
>>>
>>> consumption
>>> ampere
>>> linevoltage
>>> pf
>>>
>>> we want to calculate the energy consumption so we added this correction
>>>
>>> [StdCalibrate]
>>>
>>> [[Corrections]]
>>> # For each type, an arbitrary calibration expression can be
>>> given.
>>> # It should be in the units defined in the StdConvert section.
>>> # Example:
>>> foo = foo + 0.2
>>> pf = 0.88
>>> consumption = ((ampere * linevoltage) /1000) * pf
>>>
>>> unfortunately weewx did nothing nor it complained about it. can weewx
>>> process such formula?
>>>
>>> thanks
>>>
>>> --
>>> 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.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/26effb7c-ad33-4de8-a9a0-f1390012ec5an%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/43ebabf0-db3e-4715-99a8-14f1ac7927f8n%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEARd484rbNw8mJQscZFNpKyPLo5-Bqt2donaSZ9%2Bz7C2A%40mail.gmail.com.


Re: [weewx-user] can not get weewx to process this formula

2023-10-17 Thread Mks Mk
Hi Gary

it all started here
https://groups.google.com/g/weewx-user/c/ltOVkcY1fKc/m/7sQSVGN_AQAJ

we were using fixed value for the incoming grid line to calculate the 
consumption but it was not accurate enough so we added new sensor to read 
the grid incoming line voltage.
earlier this formula worked consumption = ampere * 117 / 1000 * 0.88
but  consumption = ampere * linevoltage / 1000 * 0.88 did not work
the linevoltage input comes from different sensor than ampere,  these two 
reading are generated in different loops, so based on Tom advice the weewx 
correction will not work
thank you

On Wednesday, October 18, 2023 at 1:28:55 AM UTC+3 gjr80 wrote:

> So what does
>
> consumption = ((ampere * linevoltage) /1000) * 0.88
>
> do?
>
> Gary
> On Wednesday, 18 October 2023 at 08:26:25 UTC+10 mksm...@gmail.com wrote:
>
>> Hi Tom
>>
>> we run weewx directly and found that 'ampere' & 'linevoltage' are in 
>> different loop because the data are coming from two different sensors by 
>> sdr.py driver.
>> how we can combine these loops into one so weewx can process this 
>> formula, or what can we do to get this calculation done.?
>>
>> Thank you for your support
>>
>> On Tuesday, October 17, 2023 at 9:26:38 PM UTC+3 Tom Keffer wrote:
>>
>>> The only symbols that can be used in the [[Corrections]] formula are 
>>> other types in the archive record. So unless 'ampere', 'linevoltage', and 
>>> 'pf' all appear in the record, the correction will not work.
>>>
>>> On Tue, Oct 17, 2023 at 9:48 AM Mks Mk  wrote:
>>>
 we want to improve the accuracy of our home energy monitor and we added 
 new sensor to read the main line voltage so we got two sensors and the 
 data 
 is logged in weewx database.

 [[sensor_map]]

 ampere = current.***.EfPacket
 linevoltage = payload5.*.RadioHeadASKPacket

 the database have these columns which we created

 consumption
 ampere
 linevoltage
 pf

 we want to calculate the energy consumption so we added this correction 

 [StdCalibrate] 

 [[Corrections]]
 # For each type, an arbitrary calibration expression can be 
 given.
 # It should be in the units defined in the StdConvert section.
 # Example:
 foo = foo + 0.2
 pf = 0.88
 consumption = ((ampere * linevoltage) /1000) * pf

 unfortunately weewx did nothing nor it complained about it. can weewx 
 process such formula?

 thanks

 -- 
 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.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/weewx-user/26effb7c-ad33-4de8-a9a0-f1390012ec5an%40googlegroups.com
  
 
 .

>>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/a61c9c6e-fc72-4c29-a100-4d73c886a25cn%40googlegroups.com.


Re: [weewx-user] can not get weewx to process this formula

2023-10-17 Thread Mks Mk
from database

dateTime usUnits interval consumption  ampere   
 linevoltage  pf
1697583060 1190.8423  141   
0.9
1697583120 11110.3686667  141   
0.9
1697583180 1177.5177  140.5   
0.9
1697583240 11101.484  141   
0.9
1697583300 11100.0026667  141   
0.9
1697583360 114.97767  141   
0.9
1697583420 114.90767   142 
  0.9
1697583480 114.92767   141.5   
0.9
1697583540 114.886  141.333 
  0.9
1697583600 114.86767  141   
 0.9
1697583660 114.87767  141   
 0.9
1697583720 1178.9453  141   
 0.9
1697583780 1190.2617 
 140.667 0.9


On Wednesday, October 18, 2023 at 3:35:05 AM UTC+3 Mks Mk wrote:

> Hi Gary
>
> it all started here
> https://groups.google.com/g/weewx-user/c/ltOVkcY1fKc/m/7sQSVGN_AQAJ
>
> we were using fixed value for the incoming grid line to calculate the 
> consumption but it was not accurate enough so we added new sensor to read 
> the grid incoming line voltage.
> earlier this formula worked consumption = ampere * 117 / 1000 * 0.88
> but  consumption = ampere * linevoltage / 1000 * 0.88 did not work
> the linevoltage input comes from different sensor than ampere,  these two 
> reading are generated in different loops, so based on Tom advice the weewx 
> correction will not work
> thank you
>
> On Wednesday, October 18, 2023 at 1:28:55 AM UTC+3 gjr80 wrote:
>
>> So what does
>>
>> consumption = ((ampere * linevoltage) /1000) * 0.88
>>
>> do?
>>
>> Gary
>> On Wednesday, 18 October 2023 at 08:26:25 UTC+10 mksm...@gmail.com wrote:
>>
>>> Hi Tom
>>>
>>> we run weewx directly and found that 'ampere' & 'linevoltage' are in 
>>> different loop because the data are coming from two different sensors by 
>>> sdr.py driver.
>>> how we can combine these loops into one so weewx can process this 
>>> formula, or what can we do to get this calculation done.?
>>>
>>> Thank you for your support
>>>
>>> On Tuesday, October 17, 2023 at 9:26:38 PM UTC+3 Tom Keffer wrote:
>>>
 The only symbols that can be used in the [[Corrections]] formula are 
 other types in the archive record. So unless 'ampere', 'linevoltage', and 
 'pf' all appear in the record, the correction will not work.

 On Tue, Oct 17, 2023 at 9:48 AM Mks Mk  wrote:

> we want to improve the accuracy of our home energy monitor and we 
> added new sensor to read the main line voltage so we got two sensors and 
> the data is logged in weewx database.
>
> [[sensor_map]]
>
> ampere = current.***.EfPacket
> linevoltage = payload5.*.RadioHeadASKPacket
>
> the database have these columns which we created
>
> consumption
> ampere
> linevoltage
> pf
>
> we want to calculate the energy consumption so we added this 
> correction 
>
> [StdCalibrate] 
>
> [[Corrections]]
> # For each type, an arbitrary calibration expression can be 
> given.
> # It should be in the units defined in the StdConvert section.
> # Example:
> foo = foo + 0.2
> pf = 0.88
> consumption = ((ampere * linevoltage) /1000) * pf
>
> unfortunately weewx did nothing nor it complained about it. can weewx 
> process such formula?
>
> thanks
>
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/26effb7c-ad33-4de8-a9a0-f1390012ec5an%40googlegroups.com
>  
> 
> .
>


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/fa342793-222a-4773-9bde-5bf97cf88dddn%40googlegroups.com.


Re: [weewx-user] can not get weewx to process this formula

2023-10-17 Thread Tom Keffer
Just had a thought.

I assume that weewxd is using software record generation. Check in the log.
If so, [[Corrections]] does not apply the corrections to archive records
because, in theory, the correction should have already been applied in the
LOOP packets. Obviously that's not happening here.

I've created issue #895  to
track.

In the meantime, what you can do is create a simple service
 to do the
calculation. It would look something like this (NOT TESTED):

from weewx.engine import StdService

class Power(StdService):

  def __init__(self, engine, config_dict):
super(Power, self).__init__(engine, config_dict)

self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)

  def new_archive_record(self, event)
ampere = event.record.get('ampere')
linevoltage = event.record.get('linevoltage')
if ampere is not None and linevoltage is not None:
  event.record['consumption'] = ampere * linevoltage
else:
  event.record['consumption'] = None

This will work provided that linevoltage and ampere do not vary too much
over the archive interval. Because you are using short intervals (60
seconds), this is probably not much of a problem.







On Tue, Oct 17, 2023 at 6:12 PM Mks Mk  wrote:

> from database
>
> dateTime usUnits interval consumption  ampere
>  linevoltage  pf
> 1697583060 1190.8423  141
> 0.9
> 1697583120 11110.3686667  141
> 0.9
> 1697583180 1177.5177
>  140.5   0.9
> 1697583240 11101.484  141
> 0.9
> 1697583300 11100.0026667  141
> 0.9
> 1697583360 114.97767  141
> 0.9
> 1697583420 114.90767   142
> 0.9
> 1697583480 114.92767   141.5
>   0.9
> 1697583540 114.886
>  141.333   0.9
> 1697583600 114.86767  141
>  0.9
> 1697583660 114.87767  141
>  0.9
> 1697583720 1178.9453  141
>  0.9
> 1697583780 1190.2617
>  140.667 0.9
>
>
> On Wednesday, October 18, 2023 at 3:35:05 AM UTC+3 Mks Mk wrote:
>
>> Hi Gary
>>
>> it all started here
>> https://groups.google.com/g/weewx-user/c/ltOVkcY1fKc/m/7sQSVGN_AQAJ
>>
>> we were using fixed value for the incoming grid line to calculate the
>> consumption but it was not accurate enough so we added new sensor to read
>> the grid incoming line voltage.
>> earlier this formula worked consumption = ampere * 117 / 1000 * 0.88
>> but  consumption = ampere * linevoltage / 1000 * 0.88 did not work
>> the linevoltage input comes from different sensor than ampere,  these
>> two reading are generated in different loops, so based on Tom advice the
>> weewx correction will not work
>> thank you
>>
>> On Wednesday, October 18, 2023 at 1:28:55 AM UTC+3 gjr80 wrote:
>>
>>> So what does
>>>
>>> consumption = ((ampere * linevoltage) /1000) * 0.88
>>>
>>> do?
>>>
>>> Gary
>>> On Wednesday, 18 October 2023 at 08:26:25 UTC+10 mksm...@gmail.com
>>> wrote:
>>>
 Hi Tom

 we run weewx directly and found that 'ampere' & 'linevoltage' are in
 different loop because the data are coming from two different sensors by
 sdr.py driver.
 how we can combine these loops into one so weewx can process this
 formula, or what can we do to get this calculation done.?

 Thank you for your support

 On Tuesday, October 17, 2023 at 9:26:38 PM UTC+3 Tom Keffer wrote:

> The only symbols that can be used in the [[Corrections]] formula are
> other types in the archive record. So unless 'ampere', 'linevoltage', and
> 'pf' all appear in the record, the correction will not work.
>
> On Tue, Oct 17, 2023 at 9:48 AM Mks Mk  wrote:
>
>> we want to improve the accuracy of our home energy monitor and we
>> added new sensor to read the main line voltage so we got two sensors and
>> the data is logged in weewx database.
>>
>> [[sensor_map]]
>>
>> ampere = current.***.EfPacket
>> linevoltage = payload5.*.RadioHeadASKPacket
>>
>> the database have these columns which we created
>>
>> consumption
>> ampere
>> linevoltage
>> pf
>>
>> we want to calculate the energy consumption so we added this
>> correction
>>
>> [StdCalibrate]
>>
>> [[Corrections]]
>> # For each type, an arbitrary calibration expression can be
>> given.
>>  

Re: [weewx-user] can not get weewx to process this formula

2023-10-17 Thread Mks Mk
there is nothing in the log file related to the correction

we tried the service but it failed twice

1st run failed with error:

Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__: File 
"/usr/share/weewx/user/myservice.py", line 10
Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__:   def 
new_archive_record(self, event)
Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__:  
^
Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__:  
 SyntaxError: invalid syntax
Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__:   Exiting.

changed to

def new_archive_record(self, event):

run weewx again but failed with error


Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__: File 
"/usr/share/weewx/weewxd", line 148, in main
Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:   engine 
= weewx.engine.StdEngine(config_dict)
Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__: File 
"/usr/share/weewx/weewx/engine.py", line 93, in __init__
Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:  
 self.loadServices(config_dict)
Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__: File 
"/usr/share/weewx/weewx/engine.py", line 161, in loadServices
Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:   obj = 
weeutil.weeutil.get_object(svc)(self, config_dict)
Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__: File 
"/usr/share/weewx/user/myservice.py", line 8, in __init__
Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:  
 self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:   NameError: 
name 'weewx' is not defined
Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:   Exiting.

On Wednesday, October 18, 2023 at 4:42:59 AM UTC+3 Tom Keffer wrote:

> Just had a thought. 
>
> I assume that weewxd is using software record generation. Check in the 
> log. If so, [[Corrections]] does not apply the corrections to archive 
> records because, in theory, the correction should have already been applied 
> in the LOOP packets. Obviously that's not happening here.
>
> I've created issue #895  to 
> track.
>
> In the meantime, what you can do is create a simple service 
>  to do the 
> calculation. It would look something like this (NOT TESTED):
>
> from weewx.engine import StdService
>
> class Power(StdService):
>
>   def __init__(self, engine, config_dict):
> super(Power, self).__init__(engine, config_dict)
>
> self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
>
>   def new_archive_record(self, event)
> ampere = event.record.get('ampere')
> linevoltage = event.record.get('linevoltage')
> if ampere is not None and linevoltage is not None:
>   event.record['consumption'] = ampere * linevoltage
> else:
>   event.record['consumption'] = None
>
> This will work provided that linevoltage and ampere do not vary too much 
> over the archive interval. Because you are using short intervals (60 
> seconds), this is probably not much of a problem.
> 
>
>
>
>
>
>
> On Tue, Oct 17, 2023 at 6:12 PM Mks Mk  wrote:
>
>> from database
>>
>> dateTime usUnits interval consumption  ampere   
>>  linevoltage  pf
>> 1697583060 1190.8423  141   
>> 0.9
>> 1697583120 11110.3686667  141   
>> 0.9
>> 1697583180 1177.5177 
>>  140.5   0.9
>> 1697583240 11101.484  141   
>> 0.9
>> 1697583300 11100.0026667  141   
>> 0.9
>> 1697583360 114.97767  141   
>> 0.9
>> 1697583420 114.90767   142   
>> 0.9
>> 1697583480 114.92767   141.5 
>>   0.9
>> 1697583540 114.886 
>>  141.333   0.9
>> 1697583600 114.86767  141   
>>  0.9
>> 1697583660 114.87767  141   
>>  0.9
>> 1697583720 1178.9453  141   
>>  0.9
>> 1697583780 1190.2617 
>>  140.667 0.9
>>
>>
>> On Wednesday, October 18, 2023 at 3:35:05 AM UTC+3 Mks Mk wrote:
>>
>>> Hi Gary
>>>
>>> it all started here
>>> https://groups.google.com/g/weewx-user/c/ltOVkcY1fKc/m/7sQSVGN_AQAJ
>>>
>>> we were using fixed value for the incoming grid line to calculate the 
>>> consumption but it was no

Re: [weewx-user] can not get weewx to process this formula

2023-10-17 Thread Mks Mk

added import weewx to the top of file
it worked

On Wednesday, October 18, 2023 at 6:50:58 AM UTC+3 Mks Mk wrote:

> there is nothing in the log file related to the correction
>
> we tried the service but it failed twice
>
> 1st run failed with error:
>
> Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__: File 
> "/usr/share/weewx/user/myservice.py", line 10
> Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__:   def 
> new_archive_record(self, event)
> Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__:  
> ^
> Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__:  
>  SyntaxError: invalid syntax
> Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__:   Exiting.
>
> changed to
>
> def new_archive_record(self, event):
>
> run weewx again but failed with error
>
>
> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__: File 
> "/usr/share/weewx/weewxd", line 148, in main
> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:   engine 
> = weewx.engine.StdEngine(config_dict)
> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__: File 
> "/usr/share/weewx/weewx/engine.py", line 93, in __init__
> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:  
>  self.loadServices(config_dict)
> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__: File 
> "/usr/share/weewx/weewx/engine.py", line 161, in loadServices
> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:   obj = 
> weeutil.weeutil.get_object(svc)(self, config_dict)
> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__: File 
> "/usr/share/weewx/user/myservice.py", line 8, in __init__
> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:  
>  self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:   NameError: 
> name 'weewx' is not defined
> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:   Exiting.
>
> On Wednesday, October 18, 2023 at 4:42:59 AM UTC+3 Tom Keffer wrote:
>
>> Just had a thought. 
>>
>> I assume that weewxd is using software record generation. Check in the 
>> log. If so, [[Corrections]] does not apply the corrections to archive 
>> records because, in theory, the correction should have already been applied 
>> in the LOOP packets. Obviously that's not happening here.
>>
>> I've created issue #895  to 
>> track.
>>
>> In the meantime, what you can do is create a simple service 
>>  to do the 
>> calculation. It would look something like this (NOT TESTED):
>>
>> from weewx.engine import StdService
>>
>> class Power(StdService):
>>
>>   def __init__(self, engine, config_dict):
>> super(Power, self).__init__(engine, config_dict)
>>
>> self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
>>
>>   def new_archive_record(self, event)
>> ampere = event.record.get('ampere')
>> linevoltage = event.record.get('linevoltage')
>> if ampere is not None and linevoltage is not None:
>>   event.record['consumption'] = ampere * linevoltage
>> else:
>>   event.record['consumption'] = None
>>
>> This will work provided that linevoltage and ampere do not vary too much 
>> over the archive interval. Because you are using short intervals (60 
>> seconds), this is probably not much of a problem.
>> 
>>
>>
>>
>>
>>
>>
>> On Tue, Oct 17, 2023 at 6:12 PM Mks Mk  wrote:
>>
>>> from database
>>>
>>> dateTime usUnits interval consumption  ampere   
>>>  linevoltage  pf
>>> 1697583060 1190.8423 
>>>  141   0.9
>>> 1697583120 11110.3686667 
>>>  141   0.9
>>> 1697583180 1177.5177 
>>>  140.5   0.9
>>> 1697583240 11101.484 
>>>  141   0.9
>>> 1697583300 11100.0026667 
>>>  141   0.9
>>> 1697583360 114.97767 
>>>  141   0.9
>>> 1697583420 114.90767   142 
>>>   0.9
>>> 1697583480 114.92767   141.5   
>>> 0.9
>>> 1697583540 114.886 
>>>  141.333   0.9
>>> 1697583600 114.86767 
>>>  1410.9
>>> 1697583660 114.87767 
>>>  1410.9
>>> 1697583720 1178.9453 
>>>  1410.9
>>> 1697583780 1190.2617 
>>>  140.667 0.9
>>>
>>>
>>> On Wednesday, Oc

Re: [weewx-user] can not get weewx to process this formula

2023-10-17 Thread Mks Mk
Thank you Tom
the service file is doing exactly what we needed.

GOD bless you

On Wednesday, October 18, 2023 at 7:01:27 AM UTC+3 Mks Mk wrote:

>
> added import weewx to the top of file
> it worked
>
> On Wednesday, October 18, 2023 at 6:50:58 AM UTC+3 Mks Mk wrote:
>
>> there is nothing in the log file related to the correction
>>
>> we tried the service but it failed twice
>>
>> 1st run failed with error:
>>
>> Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__: File 
>> "/usr/share/weewx/user/myservice.py", line 10
>> Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__:   def 
>> new_archive_record(self, event)
>> Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__:    
>>   ^
>> Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__:  
>>  SyntaxError: invalid syntax
>> Oct 18 06:37:20 debian weewx[3413] CRITICAL __main__:   Exiting.
>>
>> changed to
>>
>> def new_archive_record(self, event):
>>
>> run weewx again but failed with error
>>
>>
>> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__: File 
>> "/usr/share/weewx/weewxd", line 148, in main
>> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:  
>>  engine = weewx.engine.StdEngine(config_dict)
>> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__: File 
>> "/usr/share/weewx/weewx/engine.py", line 93, in __init__
>> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:  
>>  self.loadServices(config_dict)
>> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__: File 
>> "/usr/share/weewx/weewx/engine.py", line 161, in loadServices
>> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:   obj = 
>> weeutil.weeutil.get_object(svc)(self, config_dict)
>> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__: File 
>> "/usr/share/weewx/user/myservice.py", line 8, in __init__
>> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:  
>>  self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
>> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:  
>>  NameError: name 'weewx' is not defined
>> Oct 18 06:42:20 debian weewx[3603] CRITICAL __main__:   Exiting.
>>
>> On Wednesday, October 18, 2023 at 4:42:59 AM UTC+3 Tom Keffer wrote:
>>
>>> Just had a thought. 
>>>
>>> I assume that weewxd is using software record generation. Check in the 
>>> log. If so, [[Corrections]] does not apply the corrections to archive 
>>> records because, in theory, the correction should have already been applied 
>>> in the LOOP packets. Obviously that's not happening here.
>>>
>>> I've created issue #895  to 
>>> track.
>>>
>>> In the meantime, what you can do is create a simple service 
>>>  to do the 
>>> calculation. It would look something like this (NOT TESTED):
>>>
>>> from weewx.engine import StdService
>>>
>>> class Power(StdService):
>>>
>>>   def __init__(self, engine, config_dict):
>>> super(Power, self).__init__(engine, config_dict)
>>>
>>> self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
>>>
>>>   def new_archive_record(self, event)
>>> ampere = event.record.get('ampere')
>>> linevoltage = event.record.get('linevoltage')
>>> if ampere is not None and linevoltage is not None:
>>>   event.record['consumption'] = ampere * linevoltage
>>> else:
>>>   event.record['consumption'] = None
>>>
>>> This will work provided that linevoltage and ampere do not vary too much 
>>> over the archive interval. Because you are using short intervals (60 
>>> seconds), this is probably not much of a problem.
>>> 
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Tue, Oct 17, 2023 at 6:12 PM Mks Mk  wrote:
>>>
 from database

 dateTime usUnits interval consumption  ampere   
  linevoltage  pf
 1697583060 1190.8423 
  141   0.9
 1697583120 11110.3686667 
  141   0.9
 1697583180 1177.5177 
  140.5   0.9
 1697583240 11101.484 
  141   0.9
 1697583300 11100.0026667 
  141   0.9
 1697583360 114.97767 
  141   0.9
 1697583420 114.90767   142 
   0.9
 1697583480 114.92767   141.5   
 0.9
 1697583540 114.886 
  141.333   0.9
 1697583600 114.86767 
  1410.9
 1697583660 114.