[weewx-user] Problem for public_html access with Weewx 5 and apache 2

2024-04-26 Thread Remy Lavabre
Hello,

Good morning,
I didn't find the answer to my problem in the various discussions on the 
WeeWX forum...

I installed Weewx 5 in a virtual environment.
So I have my weewx-data and weewx-venv directories in /home/---/

weewxd seems to "finally" work normally with the ~/weewx-data/public_html 
directory refreshing.

On version 4, the weewx public_html directory was /var/www/html/weewx 
ROOT:ROOT and did not pose a problem with the Apache 2 server.
Since the location of the web server changed in version 5, I put a symbolic 
link "weewx" in /var/www/html/ pointing to ~/weewx-data/public_html/weewx 
[sudo ln -s/ ~/ weewx-data/public_htmlweewx /var/www/html/weewx].

The rights of var/www/html remained ROOT:ROOT while the rights of 
~/weewx-data/public_html/weewx are those of the creator.

Filezilla navigation works correctly. Clicking on the symbolic link takes 
you to the new WeeWX 5 public_html directory.

However, when trying to connect through a web browser 
(http://xxx.xxx.xxx.xxx/weewx/index.html), I get the response:
:




*ForbiddenYou don't have permission to access this resource.Apache/2.4.59 
(Debian) Server at xxx.xxx.xxx.xxx Port 80*

I think it must just be a rights issue...?

*What is the recommended solution in Weewx 5 with Apache 2 to redirect 
Apache from /var/www/html to ~/weewx-data/public_html?*

Thanks a lot for the help! ;-)

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/1deda7f3-fa1e-4ab8-8ef7-a7b561fa9ffen%40googlegroups.com.


Re: [weewx-user] Problem for public_html access with Weewx 5 and apache 2

2024-04-26 Thread p q
Looks like a rights issue with Apache. Find the apache.conf file and you
probably need to enable access to the right directories.

On Fri, Apr 26, 2024 at 6:26 AM Remy Lavabre  wrote:

> Hello,
>
> Good morning,
> I didn't find the answer to my problem in the various discussions on the
> WeeWX forum...
>
> I installed Weewx 5 in a virtual environment.
> So I have my weewx-data and weewx-venv directories in /home/---/
>
> weewxd seems to "finally" work normally with the ~/weewx-data/public_html
> directory refreshing.
>
> On version 4, the weewx public_html directory was /var/www/html/weewx
> ROOT:ROOT and did not pose a problem with the Apache 2 server.
> Since the location of the web server changed in version 5, I put a
> symbolic link "weewx" in /var/www/html/ pointing to
> ~/weewx-data/public_html/weewx [sudo ln -s/ ~/ weewx-data/public_htmlweewx
> /var/www/html/weewx].
>
> The rights of var/www/html remained ROOT:ROOT while the rights of
> ~/weewx-data/public_html/weewx are those of the creator.
>
> Filezilla navigation works correctly. Clicking on the symbolic link takes
> you to the new WeeWX 5 public_html directory.
>
> However, when trying to connect through a web browser (
> http://xxx.xxx.xxx.xxx/weewx/index.html), I get the response:
> :
>
>
>
>
> *ForbiddenYou don't have permission to access this resource.Apache/2.4.59
> (Debian) Server at xxx.xxx.xxx.xxx Port 80*
>
> I think it must just be a rights issue...?
>
> *What is the recommended solution in Weewx 5 with Apache 2 to redirect
> Apache from /var/www/html to ~/weewx-data/public_html?*
>
> Thanks a lot for the help! ;-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/1deda7f3-fa1e-4ab8-8ef7-a7b561fa9ffen%40googlegroups.com
> 
> .
>


-- 
Peter Quinn
(415)794-2264

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAA1SM2360obeEWDpbFpSGtQBAyx%2BTxnoQcp8A%3DAyTzEpCX2q5Q%40mail.gmail.com.


Re: [weewx-user] Problem for public_html access with Weewx 5 and apache 2

2024-04-26 Thread Remy Lavabre
1/ if I try xxx.xxx.xxx.xxx/index.html -> Work fine, I've got the Apache2 
Debian Default Page (which is in /var/www/html/index.html).
2/ if i try xxx.xxx.xxx.xxx/weewx/index.html -> Forbidden - You don't have 
permission to access this resource. (with my symbolic link)

I've tried :
A/ sudo chown www-data ~/weewx-data/public_html -Rf
B/ sudo chmod 775 -R ~/weewx-data/public_html
--> Same thing

C/ sudo nano /etc/apache2/sites-available/000-default.conf and change 
"DocumentRoot /var/www/html" to "DocumentRoot ~/weewx-data/public_html"
 xxx.xxx.xxx.xxx/index.html *and* xxx.xxx.xxx.xxx/weewx/index.html does not 
work...

Any idear ??
Le vendredi 26 avril 2024 à 15:46:48 UTC+2, p q a écrit :

> Looks like a rights issue with Apache. Find the apache.conf file and you 
> probably need to enable access to the right directories.
>
> On Fri, Apr 26, 2024 at 6:26 AM Remy Lavabre  wrote:
>
>> Hello,
>>
>> Good morning,
>> I didn't find the answer to my problem in the various discussions on the 
>> WeeWX forum...
>>
>> I installed Weewx 5 in a virtual environment.
>> So I have my weewx-data and weewx-venv directories in /home/---/
>>
>> weewxd seems to "finally" work normally with the ~/weewx-data/public_html 
>> directory refreshing.
>>
>> On version 4, the weewx public_html directory was /var/www/html/weewx 
>> ROOT:ROOT and did not pose a problem with the Apache 2 server.
>> Since the location of the web server changed in version 5, I put a 
>> symbolic link "weewx" in /var/www/html/ pointing to 
>> ~/weewx-data/public_html/weewx [sudo ln -s/ ~/ weewx-data/public_htmlweewx 
>> /var/www/html/weewx].
>>
>> The rights of var/www/html remained ROOT:ROOT while the rights of 
>> ~/weewx-data/public_html/weewx are those of the creator.
>>
>> Filezilla navigation works correctly. Clicking on the symbolic link takes 
>> you to the new WeeWX 5 public_html directory.
>>
>> However, when trying to connect through a web browser (
>> http://xxx.xxx.xxx.xxx/weewx/index.html), I get the response:
>> :
>>
>>
>>
>>
>> *ForbiddenYou don't have permission to access this resource.Apache/2.4.59 
>> (Debian) Server at xxx.xxx.xxx.xxx Port 80*
>>
>> I think it must just be a rights issue...?
>>
>> *What is the recommended solution in Weewx 5 with Apache 2 to redirect 
>> Apache from /var/www/html to ~/weewx-data/public_html?*
>>
>> Thanks a lot for the help! ;-)
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "weewx-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to weewx-user+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/1deda7f3-fa1e-4ab8-8ef7-a7b561fa9ffen%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Peter Quinn
> (415)794-2264 <(415)%20794-2264>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5063d8d7-87cf-4fa7-973c-1a36e8f50d3dn%40googlegroups.com.


Re: [weewx-user] Problem for public_html access with Weewx 5 and apache 2

2024-04-26 Thread vince
I do it in the opposite direction.   The /var/www/html/weewx path is a 
directory.  The /home//weewx-data/public_html path is a symlink 'to' 
the webserver directory.

For a pip installation:
sudo mkdir /var/www/html/weewx
sudo chown ${WEEWXUSER}:${WEEWXUSER} /var/www/html/weewx
ln -s /var/www/html/weewx /home/${WEEWXUSER}/weewx-data/public_html


On Friday, April 26, 2024 at 7:53:03 AM UTC-7 Remy Lavabre wrote:

> 1/ if I try xxx.xxx.xxx.xxx/index.html -> Work fine, I've got the Apache2 
> Debian Default Page (which is in /var/www/html/index.html).
> 2/ if i try xxx.xxx.xxx.xxx/weewx/index.html -> Forbidden - You don't have 
> permission to access this resource. (with my symbolic link)
>
> I've tried :
> A/ sudo chown www-data ~/weewx-data/public_html -Rf
> B/ sudo chmod 775 -R ~/weewx-data/public_html
> --> Same thing
>
> C/ sudo nano /etc/apache2/sites-available/000-default.conf and change 
> "DocumentRoot /var/www/html" to "DocumentRoot ~/weewx-data/public_html"
>  xxx.xxx.xxx.xxx/index.html *and* xxx.xxx.xxx.xxx/weewx/index.html does 
> not work...
>
> Any idear ??
> Le vendredi 26 avril 2024 à 15:46:48 UTC+2, p q a écrit :
>
>> Looks like a rights issue with Apache. Find the apache.conf file and you 
>> probably need to enable access to the right directories.
>>
>> On Fri, Apr 26, 2024 at 6:26 AM Remy Lavabre  wrote:
>>
>>> Hello,
>>>
>>> Good morning,
>>> I didn't find the answer to my problem in the various discussions on the 
>>> WeeWX forum...
>>>
>>> I installed Weewx 5 in a virtual environment.
>>> So I have my weewx-data and weewx-venv directories in /home/---/
>>>
>>> weewxd seems to "finally" work normally with the 
>>> ~/weewx-data/public_html directory refreshing.
>>>
>>> On version 4, the weewx public_html directory was /var/www/html/weewx 
>>> ROOT:ROOT and did not pose a problem with the Apache 2 server.
>>> Since the location of the web server changed in version 5, I put a 
>>> symbolic link "weewx" in /var/www/html/ pointing to 
>>> ~/weewx-data/public_html/weewx [sudo ln -s/ ~/ weewx-data/public_htmlweewx 
>>> /var/www/html/weewx].
>>>
>>> The rights of var/www/html remained ROOT:ROOT while the rights of 
>>> ~/weewx-data/public_html/weewx are those of the creator.
>>>
>>> Filezilla navigation works correctly. Clicking on the symbolic link 
>>> takes you to the new WeeWX 5 public_html directory.
>>>
>>> However, when trying to connect through a web browser (
>>> http://xxx.xxx.xxx.xxx/weewx/index.html), I get the response:
>>> :
>>>
>>>
>>>
>>>
>>> *ForbiddenYou don't have permission to access this 
>>> resource.Apache/2.4.59 (Debian) Server at xxx.xxx.xxx.xxx Port 80*
>>>
>>> I think it must just be a rights issue...?
>>>
>>> *What is the recommended solution in Weewx 5 with Apache 2 to redirect 
>>> Apache from /var/www/html to ~/weewx-data/public_html?*
>>>
>>> Thanks a lot for the help! ;-)
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "weewx-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to weewx-user+...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/1deda7f3-fa1e-4ab8-8ef7-a7b561fa9ffen%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> Peter Quinn
>> (415)794-2264 <(415)%20794-2264>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/f25d43bb-628c-43a6-8f99-2c473c9cdee4n%40googlegroups.com.


[weewx-user] Re: formatting MQTT message sensor lenght

2024-04-26 Thread miso k
I have red on another forum, that the number is too big for HA to read it. 
Maybe I am wrong, but the possibilities that my configuration.yaml is wrong 
are limited already I hope

Dátum: štvrtok 25. apríla 2024, čas: 5:22:28 UTC+2, odosielateľ: 
michael.k...@gmx.at

> What's the problem with the number of digits? Are they displayed correctly 
> in HA? Or is there a problem for HA dealing with that number of digits 
> generally?
>
> miso k schrieb am Mittwoch, 24. April 2024 um 22:15:18 UTC+2:
>
>> Hello Weather observers,
>>
>> since long time my weewx server is running - and  updated to latest 5.0.2 
>> version.
>>
>> I want to export MQTT messages to Home Assistant, but the numbers are too 
>> long.
>> How can I make them shorter?
>> Example:
>> outHumidity = 91.0
>> inHumidity = 56.0
>> outTemp_C = 3.776
>> inTemp_C = 22.89
>> windSpeed_kph = 9.0123264
>> windGust_kph = 9.3341952
>>
>>
>> I have tried to format it through format = %.1f , but it does not seems 
>> to work
>>
>> My MQTT Configuration:
>>
>> [[MQTT]]
>> server_url = mqtt://xxx:xxx@localhost:1883/
>> topic = weather
>> unit_system = METRIC
>> binding = archive, loop
>> aggregation = individual
>> log_success = False
>> log_failure = True
>> [[[inputs]]]
>> outTemp
>> name = inside_temperature  # use a label other than 
>> outTemp
>> format = %.1f  # two decimal places of 
>> precision
>> unit = degree_F# convert outTemp to F, others 
>> in C
>> inTemp
>> unit = degree_C # use F instead of C
>> format = %.1f   # use two decimal places 
>> of precision
>> name = inside_temperature   # use label other than 
>> inTemp
>> windSpeed
>> units = meter_per_second# use knots instead of 
>> meter_per_second
>> format = %.1f   # use two decimal places 
>> of precision
>> name = wind_speed   # use label other than 
>> inTemp
>>
>> Thank you!
>> Michal
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/38e3f447-2d40-45b9-ae04-441b8230b086n%40googlegroups.com.


[weewx-user] Re: formatting MQTT message sensor lenght

2024-04-26 Thread miso k
I can read the MQTT message in HA built in MQTT plugin. So the server is 
correctly set up and MQTT client too. I can even read the messages in MQTT 
Explorer. 
The problem is, that the entity in HA is not updating and is "unknown". 

Dátum: piatok 26. apríla 2024, čas: 19:27:21 UTC+2, odosielateľ: miso k

> I have red on another forum, that the number is too big for HA to read it. 
> Maybe I am wrong, but the possibilities that my configuration.yaml is wrong 
> are limited already I hope
>
> Dátum: štvrtok 25. apríla 2024, čas: 5:22:28 UTC+2, odosielateľ: 
> michael.k...@gmx.at
>
>> What's the problem with the number of digits? Are they displayed 
>> correctly in HA? Or is there a problem for HA dealing with that number of 
>> digits generally?
>>
>> miso k schrieb am Mittwoch, 24. April 2024 um 22:15:18 UTC+2:
>>
>>> Hello Weather observers,
>>>
>>> since long time my weewx server is running - and  updated to latest 
>>> 5.0.2 version.
>>>
>>> I want to export MQTT messages to Home Assistant, but the numbers are 
>>> too long.
>>> How can I make them shorter?
>>> Example:
>>> outHumidity = 91.0
>>> inHumidity = 56.0
>>> outTemp_C = 3.776
>>> inTemp_C = 22.89
>>> windSpeed_kph = 9.0123264
>>> windGust_kph = 9.3341952
>>>
>>>
>>> I have tried to format it through format = %.1f , but it does not seems 
>>> to work
>>>
>>> My MQTT Configuration:
>>>
>>> [[MQTT]]
>>> server_url = mqtt://xxx:xxx@localhost:1883/
>>> topic = weather
>>> unit_system = METRIC
>>> binding = archive, loop
>>> aggregation = individual
>>> log_success = False
>>> log_failure = True
>>> [[[inputs]]]
>>> outTemp
>>> name = inside_temperature  # use a label other than 
>>> outTemp
>>> format = %.1f  # two decimal places of 
>>> precision
>>> unit = degree_F# convert outTemp to F, 
>>> others in C
>>> inTemp
>>> unit = degree_C # use F instead of C
>>> format = %.1f   # use two decimal places 
>>> of precision
>>> name = inside_temperature   # use label other than 
>>> inTemp
>>> windSpeed
>>> units = meter_per_second# use knots instead of 
>>> meter_per_second
>>> format = %.1f   # use two decimal places 
>>> of precision
>>> name = wind_speed   # use label other than 
>>> inTemp
>>>
>>> Thank you!
>>> Michal
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/a4cb6cfe-6ade-4fc3-80cf-f4706d3c3166n%40googlegroups.com.


[weewx-user] Re: formatting MQTT message sensor lenght

2024-04-26 Thread miso k
finally... the name should not be in "" and it needs to be without space I 
hope. I am getting value updates now.

Thanks everyone for pointing me the right direction!

Dátum: piatok 26. apríla 2024, čas: 19:29:52 UTC+2, odosielateľ: miso k

> I can read the MQTT message in HA built in MQTT plugin. So the server is 
> correctly set up and MQTT client too. I can even read the messages in MQTT 
> Explorer. 
> The problem is, that the entity in HA is not updating and is "unknown". 
>
> Dátum: piatok 26. apríla 2024, čas: 19:27:21 UTC+2, odosielateľ: miso k
>
>> I have red on another forum, that the number is too big for HA to read 
>> it. Maybe I am wrong, but the possibilities that my configuration.yaml is 
>> wrong are limited already I hope
>>
>> Dátum: štvrtok 25. apríla 2024, čas: 5:22:28 UTC+2, odosielateľ: 
>> michael.k...@gmx.at
>>
>>> What's the problem with the number of digits? Are they displayed 
>>> correctly in HA? Or is there a problem for HA dealing with that number of 
>>> digits generally?
>>>
>>> miso k schrieb am Mittwoch, 24. April 2024 um 22:15:18 UTC+2:
>>>
 Hello Weather observers,

 since long time my weewx server is running - and  updated to latest 
 5.0.2 version.

 I want to export MQTT messages to Home Assistant, but the numbers are 
 too long.
 How can I make them shorter?
 Example:
 outHumidity = 91.0
 inHumidity = 56.0
 outTemp_C = 3.776
 inTemp_C = 22.89
 windSpeed_kph = 9.0123264
 windGust_kph = 9.3341952


 I have tried to format it through format = %.1f , but it does not seems 
 to work

 My MQTT Configuration:

 [[MQTT]]
 server_url = mqtt://xxx:xxx@localhost:1883/
 topic = weather
 unit_system = METRIC
 binding = archive, loop
 aggregation = individual
 log_success = False
 log_failure = True
 [[[inputs]]]
 outTemp
 name = inside_temperature  # use a label other than 
 outTemp
 format = %.1f  # two decimal places of 
 precision
 unit = degree_F# convert outTemp to F, 
 others in C
 inTemp
 unit = degree_C # use F instead of C
 format = %.1f   # use two decimal 
 places of precision
 name = inside_temperature   # use label other than 
 inTemp
 windSpeed
 units = meter_per_second# use knots instead of 
 meter_per_second
 format = %.1f   # use two decimal 
 places of precision
 name = wind_speed   # use label other than 
 inTemp

 Thank you!
 Michal

>>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5308e5e6-fdbb-4a43-8e88-90a61974f8f0n%40googlegroups.com.


[weewx-user] Re: formatting MQTT message sensor lenght

2024-04-26 Thread vince
This works here with HA 2023.8 in a docker container:

  - name: "Outside"

device_class: "temperature"

state_topic: "vp2/loop"

unit_of_measurement: '°F'

value_template: "{{ value_json.outTemp | float | round(1) }}"



On Friday, April 26, 2024 at 10:38:22 AM UTC-7 miso k wrote:

> finally... the name should not be in "" and it needs to be without space I 
> hope. I am getting value updates now.
>
> Thanks everyone for pointing me the right direction!
>
> Dátum: piatok 26. apríla 2024, čas: 19:29:52 UTC+2, odosielateľ: miso k
>
>> I can read the MQTT message in HA built in MQTT plugin. So the server is 
>> correctly set up and MQTT client too. I can even read the messages in MQTT 
>> Explorer. 
>> The problem is, that the entity in HA is not updating and is "unknown". 
>>
>> Dátum: piatok 26. apríla 2024, čas: 19:27:21 UTC+2, odosielateľ: miso k
>>
>>> I have red on another forum, that the number is too big for HA to read 
>>> it. Maybe I am wrong, but the possibilities that my configuration.yaml is 
>>> wrong are limited already I hope
>>>
>>> Dátum: štvrtok 25. apríla 2024, čas: 5:22:28 UTC+2, odosielateľ: 
>>> michael.k...@gmx.at
>>>
 What's the problem with the number of digits? Are they displayed 
 correctly in HA? Or is there a problem for HA dealing with that number of 
 digits generally?

 miso k schrieb am Mittwoch, 24. April 2024 um 22:15:18 UTC+2:

> Hello Weather observers,
>
> since long time my weewx server is running - and  updated to latest 
> 5.0.2 version.
>
> I want to export MQTT messages to Home Assistant, but the numbers are 
> too long.
> How can I make them shorter?
> Example:
> outHumidity = 91.0
> inHumidity = 56.0
> outTemp_C = 3.776
> inTemp_C = 22.89
> windSpeed_kph = 9.0123264
> windGust_kph = 9.3341952
>
>
> I have tried to format it through format = %.1f , but it does not 
> seems to work
>
> My MQTT Configuration:
>
> [[MQTT]]
> server_url = mqtt://xxx:xxx@localhost:1883/
> topic = weather
> unit_system = METRIC
> binding = archive, loop
> aggregation = individual
> log_success = False
> log_failure = True
> [[[inputs]]]
> outTemp
> name = inside_temperature  # use a label other than 
> outTemp
> format = %.1f  # two decimal places of 
> precision
> unit = degree_F# convert outTemp to F, 
> others in C
> inTemp
> unit = degree_C # use F instead of C
> format = %.1f   # use two decimal 
> places of precision
> name = inside_temperature   # use label other than 
> inTemp
> windSpeed
> units = meter_per_second# use knots instead of 
> meter_per_second
> format = %.1f   # use two decimal 
> places of precision
> name = wind_speed   # use label other than 
> inTemp
>
> Thank you!
> Michal
>


-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/a8036a1d-c6f7-4c4d-9121-29e1927bdac5n%40googlegroups.com.


Re: [weewx-user] PID file not created in version 5.0.2

2024-04-26 Thread silke
Hi Thomas,
hm, what is the status code your weewx is showing when it dies (e.g. check 
"journatctl -xau weewx" and scroll back to the time of death) ? And does 
your monit log show any action?

My weewx is quite stable these days, so I resorted to testing monit 
operation by killing the weewx process manually (kill -9). It went into 
"failed" state:

silke@enterprise:~/bin$ sudo service weewx status
× weewx.service - WeeWX
 Loaded: loaded (/lib/systemd/system/weewx.service; enabled; preset: 
enabled)
 Active: failed (Result: signal) since Fri 2024-04-26 21:04:10 CEST; 
2min 32s ago
   Duration: 3d 12h 10min 45.985s
   Docs: https://weewx.com/docs
Process: 2517884 ExecStart=weewxd /etc/weewx/weewx.conf (code=killed, 
signal=KILL)
   Main PID: 2517884 (code=killed, signal=KILL)
CPU: 2d 52min 45.729s

[...]
Apr 26 21:04:10 enterprise systemd[1]: weewx.service: Main process exited, 
code=killed, status=9/KILL
Apr 26 21:04:10 enterprise systemd[1]: weewx.service: Failed with result 
'signal'.
Apr 26 21:04:10 enterprise systemd[1]: weewx.service: Consumed 2d 52min 
45.729s CPU time.

and then about 3mins later monit detected it and kicked in and started it 
again: 

silke@enterprise:~/bin$ tail -f /var/log/monit.log
[2024-04-26T21:07:02+0200] error: 'weewx' status failed (3) -- no output
[2024-04-26T21:07:02+0200] info : 'weewx' exec: '/usr/bin/systemctl 
start weewx.service'
[2024-04-26T21:07:02+0200] error: 'weewx' status failed (3) -- no output
[2024-04-26T21:09:03+0200] info : 'weewx' status succeeded (0) -- no 
output
[2024-04-26T21:09:04+0200] info : 'weewx' status succeeded (0) -- no 
output

which took another 2mins to fully succeed. 

Hope this helps,
Silke

Thomas Hackler schrieb am Donnerstag, 25. April 2024 um 15:16:33 UTC+2:

> Hello Silke,
> I added your config for weewx to my monit config file but for my case it 
> doesn't work. I have the problem that sometimes my gw1000 driver didn't 
> work, probalby because of wifi problems. See topic here:
>
> https://groups.google.com/g/weewx-user/c/muxtBGJWkJs
>
> It happened yesterday again but monit did not start weewx.
>
> Maybe you can help me?
> Regards
> Thomas
>
> silke schrieb am Samstag, 9. März 2024 um 23:54:02 UTC+1:
>
>> I'm sorry I saw your response a bit too late after posting here! Your 
>> comments were really helpful 
>>
>> In case there are others out there using monit, this is my new working 
>> config for weewx (avoiding use of PID altogether):
>>
>> check program weewx with path "/usr/bin/systemctl --quiet is-active weewx"
>> if status != 0 then alert
>> if status != 0 then exec "/usr/bin/systemctl start weewx.service"
>> if 10 restarts within 10 cycles then timeout
>>
>> Tom Keffer schrieb am Samstag, 9. März 2024 um 23:35:10 UTC+1:
>>
>>> I don't know what I can add to the comments I already made on the issues 
>>> list: the --pidfile option is only used if you use the --daemon option.
>>>
>>> On Sat, Mar 9, 2024 at 2:19 PM silke  wrote:
>>>
 Hello,

 I recently made the switch to v5 and overall the migration was working 
 quite smoothly, despite running many extensions and skins. I'm on Ubuntu 
 and use DEB installation.

 The one thing that is not working yet is my weewx process health 
 monitoring which is based on PID file. I cannot get weewx to create a PID 
 file whatever I try. (in v4 this worked out of the box)

 I'm adding the --pidfile option to the systemd file, and it shows 
 correctly in the process list:

 weewx 941451 51.1  8.7 1921212 1415068 ? Ssl  23:00   3:23 
 python3 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf --pidfile 
 /run/weewx/weewx.pid

 the folder /run/weewx is owned by weewx:weewx 

 silke@enterprise:/etc/weewx$ ls -la /run/weewx/
 total 0
 drwxrwxr-x  2 weewx weewx   40 Mär  9 23:00 .
 drwxr-xr-x 50 root  root  1420 Mär  9 23:00 ..

 but still, no file is getting created upon restart.

 Anyone having an idea what I'm doing wrong?

 Thanks a lot, Silke

 -- 
 You received this message because you are subscribed to the Google 
 Groups "weewx-user" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to weewx-user+...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/weewx-user/fb454ef9-ae53-4211-bf15-283bd067c567n%40googlegroups.com
  
 
 .

>>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/f7d11e78-153b-4427-ac