Hello Wysiwyg,
thank you for the interest. I changed the file weewx.conf accordingly. 
[WxMesh]
   topic = weewx
and under [[label]]
removed the line with Time. Unfortunately, no success! On my rasberrypi 2 I 
use Python 2.7.9 and weewx 3.8.0
-
To my weather station. I printed with fusion360 for the wind speed, wind 
direction and rain gauge (rocker) sensors. Other sensors measure the 
temperature at different altitudes, humidity and particulate matter (PM10 
and PM2.5). The ESP8266webserver sends in my private network. The data is 
displayed per html on a page. I would like to archive the data with weewx 
and present it more beautifully. Unfortunately I am a beginner in Python 
and have problems with the configuration of weewx in connection with mqtt. 
Bill is also trying to help me.
The simplest solution would be if you provided me with a working weewx.conf 
and a wxMseh.py. That would be nice!
Franz
---
pi@raspberrypi ~ $ sudo /etc/init.d/weewx status -l
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx)
   Active: active (exited) since Di 2018-05-22 19:16:06 CEST; 13s ago
  Process: 1437 ExecStop=/etc/init.d/weewx stop (code=exited, 
status=0/SUCCESS)
  Process: 1629 ExecStart=/etc/init.d/weewx start (code=exited, 
status=0/SUCCESS)

Mai 22 19:16:06 raspberrypi weewx[1643]: ****    File 
"/home/weewx/bin/weewx/engine.py", line 71, in __init__
Mai 22 19:16:06 raspberrypi weewx[1643]: ****      
self.setupStation(config_dict)
Mai 22 19:16:06 raspberrypi weewx[1643]: ****    File 
"/home/weewx/bin/weewx/engine.py", line 95, in setupStation
Mai 22 19:16:06 raspberrypi weewx[1643]: ****      __import__(driver)
Mai 22 19:16:06 raspberrypi weewx[1643]: ****    File 
"/home/weewx/bin/user/wxMesh.py", line 124
Mai 22 19:16:06 raspberrypi weewx[1643]: ****      yield _packet
Mai 22 19:16:06 raspberrypi weewx[1643]: ****  SyntaxError: 'yield' outside 
function
Mai 22 19:16:06 raspberrypi weewx[1643]: ****  Exiting.
Mai 22 19:16:06 raspberrypi systemd[1]: Started LSB: weewx weather system.
Mai 22 19:16:06 raspberrypi weewx[1629]: Starting weewx weather system: 
weewx.
pi@raspberrypi ~ $ ^C
pi@raspberry


Am Dienstag, 22. Mai 2018 18:19:17 UTC+2 schrieb Wysiwyg:
>
>
> Hi Franz,
>
> If you use my variant of the driver (the link provided by Bill), I noticed 
> a few differences in your weewx.conf (but it may not explain the issue):
>
> you have:
> [wxMesh]
>     ....
>     topic = weewx/+
>
> I have:
> [wxMesh]
>    .....
>    topic = weewx
>    client = weewx_mqtt   #(whatever you like) => should be no issue.
>
>
> I publish my sensors with topic "weewx/<weewx data label>", for example 
> "weewx/outTemp",  the data content is raw values, for example "23.2"  
> (degrees)
>
> I use weewx 3.8.0 and python 2.7.12  
>
> My label map include anything my weewx can take.  Also, to keep it simple, 
> I use same labels for mqtt & weewx (after a while playing with templates, I 
> know them almost by heart :-D).
>
> So my label map looks a bit stupid, just like this:
>
> [label_map]
>      outTemp = outTemp
>      barometer = barometer
>      .....
>
> I put all my database schematic there, except dateTime !
>
> An other thing that might cause issue :  you don't need dateTime in label 
> or in mqtt topics
>
> The driver will just pick the current time from the weewx device and set 
> this as timestamp.
> I assume it's good enought as poll interval is 1 or 2 seconds, see here:
>
> _packet = {'dateTime': int(time.time() + 0.5),'usUnits': weewx.METRIC}
>
>
>
> I'm not very good at python (I was barely able to modify Bill driver for my 
> need ;-)), but don't hesitate to ask again in case I'm not clear.
>
>
> One last thing: I move (very very slowly) my github from 
> https://github.com/bonjour81/ESP8266-MQTT-WEEWX  to  
> https://github.com/bonjour81/station_meteo
>
> I try (very very slowly) to learn how to use git a little more like it should 
> be
>
>
>
>
> Also, if you like, I would be very happy to discuss about your project ! 
> (separately from this discussion). it looks like we have a more or less 
> similar project (ESP8266 + mqtt + weewx).
>
>
> Best regards,
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Le mardi 22 mai 2018 16:31:20 UTC+2, Franz a écrit :
>>
>> Hello Bill,
>> Thanks for the wxMesh.py file. I have copied this file unchanged to / 
>> home / weewx / bin / user. With sudo chmod 777 wxMesh.py rights changed. 
>> Subsequently, with the Python 2 IDLE formatting error sought and removed. 
>> When checking with the IDLE: Run / Check Module -> "There's an error in 
>> your program: *** 'yield' outside funcion (wxMesh.py, line 124).
>> Maybe wxMesh.py is not compatible with weewx-3.8.0. Enclosed the current 
>> log file. Thanks again for your effort!
>> Franz
>> ——
>> pi@raspberrypi ~ $ sudo /etc/init.d/weewx start
>> [ ok ] Starting weewx (via systemctl): weewx.service.
>> pi@raspberrypi ~ $ sudo /etc/init.d/weewx status  -l
>> ● weewx.service - LSB: weewx weather system
>>    Loaded: loaded (/etc/init.d/weewx)
>>    Active: active (exited) since Di 2018-05-22 16:04:18 CEST; 3s ago
>>   Process: 2524 ExecStop=/etc/init.d/weewx stop (code=exited, 
>> status=0/SUCCESS)
>>   Process: 2636 ExecStart=/etc/init.d/weewx start (code=exited, 
>> status=0/SUCCESS)
>>
>> Mai 22 16:04:18 raspberrypi weewx[2650]: ****    File 
>> "/home/weewx/bin/weewx/engine.py", line 71, in __init__
>> Mai 22 16:04:18 raspberrypi weewx[2650]: ****      
>> self.setupStation(config_dict)
>> Mai 22 16:04:18 raspberrypi weewx[2650]: ****    File 
>> "/home/weewx/bin/weewx/engine.py", line 95, in setupStation
>> Mai 22 16:04:18 raspberrypi weewx[2650]: ****      __import__(driver)
>> Mai 22 16:04:18 raspberrypi weewx[2650]: ****    File 
>> "/home/weewx/bin/user/wxMesh.py", line 124
>> Mai 22 16:04:18 raspberrypi weewx[2650]: ****      yield _packet
>> Mai 22 16:04:18 raspberrypi weewx[2650]: ****  SyntaxError: 'yield' 
>> outside function
>> Mai 22 16:04:18 raspberrypi weewx[2650]: ****  Exiting.
>> Mai 22 16:04:18 raspberrypi systemd[1]: Started LSB: weewx weather system.
>> Mai 22 16:04:18 raspberrypi weewx[2636]: Starting weewx weather system: 
>> weewx.
>> Hint: Some lines were ellipsized, use -l to show in full.
>> pi@raspberrypi ~ $ sudo /etc/init.d/weewx stop
>> [ ok ] Stopping weewx (via systemctl): weewx.service.
>> pi@raspberrypi ~ $ 
>>
>>
>> Am Dienstag, 22. Mai 2018 14:05:36 UTC+2 schrieb Bill Morrow:
>>>
>>> I am guessing that you still have some problems with how wxMesh.py was 
>>> copied in to place.
>>>
>>> Try copying wxMesh.py as simple text by going to this link
>>>
>>>
>>> https://raw.githubusercontent.com/bonjour81/ESP8266-MQTT-WEEWX/master/weewx/wxMQTT.py
>>>
>>> right-click and "Save As" to your .../bin/user/wxMesh.py file.
>>>
>>> .. when I examine the code, it looks like there are some errors, though. 
>>> You could try the attached copy, where I have fixed some indentation. I 
>>> have not tested it myself.
>>>
>>>
>>>
>>>
>>>

Reply via email to