[weewx-user] import of driver failed: (22, 'Invalid argument') ()

2019-04-25 Thread Ramesh Rasappan
Noob here, using MISOL WS-2310-1 station with a console (from Aliexpress), 
the console works well and I can plug it to my computer to the upload data 
to wunderground. However, I can't get it working with weewx

OS: Raspbian GNU/Linux 9 (stretch)
Python 2.7.13

*$* lsusb

Bus 001 Device 008: ID 10c4:8468 Cygnal Integrated Products, Inc.

*$* dmesg


[35580.273646] usb 1-1.2: New USB device found, idVendor=10c4, idProduct=
8468

[35580.273660] usb 1-1.2: New USB device strings: Mfr=1, Product=2, 
SerialNumber=0

[35580.273670] usb 1-1.2: Product: HIDtoSPI Slave

[35580.273678] usb 1-1.2: Manufacturer: SLAB

[35580.278854] hid-generic 0003:10C4:8468.0007: hiddev96,hidraw2: USB HID v1
.01 Device [SLAB HIDtoSPI Slave] on usb-3f98.usb-1.2/input0

[35651.157879] *Under-voltage detected! (0x00050005)*

[35655.317883] Voltage normalised (0x)

*$* sudo tail -f /var/log/syslog

Apr 26 06:38:42 raspberrypi kernel: [35580.273670] usb 1-1.2: Product: 
HIDtoSPI Slave

Apr 26 06:38:42 raspberrypi kernel: [35580.273678] usb 1-1.2: Manufacturer:
 SLAB

Apr 26 06:38:42 raspberrypi kernel: [35580.278854] hid-generic 0003:10C4:
8468.0007: hiddev96,hidraw2: USB HID v1.01 Device [SLAB HIDtoSPI Slave] on 
usb-3f98.usb-1.2/input0

Apr 26 06:38:42 raspberrypi mtp-probe: checking bus 1, device 11: 
"/sys/devices/platform/soc/3f98.usb/usb1/1-1/1-1.2"

Apr 26 06:38:42 raspberrypi mtp-probe: bus: 1, device: 11 was not an MTP 
device

Apr 26 06:39:01 raspberrypi CRON[3503]: (root) CMD (  [ -x /usr/lib/php/
sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/
sessionclean; fi)

Apr 26 06:39:41 raspberrypi systemd[1]: Starting Clean php session files...

Apr 26 06:39:42 raspberrypi systemd[1]: Started Clean php session files.

Apr 26 06:39:53 raspberrypi kernel: [35651.157879] Under-voltage detected! (
0x00050005)

Apr 26 06:39:57 raspberrypi kernel: [35655.317883] Voltage normalised (
0x)


*$* sudo PYTHONPATH=. python weewx/drivers/ws23xx.py --port 
/dev/usb/hiddev0 --readings

Traceback (most recent call last):

  File "weewx/drivers/ws23xx.py", line 2118, in 

with WS23xx(port) as s:

  File "weewx/drivers/ws23xx.py", line 648, in __init__

self.serial_port = LinuxSerialPort(port)

  File "weewx/drivers/ws23xx.py", line 908, in __init__

self.orig_settings = tty.tcgetattr(self.serial_port)

termios.error: (22, 'Invalid argument')

*$* sudo weewxd /etc/weewx/weewx.conf

*$* sudo tail -f /var/log/syslog

Apr 26 06:45:35 raspberrypi weewx[3629]: engine: Initializing weewx version 
3.9.1

Apr 26 06:45:35 raspberrypi weewx[3629]: engine: Using Python 2.7.13 
(default, Sep 26 2018, 18:42:22) #012[GCC 6.3.0 20170516]

Apr 26 06:45:35 raspberrypi weewx[3629]: engine: Platform 
Linux-4.14.79-v7+-armv7l-with-debian-9.4

Apr 26 06:45:35 raspberrypi weewx[3629]: engine: Locale is 'en_IN'

Apr 26 06:45:35 raspberrypi weewx[3629]: engine: Using configuration file 
/etc/weewx/weewx.conf

Apr 26 06:45:35 raspberrypi weewx[3629]: engine: Loading station type 
WS23xx (weewx.drivers.ws23xx)

Apr 26 06:45:35 raspberrypi weewx[3629]: ws23xx: driver version is 0.27

Apr 26 06:45:35 raspberrypi weewx[3629]: ws23xx: serial port is 
/dev/usb/hiddev0

Apr 26 06:45:35 raspberrypi weewx[3629]: ws23xx: polling interval is None

Apr 26 06:45:35 raspberrypi weewx[3629]: import of driver failed: (22, 
'Invalid argument') ()

Apr 26 06:45:35 raspberrypi weewx[3629]: engine: Unable to load driver: 
(22, 'Invalid argument')

Apr 26 06:45:35 raspberrypi weewx[3629]:   Exiting...

Apr 26 06:45:53 raspberrypi kernel: [36010.997127] Under-voltage detected! 
(0x00050005)

Apr 26 06:45:57 raspberrypi kernel: [36015.157095] Voltage normalised 
(0x)

the port that I'm using is 
/dev/usb/hiddev0

I don't see anything like (even for usb keyboard, etc)
/dev/ttyusbx


I don't know if the port is an issue here? any suggest would be great!

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread Rich Bell
It’s software, so almost anything is possible :)
Is the use case that the same “field name” might be in different topics?
Something like this, topic indoor/temp maps to inTemp and outdoor/temp maps
to outTemp.  If so, I’d probably add an option to concatenate the topic
into the field name and use the current mapping functionality. This would
mean that all input would need a mapping, because all “field names” would
be prepended with the higher/parent topic.
But, with that said, my focus is on adding tests to the test suite before
adding more functionality.
- rich

On Thu, Apr 25, 2019 at 4:42 PM Eugen66  wrote:

> I was missing ' at the unit selection...
>
> Thank you so much :)
> I was wondering, is it possible  for instance to have a "mapping" in the
> conf file to map values to specific and different topics, inTemp =
> sensor/inTemp , outTemp= Weather/outTemp as an example?
>
> best regards
> Atle
>
>
> torsdag 25. april 2019 21.45.54 UTC+2 skrev bell...@gmail.com følgende:
>>
>> I was just going to ask about the password. After the problem with
>> keepalive, I was afraid this bug would show up. My guess is that I need to
>> convert the payload to float. If you want to try patching it, around line
>> 208 change from
>>
>> data[self.label_map.get(key,key)] = msg.payload
>>
>> to
>>
>> data[self.label_map.get(key,key)] = to_float(msg.payload)
>>
>>
>> Right now I don’t have a great environment for the “individual”  payload
>> type, so it will take a bit to really dig in on this.
>>
>> Thanks for your help. Rich
>>
>> On Thu, Apr 25, 2019 at 3:30 PM Eugen66  wrote:
>>
>>> Sorrry :( My bad...Found the mqtt disconnected with result code 5...
>>> Wrong passwd i conf.
>>> So now it connect and find the data, but Weewx exit's with this:
>>>
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing interval:
>>> 1556220434.00 1556220467.00
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Queue size is: 6
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing:
>>> dateTime: 1556220439.64, extraTemp2: 13.5, usUnits: 1
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: engine: Main loop exiting.
>>> Shutting engine down.
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: restx: Shut down MQTT thread.
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Disconnected with
>>> result code 0
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: shutdown
>>> process rtl_433 -M utc -F json -G
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting for
>>> stdout-thread
>>> Apr 25 21:27:52 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting for
>>> stderr-thread
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: timed out
>>> waiting for stderr-thread
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close stdout
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close stderr
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: engine: Caught unrecoverable
>>> exception in engine:
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   accum:
>>> ScalarStats.addHiLo expected float or int, got 13.5
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   Traceback (most
>>> recent call last):
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/weewx/engine.py", line 890, in main
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   engine.run()
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/weewx/engine.py", line 191, in run
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: 
>>> self.dispatchEvent(weewx.Event(weewx.NEW_LOOP_PACKET, packet=packet))
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   callback(event)
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/user/MQTTSubscribe.py", line 309, in new_loop_packet
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   target_data =
>>> self._process_data(start_ts, self.end_ts, event.packet)
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/user/MQTTSubscribe.py", line 289, in _process_data
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: 
>>> accumulator.addRecord(archive_data)
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/weewx/accum.py", line 256, in addRecord
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   func(self,
>>> record, obs_type, add_hilo, weight)
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/weewx/accum.py", line 314, in add_value
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: 
>>> self[obs_type].addHiLo(val, record['dateTime'])
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/weewx/accum.py", line 77, in 

[weewx-user] Any true step by step for Interceptor

2019-04-25 Thread Douglas Krug
I'm back struggling with this again. Still cannot get any results from it.
Tried a year ago to get data from my old Acurite smartHUB. Back then I had 
more options than I do today, now that the server is shut down, 
and still couldn't get it to work. I finally gave up and bought an Ambient 
Weather 900-IP station. Had very little trouble getting that to work with 
Pat O'Brien's socket logger
and my Observer IP bridge.

Today, I'd like to send my Acurite smartHUB to my Dad and setup the RPi 
image for him. I'm OK with using a separate router, I'll configure it and 
send that to him as well.
That's how I did it with Socket Logger and the Observer IP bridge, but with 
Acurite, I cannot get anything out of Interceptor. I'm not understanding 
how so many people are getting
it to work, but I can't get anything from it. Worked at it for two weeks 
the first time round, and I've been plugging away for two days this time 
around.

Here's what works:

I have a DD-WRT flashed router with the WLAN  in client mode to join my 
main WiFi router where the RPi Zero W is connected, and I have the IP 
reserved for the Acurite smartHUB in the second router I've tried using Pat 
O'Brien's firewall so the data from the Acurite smartHUB is sent to the 
RPi. Works with the Observer IP bridge, so I can't
understand why it wouldn't work here.


iptables -t nat -A PREROUTING -s [Acurite smartHUB] -p tcp --dport 80 -j 
DNAT --to-destination [Raspberry Pi]: iptables -t nat -A POSTROUTING -j 
MASQUERADE

I see no results from this. I've tried port 80, 800, 8080, 2999, and  
for the destination.

I have installed the Interceptor plugin on weewx and configured it.

station_type = Interceptor

[Interceptor]
driver = user.interceptor
device_type = acurite-bridge
port = 



I have, to the best of my knowledge, configured the DD-WRT to 
forward hubapi.myacurite.com and www.acu-link.com to the RPi IP address.
I'm exhausted from this and would really like a detailed step by step to 
help me if someone can do that. Seems people really want to help, but 
there's
always a part where I get the "just do that" type of instruction and I'm 
lost.

Here's what I see from the Acurite smartHUB, so I know it's working.

[image: Acurite Hub.png]


Here's a video I followed for DNS resolution setup on the DD-WRT and what I 
entered.

[image: DD-WRT dns forwarding.png]


I'm obviously doing something wrong over and over again, but in all the 
parts and possible combinations, I'm really lost as to where the issue is.

Can really use some step by step help and a simple method to confirm that 
each of the component parts is configured correctly. I've been using tail 
-f /var/log/syslog
to view the logs, and while that has been helpful, it's shown me that 
either there's a port conflict or that I'm not getting any result from 
weewx, which is where I'm at now. 





   

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] WeeWX interceptor: Froggit WH6000 and wu-client

2019-04-25 Thread oriol . garrote


Hello,

I'm a newbie with WeeWX. I'm trying to capture the data from my new WH6000 
from Froggit (I can assume is a Fine Offset but I'm not sure). Its console 
sends data directly to WU using rtupdate.wunderground.com, so I think that 
the interceptor with device=wu-client should read its data but I'm having 
problems configuring this.


I have some questions: The unique example for wu-client is in mode sniff 
and interface eth0. I'm setting up weewx on a RaspberryPi 3 B+, so the 
interface I'm trying to use is wlan0. I try to test it with this command:


PYTHONPATH=bin python bin/user/interceptor.py --device=wu-client --mode=sniff 
--iface=wlan0 --filter="src 192.168.1.105 and dst port 80"

But I'm getting this error:


Exception: wlan0: You don't have permission to capture on that device 
(socket: Operation not permitted)

Does this mean that I should use eth0 always?


Should I always try sniff? In listen mode won't it work? What port should I 
use? I've tried it with listen but I'm getting another error:


PYTHONPATH=bin python bin/user/interceptor.py --device=wu-client --mode=listen 
--port=80
File "/usr/lib/python2.7/socket.py", line 228, in meth return getattr(self.
_sock,name)(*args) socket.error: [Errno 13] Permission denied


I'm stuck with this. What should i try?
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread Rich Bell
Looks like a documentation error. Try
unit_system = METRIC
Sorry about that. -rich

On Thu, Apr 25, 2019 at 5:03 PM Eugen66  wrote:

> Thank you so much :)
>
> I have tried all the option for Units for MQTT but it seems that it does
> not change...
>
> I was wondering, is it possible  for instance to have a "mapping" in the
> conf file to map values to specific and different topics, inTemp =
> sensor/inTemp , outTemp= Weather/outTemp as an example?
>
> best regards
> Atle
>
> torsdag 25. april 2019 21.45.54 UTC+2 skrev bell...@gmail.com følgende:
>>
>> I was just going to ask about the password. After the problem with
>> keepalive, I was afraid this bug would show up. My guess is that I need to
>> convert the payload to float. If you want to try patching it, around line
>> 208 change from
>>
>> data[self.label_map.get(key,key)] = msg.payload
>>
>> to
>>
>> data[self.label_map.get(key,key)] = to_float(msg.payload)
>>
>>
>> Right now I don’t have a great environment for the “individual”  payload
>> type, so it will take a bit to really dig in on this.
>>
>> Thanks for your help. Rich
>>
>> On Thu, Apr 25, 2019 at 3:30 PM Eugen66  wrote:
>>
>>> Sorrry :( My bad...Found the mqtt disconnected with result code 5...
>>> Wrong passwd i conf.
>>> So now it connect and find the data, but Weewx exit's with this:
>>>
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing interval:
>>> 1556220434.00 1556220467.00
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Queue size is: 6
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing:
>>> dateTime: 1556220439.64, extraTemp2: 13.5, usUnits: 1
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: engine: Main loop exiting.
>>> Shutting engine down.
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: restx: Shut down MQTT thread.
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Disconnected with
>>> result code 0
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: shutdown
>>> process rtl_433 -M utc -F json -G
>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting for
>>> stdout-thread
>>> Apr 25 21:27:52 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting for
>>> stderr-thread
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: timed out
>>> waiting for stderr-thread
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close stdout
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close stderr
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: engine: Caught unrecoverable
>>> exception in engine:
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   accum:
>>> ScalarStats.addHiLo expected float or int, got 13.5
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   Traceback (most
>>> recent call last):
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/weewx/engine.py", line 890, in main
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   engine.run()
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/weewx/engine.py", line 191, in run
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: 
>>> self.dispatchEvent(weewx.Event(weewx.NEW_LOOP_PACKET, packet=packet))
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   callback(event)
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/user/MQTTSubscribe.py", line 309, in new_loop_packet
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   target_data =
>>> self._process_data(start_ts, self.end_ts, event.packet)
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/user/MQTTSubscribe.py", line 289, in _process_data
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: 
>>> accumulator.addRecord(archive_data)
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/weewx/accum.py", line 256, in addRecord
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   func(self,
>>> record, obs_type, add_hilo, weight)
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/weewx/accum.py", line 314, in add_value
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: 
>>> self[obs_type].addHiLo(val, record['dateTime'])
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
>>> "/usr/share/weewx/weewx/accum.py", line 77, in addHiLo
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   raise
>>> ValueError("accum: ScalarStats.addHiLo expected float or int, got %s" % val)
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   ValueError: accum:
>>> ScalarStats.addHiLo expected float or int, got 13.5
>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   Exiting.
>>>
>>> rgds
>>> Atle
>>>
>>>
>>>
>>> torsdag 25. april 2019 19.47.23 UTC+2 

Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread Eugen66
Thank you so much :)

I have tried all the option for Units for MQTT but it seems that it does 
not change...

I was wondering, is it possible  for instance to have a "mapping" in the 
conf file to map values to specific and different topics, inTemp = 
sensor/inTemp , outTemp= Weather/outTemp as an example?

best regards
Atle

torsdag 25. april 2019 21.45.54 UTC+2 skrev bell...@gmail.com følgende:
>
> I was just going to ask about the password. After the problem with 
> keepalive, I was afraid this bug would show up. My guess is that I need to 
> convert the payload to float. If you want to try patching it, around line 
> 208 change from
>
> data[self.label_map.get(key,key)] = msg.payload
>
> to
>
> data[self.label_map.get(key,key)] = to_float(msg.payload)
>
>
> Right now I don’t have a great environment for the “individual”  payload 
> type, so it will take a bit to really dig in on this.
>
> Thanks for your help. Rich
>
> On Thu, Apr 25, 2019 at 3:30 PM Eugen66 > 
> wrote:
>
>> Sorrry :( My bad...Found the mqtt disconnected with result code 5... 
>> Wrong passwd i conf.
>> So now it connect and find the data, but Weewx exit's with this:
>>
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing interval: 
>> 1556220434.00 1556220467.00
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Queue size is: 6
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing: dateTime: 
>> 1556220439.64, extraTemp2: 13.5, usUnits: 1
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: engine: Main loop exiting. 
>> Shutting engine down.
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: restx: Shut down MQTT thread.
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Disconnected with 
>> result code 0
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: shutdown 
>> process rtl_433 -M utc -F json -G
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting for 
>> stdout-thread
>> Apr 25 21:27:52 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting for 
>> stderr-thread
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: timed out 
>> waiting for stderr-thread
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close stdout
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close stderr
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: engine: Caught unrecoverable 
>> exception in engine:
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   accum: 
>> ScalarStats.addHiLo expected float or int, got 13.5
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   Traceback (most 
>> recent call last):
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/weewx/engine.py", line 890, in main
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   engine.run()
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/weewx/engine.py", line 191, in run
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   
>> self.dispatchEvent(weewx.Event(weewx.NEW_LOOP_PACKET, packet=packet))
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   callback(event)
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/user/MQTTSubscribe.py", line 309, in new_loop_packet
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   target_data = 
>> self._process_data(start_ts, self.end_ts, event.packet)
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/user/MQTTSubscribe.py", line 289, in _process_data
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   
>> accumulator.addRecord(archive_data)
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/weewx/accum.py", line 256, in addRecord
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   func(self, 
>> record, obs_type, add_hilo, weight)
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/weewx/accum.py", line 314, in add_value
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   
>> self[obs_type].addHiLo(val, record['dateTime'])
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/weewx/accum.py", line 77, in addHiLo
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   raise 
>> ValueError("accum: ScalarStats.addHiLo expected float or int, got %s" % val)
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   ValueError: accum: 
>> ScalarStats.addHiLo expected float or int, got 13.5
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   Exiting.
>>
>> rgds
>> Atle
>>
>>
>>
>> torsdag 25. april 2019 19.47.23 UTC+2 skrev Rich Bell følgende:
>>>
>>> I think i am not handling the options correctly and the keepalive is a 
>>> string and not an integer. For now, leave it out of weewx.conf and let it 
>>> default 

Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread Eugen66
Thanks :)
That moved it on...
It's  running ;) but seems that I can't change or set the unit to metric :
 # Units for MQTT payloads without unit value
unit_system_name = METRIC  # US or 'METRIC' or 'METRICWX'
>From the log:

Apr 25 22:27:25 weewx-hyggebu weewx[4449]: MQTTSS: Processing: dateTime: 
1556224039.79, extraTemp2: 13.4, usUnits: 1
Apr 25 22:27:25 weewx-hyggebu weewx[4449]: MQTTSS: Processing: dateTime: 
1556224039.89, outHumidity: 32.6, usUnits: 1
Apr 25 22:27:25 weewx-hyggebu weewx[4449]: MQTTSS: Data prior to conversion 
is: dateTime: 1556224042, extraTemp2: 13.4, outHumidity: 32.6, usUnits: 1
Apr 25 22:27:25 weewx-hyggebu weewx[4449]: MQTTSS: Data after to conversion 
is: dateTime: 1556224042, extraTemp2: -10.33, outHumidity: 32.6, 
usUnits: 16
Apr 25 22:27:25 weewx-hyggebu weewx[4449]: MQTTSS: Record prior to update 
is: dateTime: 1556224042, outTempBatteryStatus: 0, usUnits: 16, UV: 0.0
Apr 25 22:27:25 weewx-hyggebu weewx[4449]: MQTTSS: Packet after update is: 
dateTime: 1556224042, extraTemp2: -10.33, outHumidity: 32.6, 
outTempBatteryStatus: 0, usUnits: 16, UV: 0.0

regards
Atle


torsdag 25. april 2019 21.45.54 UTC+2 skrev bell...@gmail.com følgende:
>
> I was just going to ask about the password. After the problem with 
> keepalive, I was afraid this bug would show up. My guess is that I need to 
> convert the payload to float. If you want to try patching it, around line 
> 208 change from
>
> data[self.label_map.get(key,key)] = msg.payload
>
> to
>
> data[self.label_map.get(key,key)] = to_float(msg.payload)
>
>
> Right now I don’t have a great environment for the “individual”  payload 
> type, so it will take a bit to really dig in on this.
>
> Thanks for your help. Rich
>
> On Thu, Apr 25, 2019 at 3:30 PM Eugen66 > 
> wrote:
>
>> Sorrry :( My bad...Found the mqtt disconnected with result code 5... 
>> Wrong passwd i conf.
>> So now it connect and find the data, but Weewx exit's with this:
>>
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing interval: 
>> 1556220434.00 1556220467.00
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Queue size is: 6
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing: dateTime: 
>> 1556220439.64, extraTemp2: 13.5, usUnits: 1
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: engine: Main loop exiting. 
>> Shutting engine down.
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: restx: Shut down MQTT thread.
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Disconnected with 
>> result code 0
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: shutdown 
>> process rtl_433 -M utc -F json -G
>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting for 
>> stdout-thread
>> Apr 25 21:27:52 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting for 
>> stderr-thread
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: timed out 
>> waiting for stderr-thread
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close stdout
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close stderr
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: engine: Caught unrecoverable 
>> exception in engine:
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   accum: 
>> ScalarStats.addHiLo expected float or int, got 13.5
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   Traceback (most 
>> recent call last):
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/weewx/engine.py", line 890, in main
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   engine.run()
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/weewx/engine.py", line 191, in run
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   
>> self.dispatchEvent(weewx.Event(weewx.NEW_LOOP_PACKET, packet=packet))
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   callback(event)
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/user/MQTTSubscribe.py", line 309, in new_loop_packet
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   target_data = 
>> self._process_data(start_ts, self.end_ts, event.packet)
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/user/MQTTSubscribe.py", line 289, in _process_data
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   
>> accumulator.addRecord(archive_data)
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/weewx/accum.py", line 256, in addRecord
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   func(self, 
>> record, obs_type, add_hilo, weight)
>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
>> "/usr/share/weewx/weewx/accum.py", line 314, in add_value
>> Apr 25 21:28:02 weewx-hyggebu 

Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread bellrichm
I saw some drivers, but did not find any services that processed MQTT. So, this 
was developed as a service to augment data from a weather station. I also had 
my own driver that shared much of the code, so it just made sense to merge the 
two. 
When running as a driver the one difference is that a specific topic can be 
treated as archive records. I use this to publish loop and archive data from my 
“production” install and get the exact loop and archive data on other machines, 
like development, dedicated reporting, etc. 
Rich

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread Rich Bell
I was just going to ask about the password. After the problem with
keepalive, I was afraid this bug would show up. My guess is that I need to
convert the payload to float. If you want to try patching it, around line
208 change from

data[self.label_map.get(key,key)] = msg.payload

to

data[self.label_map.get(key,key)] = to_float(msg.payload)


Right now I don’t have a great environment for the “individual”  payload
type, so it will take a bit to really dig in on this.

Thanks for your help. Rich

On Thu, Apr 25, 2019 at 3:30 PM Eugen66  wrote:

> Sorrry :( My bad...Found the mqtt disconnected with result code 5... Wrong
> passwd i conf.
> So now it connect and find the data, but Weewx exit's with this:
>
> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing interval:
> 1556220434.00 1556220467.00
> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Queue size is: 6
> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing: dateTime:
> 1556220439.64, extraTemp2: 13.5, usUnits: 1
> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: engine: Main loop exiting.
> Shutting engine down.
> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: restx: Shut down MQTT thread.
> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Disconnected with
> result code 0
> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: shutdown
> process rtl_433 -M utc -F json -G
> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting for
> stdout-thread
> Apr 25 21:27:52 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting for
> stderr-thread
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: timed out
> waiting for stderr-thread
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close stdout
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close stderr
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: engine: Caught unrecoverable
> exception in engine:
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   accum:
> ScalarStats.addHiLo expected float or int, got 13.5
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   Traceback (most
> recent call last):
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
> "/usr/share/weewx/weewx/engine.py", line 890, in main
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   engine.run()
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
> "/usr/share/weewx/weewx/engine.py", line 191, in run
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: 
> self.dispatchEvent(weewx.Event(weewx.NEW_LOOP_PACKET, packet=packet))
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
> "/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   callback(event)
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
> "/usr/share/weewx/user/MQTTSubscribe.py", line 309, in new_loop_packet
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   target_data =
> self._process_data(start_ts, self.end_ts, event.packet)
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
> "/usr/share/weewx/user/MQTTSubscribe.py", line 289, in _process_data
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: 
> accumulator.addRecord(archive_data)
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
> "/usr/share/weewx/weewx/accum.py", line 256, in addRecord
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   func(self,
> record, obs_type, add_hilo, weight)
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
> "/usr/share/weewx/weewx/accum.py", line 314, in add_value
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: 
> self[obs_type].addHiLo(val, record['dateTime'])
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File
> "/usr/share/weewx/weewx/accum.py", line 77, in addHiLo
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   raise
> ValueError("accum: ScalarStats.addHiLo expected float or int, got %s" % val)
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   ValueError: accum:
> ScalarStats.addHiLo expected float or int, got 13.5
> Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   Exiting.
>
> rgds
> Atle
>
>
>
> torsdag 25. april 2019 19.47.23 UTC+2 skrev Rich Bell følgende:
>>
>> I think i am not handling the options correctly and the keepalive is a
>> string and not an integer. For now, leave it out of weewx.conf and let it
>> default to 60.
>> - rich
>>
>> On Thu, Apr 25, 2019 at 11:14 AM Eugen66  wrote:
>>
> Thank you so much for helping :)
>>> I have used the apt..
>>>
>>> When I run, in folder etc/weewx, I get this :
>>> :/etc/weewx# PYTHONPATH=/usr/share/weewx python
>>> /usr/share/weewx//user/MQTTSubscribe.py --type service --binding archive
>>> --interval 300  --delay 15 --records 2 weewx.conf
>>> Simulation is service
>>> Creating 2 archive records
>>> Interval is 300 seconds
>>> Delay is 15 seconds
>>> Traceback (most recent call last):
>>>   File 

Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread Eugen66
Sorrry :( My bad...Found the mqtt disconnected with result code 5... Wrong 
passwd i conf.
So now it connect and find the data, but Weewx exit's with this:

Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing interval: 
1556220434.00 1556220467.00
Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Queue size is: 6
Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing: dateTime: 
1556220439.64, extraTemp2: 13.5, usUnits: 1
Apr 25 21:27:51 weewx-hyggebu weewx[30607]: engine: Main loop exiting. 
Shutting engine down.
Apr 25 21:27:51 weewx-hyggebu weewx[30607]: restx: Shut down MQTT thread.
Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Disconnected with 
result code 0
Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: shutdown 
process rtl_433 -M utc -F json -G
Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting for 
stdout-thread
Apr 25 21:27:52 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting for 
stderr-thread
Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: timed out 
waiting for stderr-thread
Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close stdout
Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close stderr
Apr 25 21:28:02 weewx-hyggebu weewx[30607]: engine: Caught unrecoverable 
exception in engine:
Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   accum: 
ScalarStats.addHiLo expected float or int, got 13.5
Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   Traceback (most 
recent call last):
Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
"/usr/share/weewx/weewx/engine.py", line 890, in main
Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   engine.run()
Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
"/usr/share/weewx/weewx/engine.py", line 191, in run
Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   
self.dispatchEvent(weewx.Event(weewx.NEW_LOOP_PACKET, packet=packet))
Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
"/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   callback(event)
Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
"/usr/share/weewx/user/MQTTSubscribe.py", line 309, in new_loop_packet
Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   target_data = 
self._process_data(start_ts, self.end_ts, event.packet)
Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
"/usr/share/weewx/user/MQTTSubscribe.py", line 289, in _process_data
Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   
accumulator.addRecord(archive_data)
Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
"/usr/share/weewx/weewx/accum.py", line 256, in addRecord
Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   func(self, 
record, obs_type, add_hilo, weight)
Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
"/usr/share/weewx/weewx/accum.py", line 314, in add_value
Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   
self[obs_type].addHiLo(val, record['dateTime'])
Apr 25 21:28:02 weewx-hyggebu weewx[30607]: File 
"/usr/share/weewx/weewx/accum.py", line 77, in addHiLo
Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   raise 
ValueError("accum: ScalarStats.addHiLo expected float or int, got %s" % val)
Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   ValueError: accum: 
ScalarStats.addHiLo expected float or int, got 13.5
Apr 25 21:28:02 weewx-hyggebu weewx[30607]:   Exiting.

rgds
Atle



torsdag 25. april 2019 19.47.23 UTC+2 skrev Rich Bell følgende:
>
> I think i am not handling the options correctly and the keepalive is a 
> string and not an integer. For now, leave it out of weewx.conf and let it 
> default to 60.
> - rich
>
> On Thu, Apr 25, 2019 at 11:14 AM Eugen66 > 
> wrote:
>
>> Thank you so much for helping :)
>> I have used the apt..
>>
>> When I run, in folder etc/weewx, I get this :
>> :/etc/weewx# PYTHONPATH=/usr/share/weewx python 
>> /usr/share/weewx//user/MQTTSubscribe.py --type service --binding archive 
>> --interval 300  --delay 15 --records 2 weewx.conf
>> Simulation is service
>> Creating 2 archive records
>> Interval is 300 seconds
>> Delay is 15 seconds
>> Traceback (most recent call last):
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 557, in 
>> main()
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 479, in main
>> simulate_service(engine, config_dict, binding, record_count, 
>> interval, delay, units)
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 523, in 
>> simulate_service
>> service = MQTTSubscribeService(engine, config_dict)
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 263, in __init__
>> self.thread = MQTTSubscribeServiceThread(self, self.client, 
>> self.queue, self.archive_queue, label_map, unit_system, payload_type, host, 
>> keepalive, por  t, username, password, topic, 

Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread Eugen66
Thank you ;) when I left out the keepalive it is running,
I'm testing trying to subscribe to Weather/outHumidity 
 this is the config:
[MQTTSubscribeService] 
# The MQTT server 
host = 10.0.10.165

# The port to connect to
port = 1883

# Maximum period in seconds allowed between communications with the 
broker
#keepalive =60

# username for broker authentication
username = 

# password for broker authentication
password = xxx

# Units for MQTT payloads without unit value
unit_system_name = 'METRIC'  # US or 'METRIC' or 'METRICWX'

# The clientid to connect with
clientid = weewx

# The topic to subscribe to
topic = Weather/

# The format of the MQTT payload. Currently support 'individual' or 
'json'
payload_type = individual

# Mapping to WeeWX names
[[label_map]]
outHumidity = outHumidity

# The amount to overlap the start time when processing the MQTT queue
# Only used by the service
overlap = 20

# The binding, loop or archive
# Only used by the service
binding = loop

# The amount of time to wait when the queue of MQTT payload is empty
# Only used by the driver
# wait_before_retry = 2

# Payload in this topic is processed like an archive record
# Only used by the driver
# archive_topic = 

I can't see that it is mapping the outHumidty, this is part of the log:
 


Apr 25 20:28:19 weewx-hyggebu weewx[23083]: sdr: MainThread: 
packet={'outTemp': 4.562, 'usUnits': 16, 'dateTime': 1556216894}
Apr 25 20:28:19 weewx-hyggebu weewx[23083]: MQTTSS: Processing interval: 
1556216887.00 1556216894.00
Apr 25 20:28:19 weewx-hyggebu weewx[23083]: MQTTSS: Queue size is: 0
Apr 25 20:28:19 weewx-hyggebu weewx[23083]: MQTTSS: Queue was empty
Apr 25 20:28:19 weewx-hyggebu weewx[23083]: MQTTSS: Packet after update is: 
dateTime: 1556216894, outTemp: 4.562, usUnits: 16
Apr 25 20:28:19 weewx-hyggebu weewx[23083]: sdr: MainThread: parse_json: 
unknown model Acurite Rain Gauge
Apr 25 20:28:19 weewx-hyggebu weewx[23083]: sdr: MainThread: punt 
unrecognized line '{"time" : "2019-04-25 18:28:14", "model" : "Acurite Rain 
Gauge", "id" : 52, "rain" : 290.500}#012'
Apr 25 20:28:19 weewx-hyggebu weewx[23083]: sdr: MainThread: ignoring 
duplicate packet {'outTemp': 4.562, 'usUnits': 16, 'dateTime': 1556216894}
Apr 25 20:28:19 weewx-hyggebu weewx[23083]: sdr: MainThread: 
packet={'outTemp': 4.562, 'usUnits': 16, 'dateTime': 1556216895}
Apr 25 20:28:19 weewx-hyggebu weewx[23083]: MQTTSS: Processing interval: 
1556216894.00 1556216895.00
Apr 25 20:28:19 weewx-hyggebu weewx[23083]: MQTTSS: Queue size is: 0
Apr 25 20:28:19 weewx-hyggebu weewx[23083]: MQTTSS: Queue was empty

Apr 25 20:33:22 weewx-hyggebu weewx[23083]: MQTTSS: Connected with result 
code 5
Apr 25 20:33:22 weewx-hyggebu weewx[23083]: MQTTSS: Disconnected with 
result code 5
Apr 25 20:33:24 weewx-hyggebu weewx[23083]: sdr: MainThread: 
lines=['{"time" : "2019-04-25 18:33:21", "model" : "HIDEKI Wind sensor", 
"rc" : 5, "channel" : 4, "battery" : "OK", "temperature_C" : 4.700, 
"wind_speed_mph" : 0.900, "gust_speed_mph" : 0.000, "wind_approach" : 0, 
"wind_direction" : 292.500, "mic" : "CRC"}\n', '{"time" : "2019-04-25 
18:33:21", "model" : "HIDEKI Wind sensor", "rc" : 5, "channel" : 4, 
"battery" : "OK", "temperature_C" : 4.700, "wind_speed_mph" : 0.900, 
"gust_speed_mph" : 0.000, "wind_approach" : 0, "wind_direction" : 292.500, 
"mic" : "CRC"}\n', '{"time" : "

regards
Atle


torsdag 25. april 2019 19.47.23 UTC+2 skrev Rich Bell følgende:
>
> I think i am not handling the options correctly and the keepalive is a 
> string and not an integer. For now, leave it out of weewx.conf and let it 
> default to 60.
> - rich
>
> On Thu, Apr 25, 2019 at 11:14 AM Eugen66 > 
> wrote:
>
>> Thank you so much for helping :)
>> I have used the apt..
>>
>> When I run, in folder etc/weewx, I get this :
>> :/etc/weewx# PYTHONPATH=/usr/share/weewx python 
>> /usr/share/weewx//user/MQTTSubscribe.py --type service --binding archive 
>> --interval 300  --delay 15 --records 2 weewx.conf
>> Simulation is service
>> Creating 2 archive records
>> Interval is 300 seconds
>> Delay is 15 seconds
>> Traceback (most recent call last):
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 557, in 
>> main()
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 479, in main
>> simulate_service(engine, config_dict, binding, record_count, 
>> interval, delay, units)
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 523, in 
>> simulate_service
>> service = MQTTSubscribeService(engine, config_dict)
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 263, in __init__
>> self.thread = MQTTSubscribeServiceThread(self, self.client, 
>> self.queue, self.archive_queue, label_map, unit_system, payload_type, host, 
>> keepalive, por  t, username, password, topic, archive_topic)
>>   File 

[weewx-user] Re: Add new unit and how to use it?

2019-04-25 Thread wysiwyg
I assume I can define the label and ratio this way:

weewx.units.default_unit_label_dict['millamp'] = ' mA'
weewx.units.conversionDict['amp'] = {'milliamp': lambda x : x * 1000}
weewx.units.conversionDict['milliamp'] = {'amp': lambda x : x * 0.001}



But I dont figure out how to "declare" milliamp 1st ?

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Add new unit and how to use it?

2019-04-25 Thread wysiwyg
Hi here...
after some checks in the document, I'm not sure how I can add a unit to an 
existing group...

I discovered that group_amp already exists...but I would prefer milliamps 
(mA) instead of currently available "amp"
How can I add a unit to an existing group ?


-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread wysiwyg
Hi there!
may I ask the differences of this new driver compare to the existing one ? 
(I guess at least JSON)
Best regards,



Le jeudi 25 avril 2019 19:47:23 UTC+2, Rich Bell a écrit :
>
> I think i am not handling the options correctly and the keepalive is a 
> string and not an integer. For now, leave it out of weewx.conf and let it 
> default to 60.
> - rich
>
> On Thu, Apr 25, 2019 at 11:14 AM Eugen66 > 
> wrote:
>
>> Thank you so much for helping :)
>> I have used the apt..
>>
>> When I run, in folder etc/weewx, I get this :
>> :/etc/weewx# PYTHONPATH=/usr/share/weewx python 
>> /usr/share/weewx//user/MQTTSubscribe.py --type service --binding archive 
>> --interval 300  --delay 15 --records 2 weewx.conf
>> Simulation is service
>> Creating 2 archive records
>> Interval is 300 seconds
>> Delay is 15 seconds
>> Traceback (most recent call last):
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 557, in 
>> main()
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 479, in main
>> simulate_service(engine, config_dict, binding, record_count, 
>> interval, delay, units)
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 523, in 
>> simulate_service
>> service = MQTTSubscribeService(engine, config_dict)
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 263, in __init__
>> self.thread = MQTTSubscribeServiceThread(self, self.client, 
>> self.queue, self.archive_queue, label_map, unit_system, payload_type, host, 
>> keepalive, por  t, username, password, topic, archive_topic)
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 326, in __init__
>> MQTTSubscribe.__init__(self, client, queue, archive_queue, label_map, 
>> unit_system, payload_type, host, keepalive, port, username, password, 
>> topic, arc  hive_topic)
>>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 135, in __init__
>> self.client.connect(host, port, keepalive)
>>   File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 
>> 839, in connect
>> return self.reconnect()
>>   File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 
>> 1009, in reconnect
>> return self._send_connect(self._keepalive, self._clean_session)
>>   File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 
>> 2361, in _send_connect
>> keepalive))
>> struct.error: cannot convert argument to integer
>>
>> And trying with 60 
>>
>> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Keep alive is 60
>> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Username is openhabian
>> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Password is set
>> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Topic is Weather/
>> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Archive topic is None
>> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Payload type is 
>> individual
>> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Default units is 1
>> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Label map is 
>> {'outHumidity': 'outHumidity', 'overlap': '20', 'binding': 'loop'}
>> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: sdr: MainThread: shutdown 
>> process rtl_433 -M utc -F json -G
>> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: sdr: MainThread: waiting for 
>> stdout-thread
>> Apr 25 17:11:24 weewx-hyggebu weewx[14390]: sdr: MainThread: waiting for 
>> stderr-thread
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: sdr: MainThread: timed out 
>> waiting for stderr-thread
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: sdr: MainThread: close stdout
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: sdr: MainThread: close stderr
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: engine: Caught unrecoverable 
>> exception in engine:
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   cannot convert 
>> argument to integer
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   Traceback (most 
>> recent call last):
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File 
>> "/usr/share/weewx/weewx/engine.py", line 884, in main
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   engine = 
>> engine_class(config_dict)
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File 
>> "/usr/share/weewx/weewx/engine.py", line 78, in __init__
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   
>> self.loadServices(config_dict)
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File 
>> "/usr/share/weewx/weewx/engine.py", line 142, in loadServices
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   
>> self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File 
>> "/usr/share/weewx/user/MQTTSubscribe.py", line 263, in __init__
>> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   self.thread = 
>> MQTTSubscribeServiceThread(self, self.client, self.queue, 
>> self.archive_queue, label_map, 

Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread Rich Bell
I think i am not handling the options correctly and the keepalive is a
string and not an integer. For now, leave it out of weewx.conf and let it
default to 60.
- rich

On Thu, Apr 25, 2019 at 11:14 AM Eugen66  wrote:

> Thank you so much for helping :)
> I have used the apt..
>
> When I run, in folder etc/weewx, I get this :
> :/etc/weewx# PYTHONPATH=/usr/share/weewx python
> /usr/share/weewx//user/MQTTSubscribe.py --type service --binding archive
> --interval 300  --delay 15 --records 2 weewx.conf
> Simulation is service
> Creating 2 archive records
> Interval is 300 seconds
> Delay is 15 seconds
> Traceback (most recent call last):
>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 557, in 
> main()
>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 479, in main
> simulate_service(engine, config_dict, binding, record_count, interval,
> delay, units)
>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 523, in
> simulate_service
> service = MQTTSubscribeService(engine, config_dict)
>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 263, in __init__
> self.thread = MQTTSubscribeServiceThread(self, self.client,
> self.queue, self.archive_queue, label_map, unit_system, payload_type, host,
> keepalive, por  t, username, password, topic, archive_topic)
>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 326, in __init__
> MQTTSubscribe.__init__(self, client, queue, archive_queue, label_map,
> unit_system, payload_type, host, keepalive, port, username, password,
> topic, arc  hive_topic)
>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 135, in __init__
> self.client.connect(host, port, keepalive)
>   File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line
> 839, in connect
> return self.reconnect()
>   File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line
> 1009, in reconnect
> return self._send_connect(self._keepalive, self._clean_session)
>   File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line
> 2361, in _send_connect
> keepalive))
> struct.error: cannot convert argument to integer
>
> And trying with 60
>
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Keep alive is 60
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Username is openhabian
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Password is set
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Topic is Weather/
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Archive topic is None
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Payload type is
> individual
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Default units is 1
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Label map is
> {'outHumidity': 'outHumidity', 'overlap': '20', 'binding': 'loop'}
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: sdr: MainThread: shutdown
> process rtl_433 -M utc -F json -G
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: sdr: MainThread: waiting for
> stdout-thread
> Apr 25 17:11:24 weewx-hyggebu weewx[14390]: sdr: MainThread: waiting for
> stderr-thread
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: sdr: MainThread: timed out
> waiting for stderr-thread
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: sdr: MainThread: close stdout
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: sdr: MainThread: close stderr
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: engine: Caught unrecoverable
> exception in engine:
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   cannot convert
> argument to integer
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   Traceback (most
> recent call last):
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File
> "/usr/share/weewx/weewx/engine.py", line 884, in main
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   engine =
> engine_class(config_dict)
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File
> "/usr/share/weewx/weewx/engine.py", line 78, in __init__
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: 
> self.loadServices(config_dict)
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File
> "/usr/share/weewx/weewx/engine.py", line 142, in loadServices
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: 
> self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File
> "/usr/share/weewx/user/MQTTSubscribe.py", line 263, in __init__
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   self.thread =
> MQTTSubscribeServiceThread(self, self.client, self.queue,
> self.archive_queue, label_map, unit_system, payload_type, host, keepalive,
> port, username, password, topic, archive_topic)
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File
> "/usr/share/weewx/user/MQTTSubscribe.py", line 326, in __init__
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: 
> MQTTSubscribe.__init__(self, client, queue, 

Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread Rich Bell
On Thu, Apr 25, 2019 at 11:14 AM Eugen66  wrote:

> Thank you so much for helping :)
> I have used the apt..
>
> When I run, in folder etc/weewx, I get this :
> :/etc/weewx# PYTHONPATH=/usr/share/weewx python
> /usr/share/weewx//user/MQTTSubscribe.py --type service --binding archive
> --interval 300  --delay 15 --records 2 weewx.conf
> Simulation is service
> Creating 2 archive records
> Interval is 300 seconds
> Delay is 15 seconds
> Traceback (most recent call last):
>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 557, in 
> main()
>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 479, in main
> simulate_service(engine, config_dict, binding, record_count, interval,
> delay, units)
>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 523, in
> simulate_service
> service = MQTTSubscribeService(engine, config_dict)
>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 263, in __init__
> self.thread = MQTTSubscribeServiceThread(self, self.client,
> self.queue, self.archive_queue, label_map, unit_system, payload_type, host,
> keepalive, por  t, username, password, topic, archive_topic)
>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 326, in __init__
> MQTTSubscribe.__init__(self, client, queue, archive_queue, label_map,
> unit_system, payload_type, host, keepalive, port, username, password,
> topic, arc  hive_topic)
>   File "/usr/share/weewx//user/MQTTSubscribe.py", line 135, in __init__
> self.client.connect(host, port, keepalive)
>   File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line
> 839, in connect
> return self.reconnect()
>   File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line
> 1009, in reconnect
> return self._send_connect(self._keepalive, self._clean_session)
>   File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line
> 2361, in _send_connect
> keepalive))
> struct.error: cannot convert argument to integer
>
> And trying with 60
>
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Keep alive is 60
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Username is openhabian
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Password is set
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Topic is Weather/
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Archive topic is None
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Payload type is
> individual
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Default units is 1
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Label map is
> {'outHumidity': 'outHumidity', 'overlap': '20', 'binding': 'loop'}
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: sdr: MainThread: shutdown
> process rtl_433 -M utc -F json -G
> Apr 25 17:11:20 weewx-hyggebu weewx[14390]: sdr: MainThread: waiting for
> stdout-thread
> Apr 25 17:11:24 weewx-hyggebu weewx[14390]: sdr: MainThread: waiting for
> stderr-thread
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: sdr: MainThread: timed out
> waiting for stderr-thread
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: sdr: MainThread: close stdout
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: sdr: MainThread: close stderr
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: engine: Caught unrecoverable
> exception in engine:
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   cannot convert
> argument to integer
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   Traceback (most
> recent call last):
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File
> "/usr/share/weewx/weewx/engine.py", line 884, in main
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   engine =
> engine_class(config_dict)
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File
> "/usr/share/weewx/weewx/engine.py", line 78, in __init__
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: 
> self.loadServices(config_dict)
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File
> "/usr/share/weewx/weewx/engine.py", line 142, in loadServices
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: 
> self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File
> "/usr/share/weewx/user/MQTTSubscribe.py", line 263, in __init__
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   self.thread =
> MQTTSubscribeServiceThread(self, self.client, self.queue,
> self.archive_queue, label_map, unit_system, payload_type, host, keepalive,
> port, username, password, topic, archive_topic)
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File
> "/usr/share/weewx/user/MQTTSubscribe.py", line 326, in __init__
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]: 
> MQTTSubscribe.__init__(self, client, queue, archive_queue, label_map,
> unit_system, payload_type, host, keepalive, port, username, password,
> topic, archive_topic)
> Apr 25 17:11:34 weewx-hyggebu weewx[14390]:    

Re: [weewx-user] Re: weewx stop working

2019-04-25 Thread Leon Shaner
Damian,

Still very strange that we do not see debug = 1 echoed in the logs.

At this point I am at a loss other than, perhaps you could preface the command 
with strace so we can see what is going on.  I expect it gets to a point where 
it is just more or less sleeping, doing nothing.

I say that based on your previous "ps -elf" output where it showed 00:00:00 cpu 
time and was sleeping.   It is normal for the process to sleep when there is no 
input, but it should have to be doing at least some work from time to time.

>From the ps man page:

PROCESS STATE CODES
   Here are the different values that the s, stat and state output 
specifiers (header "STAT" or "S") will display to describe the state of a 
process:

   Duninterruptible sleep (usually IO)
   Rrunning or runnable (on run queue)
   Sinterruptible sleep (waiting for an event to complete)
   Tstopped by job control signal
   tstopped by debugger during the tracing
   Wpaging (not valid since the 2.6.xx kernel)
   Xdead (should never be seen)
   Zdefunct ("zombie") process, terminated but not reaped by 
its parent

Here is an example of how to strace the process and get the debug output into a 
file:

$ sudo strace -o /tmp/weewxd_strace.txt weewxd

You can "tail -f /tmp/weewxd_strace.txt" to see what is going on.
It will likely get to a point where it is quiet for long periods.  You can stop 
the strace after you see those a couple of times.

The output could be quite large so you may want to compress it:

$ gzip /tmp/weewxd_strace.txt

Regards,
Leon
--
Leon Shaner :: Dearborn, Michigan (iPad Pro)

> On Apr 25, 2019, at 10:30 AM, Damjan Hajsek  wrote:
> 
> Hi
> I have done this and it is all the same. I created some logs from manually 
> starting weewx.
> when I start weewx manually sudo weewxd /etc/weewx/weewx.conf'
> it didn't crash, I stopped it.
> here it is.
> http://zerobin.povej.net/?b06b1ad942bc51a2#34Nj1ed+8odSg7jHbjz7AU+WsqZ3yxPjZDB1EPHyVAk=
> 
> 
> 
> Dne sreda, 24. april 2019 15.48.25 UTC+2 je oseba Leon Shaner napisala:
>> 
>> Damian,
>> You have to give wee_config a command.
>> From the usage, you want this:
>> 
>> $ sudo wee_config --reconfigure --config=/etc/weewx/weewx.conf
>> 
>> (Although you can leave the --config part off, since your conf file is 
>> located in the default location).
>> 
>> But do be sure to back up the config file first...
>> 
>> Regards,
>> Leon
>> --
>> Leon Shaner :: Dearborn, Michigan (iPad Pro)
>> 
>>> On Apr 24, 2019, at 6:20 AM, Damjan Hajsek  wrote:
>>> 
>>> Hi
>>> What I did is first use some old weewx.conf file from last year and doesn't 
>>> work either.
>>> So I tried to reconfigure it but can't
>>> when I run wee_config --help I get list of help
>>> but when I do this I get
>>> wee_config /etc/weewx/weewx.conf
>>> No command specified.
>>> wee_config --config=/etc/weewx/weewx.conf
>>> No command specified.
>>> 
>>> 
>>> Dne torek, 23. april 2019 15.17.24 UTC+2 je oseba Leon Shaner napisala:
 
 Damian,
 
 These logs still do not state debug = 1.
 It still could be that the weewx.conf isn't being parsed correctly, and 
 isn't even able to read the debug = 1 setting.
 
 Did you try my suggestions for how to "rebuild" the conf file?
 
 Regards,
 Leon
 --
 Leon Shaner :: Dearborn, Michigan (iPhone)
 
 
> On Apr 23, 2019, at 8:45 AM, Damjan Hajsek  wrote:
> 
> Hi
> I have followed your instruction so I did all as described
> first turn off monit
> stop weewx
> debug = 1 was already set
> than I run weewx manually
> here is a log from that
> 
> http://zerobin.povej.net/?a63b7ac09e222bcc#9Y5+B9WWtxXgUJWTKZWmzElusp9QRgEK5Pde606SvQc=
> 
> http://zerobin.povej.net/?7d382c267025fd54#0p/b4Z0y5k7U3qFc8T/2Sgl0CbbU8ZkYxdSFCRh/I4I=
> 
> 
> Dne nedelja, 21. april 2019 15.41.04 UTC+2 je oseba mwall napisala:
>> 
>> at this point in the thread it is not clear what is happening or what is 
>> the state of your system.
>> 
>> so start over and explain what your configuration looks like now
>> 
>> then, to diagnose weewx, do the following:
>> 
>> - remove whatever it is that keeps restarting weewx
>> - stop weewx if it is running
>> - set debug=1 in your weewx configuration
>> - run weewx directly, not as a daemon
>> - if weewx crashes, post (1) the log prior to the crash, (2) the stack 
>> trace or other output from the console in which you started it
>> 
>> m
> 
> -- 
> 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...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>>> 
>>> -- 
>>> You received this 

[weewx-user] Re: make check up on data in order to auto-restart the weather console

2019-04-25 Thread Pietro Benotto
Finally, I found the time to try "Greg from Oz" solution. It works 
perfectly. I publish here the code and what I've done in case someone 
needed it.


   1. The first step is to convert the standard Sqlite database into a 
   mysql one. This is quite simple and could offer you other advantages.
   2. The user for the weewx database in the example below is: user=weewx 
   and password=weewx
   3. I used this program https://github.com/codazoda/hub-ctrl.c in order 
   to switch on and switch off the USB of the Raspberry
   4. I created two files: RXcheck.sh (that contain the code) and RXout.txt 
   (that memorize the last console shutdown time in UNIX epoch)
   5. Put a random small number in RXout.txt to avoid problems if 
   RXcheck.sh can't find a number into that file (for example put a "0" inside 
   that file)
   6. The code in RXout.txt is:

#!/bin/bash
RXCHECK=$(mysql --batch --column-names=0 -uweewx -pweewx --database=weewx 
--execute="select rxCheckPercent from archive WHERE dateTime=(select 
MAX(dateTime) from archive);");
RXCHECK=`echo $RXCHECK | awk '{printf("%.1f", $1)}'`
if [ ! ${RXCHECK} = "100.0" ]
then
   pastTime=$( /home/weewx/RXout.txt
  /home/weewx/hub-ctrl -h 0 -P 2 -p 0#switch off the console (remember 
to remove the batteries or it's impossible to shutdown the console)
  sleep 5
  /home/weewx/hub-ctrl -h 0 -P 2 -p 1#switch on the console
   fi
fi

 
   7. using "sudo crontab -e" I ordered the execution of RXcheck.sh 
every 5 minutes. It's important to use the *sudo* crontab for the hub-ctrl.

Thank you so much for your help. I hope this thread could be useful for 
others.
By

 


-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread Eugen66
Thank you so much for helping :)
I have used the apt..

When I run, in folder etc/weewx, I get this :
:/etc/weewx# PYTHONPATH=/usr/share/weewx python 
/usr/share/weewx//user/MQTTSubscribe.py --type service --binding archive 
--interval 300  --delay 15 --records 2 weewx.conf
Simulation is service
Creating 2 archive records
Interval is 300 seconds
Delay is 15 seconds
Traceback (most recent call last):
  File "/usr/share/weewx//user/MQTTSubscribe.py", line 557, in 
main()
  File "/usr/share/weewx//user/MQTTSubscribe.py", line 479, in main
simulate_service(engine, config_dict, binding, record_count, interval, 
delay, units)
  File "/usr/share/weewx//user/MQTTSubscribe.py", line 523, in 
simulate_service
service = MQTTSubscribeService(engine, config_dict)
  File "/usr/share/weewx//user/MQTTSubscribe.py", line 263, in __init__
self.thread = MQTTSubscribeServiceThread(self, self.client, self.queue, 
self.archive_queue, label_map, unit_system, payload_type, host, keepalive, 
por  t, username, password, topic, archive_topic)
  File "/usr/share/weewx//user/MQTTSubscribe.py", line 326, in __init__
MQTTSubscribe.__init__(self, client, queue, archive_queue, label_map, 
unit_system, payload_type, host, keepalive, port, username, password, 
topic, arc  hive_topic)
  File "/usr/share/weewx//user/MQTTSubscribe.py", line 135, in __init__
self.client.connect(host, port, keepalive)
  File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 
839, in connect
return self.reconnect()
  File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 
1009, in reconnect
return self._send_connect(self._keepalive, self._clean_session)
  File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 
2361, in _send_connect
keepalive))
struct.error: cannot convert argument to integer

And trying with 60 

Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Keep alive is 60
Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Username is openhabian
Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Password is set
Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Topic is Weather/
Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Archive topic is None
Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Payload type is 
individual
Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Default units is 1
Apr 25 17:11:20 weewx-hyggebu weewx[14390]: MQTTSS: Label map is 
{'outHumidity': 'outHumidity', 'overlap': '20', 'binding': 'loop'}
Apr 25 17:11:20 weewx-hyggebu weewx[14390]: sdr: MainThread: shutdown 
process rtl_433 -M utc -F json -G
Apr 25 17:11:20 weewx-hyggebu weewx[14390]: sdr: MainThread: waiting for 
stdout-thread
Apr 25 17:11:24 weewx-hyggebu weewx[14390]: sdr: MainThread: waiting for 
stderr-thread
Apr 25 17:11:34 weewx-hyggebu weewx[14390]: sdr: MainThread: timed out 
waiting for stderr-thread
Apr 25 17:11:34 weewx-hyggebu weewx[14390]: sdr: MainThread: close stdout
Apr 25 17:11:34 weewx-hyggebu weewx[14390]: sdr: MainThread: close stderr
Apr 25 17:11:34 weewx-hyggebu weewx[14390]: engine: Caught unrecoverable 
exception in engine:
Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   cannot convert 
argument to integer
Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   Traceback (most 
recent call last):
Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File 
"/usr/share/weewx/weewx/engine.py", line 884, in main
Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   engine = 
engine_class(config_dict)
Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File 
"/usr/share/weewx/weewx/engine.py", line 78, in __init__
Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   
self.loadServices(config_dict)
Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File 
"/usr/share/weewx/weewx/engine.py", line 142, in loadServices
Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   
self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File 
"/usr/share/weewx/user/MQTTSubscribe.py", line 263, in __init__
Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   self.thread = 
MQTTSubscribeServiceThread(self, self.client, self.queue, 
self.archive_queue, label_map, unit_system, payload_type, host, keepalive, 
port, username, password, topic, archive_topic)
Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File 
"/usr/share/weewx/user/MQTTSubscribe.py", line 326, in __init__
Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   
MQTTSubscribe.__init__(self, client, queue, archive_queue, label_map, 
unit_system, payload_type, host, keepalive, port, username, password, 
topic, archive_topic)
Apr 25 17:11:34 weewx-hyggebu weewx[14390]: File 
"/usr/share/weewx/user/MQTTSubscribe.py", line 135, in __init__
Apr 25 17:11:34 weewx-hyggebu weewx[14390]:   
self.client.connect(host, port, keepalive)
Apr 25 

[weewx-user] Re: MQTT client service - proof of concept/alpha code

2019-04-25 Thread Eugen66
Hi, 
really trying to get your MQTT subscription to work, this is a very useful 
way of adding values to a  great weather software :)
I use (for the moment SDR as driver)
When I try to run it stand alone I get this:

 PYTHONPATH=/usr/share/ python /usr/share/weewx//user/MQTTSubscribe.py 
--type service --binding archive --interval 300 --delay 15 --records 2 
weewx.conf
Traceback (most recent call last):
  File "/usr/share/weewx//user/MQTTSubscribe.py", line 75, in 
import weeutil.weeutil
ImportError: No module named weeutil.weeutil

and  Weewx fail to start when I  add MQTTSubscribe to weewx.conf

Any suggestion?

this is the log:
Apr 25 15:50:26 weewx-hyggebu systemd[1]: Starting LSB: weewx weather 
system...
Apr 25 15:50:27 weewx-hyggebu weewx[9314]: engine: Initializing weewx 
version 3.9.1
Apr 25 15:50:27 weewx-hyggebu weewx[9314]: engine: Using Python 2.7.13 
(default, Sep 26 2018, 18:42:22) #012[GCC 6.3.0 20170516]
Apr 25 15:50:27 weewx-hyggebu weewx[9314]: engine: Platform 
Linux-4.14.98-v7+-armv7l-with-debian-9.8
Apr 25 15:50:27 weewx-hyggebu weewx[9314]: engine: Locale is 'en_GB.UTF-8'
Apr 25 15:50:27 weewx-hyggebu weewx[9314]: engine: pid file is 
/var/run/weewx.pid
Apr 25 15:50:27 weewx-hyggebu weewx[9303]: Starting weewx weather system: 
weewx.
Apr 25 15:50:27 weewx-hyggebu systemd[1]: Started LSB: weewx weather system.
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: engine: Using configuration file 
/etc/weewx/weewx.conf
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: engine: Debug is 1
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: engine: Initializing engine
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: engine: Loading station type SDR 
(user.sdr)
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: sdr: MainThread: driver version 
is 0.62
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: sdr: MainThread: sensor map is 
{'inTemp': 'temperature.8:1.AcuriteWT450Packet', 'outTemp': 
'temperature.1:1.AcuriteWT450Packet', 'outHumidity': '', 'extraTemp1': 
'temperature.4:5.HidekiWindPacket', 'extraHumidity1': '', 'extraTemp2': '', 
'extraHumidity3': '', 'rain': 'rain_total.4:0.HidekiRainPacket', 
'rainBatteryStatus': 'battery.4:0.HidekiRainPacket', 'UV': 
'uv_index.1:137.OSUV800Packet', 'outTempBatteryStatus': 
'battery.1:137.OSUV800Packet', 'windDir': 'wind_dir.4:5.HidekiWindPacket', 
'windGust': 'wind_gust.4:5.HidekiWindPacket', 'windSpeed': 
'wind_speed.4:5.HidekiWindPacket', 'windBatteryStatus': 
'battery.4:5.HidekiWindPacket'}
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: sdr: MainThread: deltas is 
{'strikes': 'strikes_total', 'rain': 'rain_total'}
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: sdr: MainThread: startup process 
'rtl_433 -M utc -F json -G'
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: sdr: stdout-thread: start async 
reader for stdout-thread
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: sdr: stderr-thread: start async 
reader for stderr-thread
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: engine: Loading service 
weewx.engine.StdTimeSynch
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: engine: Finished loading service 
weewx.engine.StdTimeSynch
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: engine: Loading service 
user.MQTTSubscribe.MQTTSubscribeService
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Client id is weewx
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Binding is loop
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Default units is US 1
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Overlap is 0.0
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Host is 10.0.10.165
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Port is 1883
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Keep alive is 70
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Username is xx
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Password is set
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Topic is Weather/
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Archive topic is None
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Payload type is 
individual
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Default units is 1
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: MQTTSS: Label map is 
{'outHumidity': 'outHumidity', 'overlap': '20', 'binding': 'loop'}
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: sdr: MainThread: shutdown 
process rtl_433 -M utc -F json -G
Apr 25 15:50:27 weewx-hyggebu weewx[9318]: sdr: MainThread: waiting for 
stdout-thread
Apr 25 15:50:31 weewx-hyggebu weewx[9318]: sdr: MainThread: waiting for 
stderr-thread
Apr 25 15:50:41 weewx-hyggebu weewx[9318]: sdr: MainThread: timed out 
waiting for stderr-thread
Apr 25 15:50:41 weewx-hyggebu weewx[9318]: sdr: MainThread: close stdout
Apr 25 15:50:41 weewx-hyggebu weewx[9318]: sdr: MainThread: close stderr
Apr 25 15:50:41 weewx-hyggebu weewx[9318]: engine: Caught unrecoverable 
exception in engine:
Apr 25 15:50:41 weewx-hyggebu weewx[9318]:   cannot convert 
argument to integer
Apr 25 15:50:41 weewx-hyggebu weewx[9318]:   Traceback 

[weewx-user] Re: Caught WeeWxIOError: rtl_433 process is not running ?

2019-04-25 Thread Eugen66
For reference only:

Solution was to blacklist dvb_usb_rtl28xxu 




torsdag 25. april 2019 13.25.42 UTC+2 skrev Eugen66 følgende:
>
> Weewx not able to start rtl_433?
> No problem starting it from cmdline..
> It was working , but now I got the following error log when trying to 
> start (tried reboot, same result):
>
> This is probably the err, but I cant find any solution:
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: sdr: MainThread: err: 
> ['rtl_433 version 18.12-194-g5ed62fc branch master at 201904101337 inputs 
> file rtl_tcp RTL-SDR\n', 'Trying conf file at "rtl_433.conf"...\n', 'Trying 
> conf file at "/root/.config/rtl_433/rtl_433.conf"...\n', 'Trying conf file 
> at "/usr/local/etc/rtl_433/rtl_433.conf"...\n', 'Trying conf file at 
> "/etc/rtl_433/rtl_433.conf"...\n', '\n', '\tConsider using "-M newmodel" to 
> transition to new model keys. This will become the default someday.\n', 
> '\tA table of changes and discussion is at 
> https://github.com/merbanan/rtl_433/pull/986.\n', '\n', 'Registered 119 
> out of 125 device decoding protocols [ 1-4 6-8 10-17 19-26 29-64 67-125 
> ]\n', '\n', 'Kernel driver is active, or device is claimed by second 
> instance of librtlsdr.\n', 'In the first case, please either detach or 
> blacklist the kernel module\n', '(dvb_usb_rtl28xxu), or enable automatic 
> detaching at compile time.\n', '\n', 'usb_claim_interface error -6\n']
>
>
> This is the complete log, with debug:
>
> Apr 25 13:19:52 weewx-hyggebu systemd[1]: Starting LSB: weewx weather 
> system...
> Apr 25 13:19:52 weewx-hyggebu weewx[20856]: engine: Initializing weewx 
> version 3.9.1
> Apr 25 13:19:52 weewx-hyggebu weewx[20856]: engine: Using Python 2.7.13 
> (default, Sep 26 2018, 18:42:22) #012[GCC 6.3.0 20170516]
> Apr 25 13:19:52 weewx-hyggebu weewx[20856]: engine: Platform 
> Linux-4.14.98-v7+-armv7l-with-debian-9.8
> Apr 25 13:19:52 weewx-hyggebu weewx[20856]: engine: Locale is 'en_GB.UTF-8'
> Apr 25 13:19:52 weewx-hyggebu weewx[20856]: engine: pid file is 
> /var/run/weewx.pid
> Apr 25 13:19:52 weewx-hyggebu weewx[20845]: Starting weewx weather system: 
> weewx.
> Apr 25 13:19:52 weewx-hyggebu systemd[1]: Started LSB: weewx weather 
> system.
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Using configuration 
> file /etc/weewx/weewx.conf
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Debug is 1
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Initializing engine
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Loading station type 
> SDR (user.sdr)
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: sdr: MainThread: driver 
> version is 0.62
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: sdr: MainThread: sensor map is 
> {'inTemp': 'temperature.8:1.AcuriteWT450Packet', 'outTemp': 
> 'temperature.1:1.AcuriteWT450Packet', 'outHumidity': '', 'extraTemp1': 
> 'temperature.4:5.HidekiWindPacket', 'extraHumidity1': '', 'extraTemp2': '', 
> 'extraHumidity3': '', 'rain': 'rain_total.4:0.HidekiRainPacket', 
> 'rainBatteryStatus': 'battery.4:0.HidekiRainPacket', 'UV': 
> 'uv_index.1:137.OSUV800Packet', 'outTempBatteryStatus': 
> 'battery.1:137.OSUV800Packet', 'windDir': 'wind_dir.4:5.HidekiWindPacket', 
> 'windGust': 'wind_gust.4:5.HidekiWindPacket', 'windSpeed': 
> 'wind_speed.4:5.HidekiWindPacket', 'windBatteryStatus': 
> 'battery.4:5.HidekiWindPacket'}
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: sdr: MainThread: deltas is 
> {'strikes': 'strikes_total', 'rain': 'rain_total'}
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: sdr: MainThread: startup 
> process 'rtl_433 -M utc -F json -G'
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: sdr: stdout-thread: start 
> async reader for stdout-thread
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: sdr: stderr-thread: start 
> async reader for stderr-thread
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Loading service 
> weewx.engine.StdTimeSynch
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Finished loading 
> service weewx.engine.StdTimeSynch
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: No services in service 
> group data_services
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Loading service 
> weewx.engine.StdConvert
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: StdConvert target unit 
> is 0x1
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Finished loading 
> service weewx.engine.StdConvert
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Loading service 
> weewx.engine.StdCalibrate
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Finished loading 
> service weewx.engine.StdCalibrate
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Loading service 
> weewx.engine.StdQC
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Finished loading 
> service weewx.engine.StdQC
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: engine: Loading service 
> weewx.wxservices.StdWXCalculate
> Apr 25 13:19:52 weewx-hyggebu weewx[20860]: wxcalculate: The following 
> values will be calculated: 

[weewx-user] Lufft Ws600 UMB und ähnliche

2019-04-25 Thread Stefan Schnidrig
Hallo zusammen.

Kann mir jemand sagen, ob die Wetterstation der Firma LUFFT mit der RS485 
Schnittstelle funktioniert mit Weewx?

Vielen Dank

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Add new unit and how to use it?

2019-04-25 Thread wysiwyg
Hi Gary,

Your proposal works perfectly !!
now I can try my milliamps :-)

thank you !




Le jeudi 25 avril 2019 08:07:18 UTC+2, gjr80 a écrit :
>
> Hi,
>
> In the AddElectricity example it is convenient to include the code that 
> customises the units and unit groups in the same .py file as the the code 
> that adds the fields to the archive record, but there is no requirement 
> that it be done this way always. The only requirement is that the code be 
> executed before WeeWX first uses your new fields. If you go back to the 
> section Adding a new type to the database 
>  you will see 
> mention of a couple of ways to include some code to be executed (look for 
> the para starting 'Now, where do we put this bit of code?'). In this case 
> you should follow the first suggestion and put your code in 
> user/extensions.py. In your case just add something like (untested):
>
> import weewx.units
> weewx.units.obs_group_dict['Vbat']= 'group_volt'
> weewx.units.obs_group_dict['Vsolar']  = 'group_volt'
>
> save the file and restart WeeWX and WeeWX should interpret Vbat and Vsolar 
> as voltages.
>
> Gary
>
> On Thursday, 25 April 2019 07:43:31 UTC+10, wysiwyg wrote:
>>
>> Hello !
>>
>> I have added a few observations to my weewx.
>> I use a battery  and a solar panel to supply my sensor, so I added Vbat, 
>> Isolar, Vsolar.
>>
>> This is working for a few month as unitless values (I can draw graph, use 
>> cheetah labels like $day.Isolar.max, all is fine).
>>
>> Now I would like to use suitable units.
>>
>>
>> let's start slowly, so I followed the documentation of voltage, because 
>> group_volt already exists :-)
>> I read here:  
>> http://www.weewx.com/docs/customizing.htm#Assigning_a_unit_group
>>
>> and created a file:
>> /usr/share/weewx/user/electricity.py
>>
>> containing:
>> import weewx
>> from weewx.engine import StdService
>>
>> import weewx.units
>> weewx.units.obs_group_dict['Vbat']= 'group_volt'
>> weewx.units.obs_group_dict['Vsolar']  = 'group_volt'
>> #weewx.units.obs_group_dict['WVbat']   = 'group_volt'
>> #weewx.units.obs_group_dict['WVsolar'] = 'group_volt'
>>
>> class AddElectricity(StdService):
>>
>> WVbat / WVsolar are not used yet (not in database), it will be my vbat & 
>> Vsolar values for wind sensor that I have not finished to develop yet.
>> I commented to avoid issues as those 2 are not yet in database schema.
>>
>> I prepared my file based on the example from documentation:
>>
>> import weewx
>> from weewx.engine import StdService
>>
>> import weewx.units
>> weewx.units.obs_group_dict['electricity'] = 'group_energy'
>>
>> class AddElectricity(StdService): # [...]
>>
>> But then, I wonder how it should be said to weewx that this new file is 
>> here, waiting for processing? 
>>
>> I assume it's probably need to add something in [engine] section of 
>> weewx.conf.
>> I tried the following without sucess (added in dat_services)
>>
>>
>> [Engine]
>>
>> [[Services]]
>> # This section specifies the services that should be run. They 
>> are
>> # grouped by type, and the order of services within each group
>> # determines the order in which the services will be run.
>> prep_services = weewx.engine.StdTimeSynch
>> data_services = user.electricity.AddElectricity
>> process_services = weewx.engine.StdConvert, weewx.engine.
>> StdCalibrate, weewx.engine.StdQC, weewx.wxservices.StdWXCalculate
>> archive_services = weewx.engine.StdArchive
>> restful_services = weewx.restx.StdStationRegistry, weewx.restx.
>> StdWunderground, weewx.restx.StdAWEKAS, user.windy.Windy
>> #restful_services = weewx.restx.StdStationRegistry, 
>> weewx.restx.StdWunderground, weewx.restx.StdPWSweather, 
>> weewx.restx.StdCWOP, weewx.restx.StdWOW, weewx$
>> report_services = weewx.engine.StdPrint, weewx.engine.StdReport
>>
>>
>> help welcome :-)
>>
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Add new unit and how to use it?

2019-04-25 Thread gjr80
Hi,

In the AddElectricity example it is convenient to include the code that 
customises the units and unit groups in the same .py file as the the code 
that adds the fields to the archive record, but there is no requirement 
that it be done this way always. The only requirement is that the code be 
executed before WeeWX first uses your new fields. If you go back to the 
section Adding a new type to the database 
 you will see 
mention of a couple of ways to include some code to be executed (look for 
the para starting 'Now, where do we put this bit of code?'). In this case 
you should follow the first suggestion and put your code in 
user/extensions.py. In your case just add something like (untested):

import weewx.units
weewx.units.obs_group_dict['Vbat']= 'group_volt'
weewx.units.obs_group_dict['Vsolar']  = 'group_volt'

save the file and restart WeeWX and WeeWX should interpret Vbat and Vsolar 
as voltages.

Gary

On Thursday, 25 April 2019 07:43:31 UTC+10, wysiwyg wrote:
>
> Hello !
>
> I have added a few observations to my weewx.
> I use a battery  and a solar panel to supply my sensor, so I added Vbat, 
> Isolar, Vsolar.
>
> This is working for a few month as unitless values (I can draw graph, use 
> cheetah labels like $day.Isolar.max, all is fine).
>
> Now I would like to use suitable units.
>
>
> let's start slowly, so I followed the documentation of voltage, because 
> group_volt already exists :-)
> I read here:  
> http://www.weewx.com/docs/customizing.htm#Assigning_a_unit_group
>
> and created a file:
> /usr/share/weewx/user/electricity.py
>
> containing:
> import weewx
> from weewx.engine import StdService
>
> import weewx.units
> weewx.units.obs_group_dict['Vbat']= 'group_volt'
> weewx.units.obs_group_dict['Vsolar']  = 'group_volt'
> #weewx.units.obs_group_dict['WVbat']   = 'group_volt'
> #weewx.units.obs_group_dict['WVsolar'] = 'group_volt'
>
> class AddElectricity(StdService):
>
> WVbat / WVsolar are not used yet (not in database), it will be my vbat & 
> Vsolar values for wind sensor that I have not finished to develop yet.
> I commented to avoid issues as those 2 are not yet in database schema.
>
> I prepared my file based on the example from documentation:
>
> import weewx
> from weewx.engine import StdService
>
> import weewx.units
> weewx.units.obs_group_dict['electricity'] = 'group_energy'
>
> class AddElectricity(StdService): # [...]
>
> But then, I wonder how it should be said to weewx that this new file is 
> here, waiting for processing? 
>
> I assume it's probably need to add something in [engine] section of 
> weewx.conf.
> I tried the following without sucess (added in dat_services)
>
>
> [Engine]
>
> [[Services]]
> # This section specifies the services that should be run. They are
> # grouped by type, and the order of services within each group
> # determines the order in which the services will be run.
> prep_services = weewx.engine.StdTimeSynch
> data_services = user.electricity.AddElectricity
> process_services = weewx.engine.StdConvert, weewx.engine.
> StdCalibrate, weewx.engine.StdQC, weewx.wxservices.StdWXCalculate
> archive_services = weewx.engine.StdArchive
> restful_services = weewx.restx.StdStationRegistry, weewx.restx.
> StdWunderground, weewx.restx.StdAWEKAS, user.windy.Windy
> #restful_services = weewx.restx.StdStationRegistry, 
> weewx.restx.StdWunderground, weewx.restx.StdPWSweather, 
> weewx.restx.StdCWOP, weewx.restx.StdWOW, weewx$
> report_services = weewx.engine.StdPrint, weewx.engine.StdReport
>
>
> help welcome :-)
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.