Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Les Niles
If you still have what you showed earlier

> [[Belchertown]]
>  [[[Extras]]]
> 
> mqtt_websockets_enabled = 1
> mqtt_websockets_host = gw.martenhinrichs.de 
> 
> mqtt_websockets_port = 9001
> mqtt_websockets_ssl = 1
> mqtt_websockets_topic = weather/loop

 
in your weewx.conf, that will override those variable settings in 
Belchertown/skin.conf.  Just put the IP address in weewx.conf in place of 
gw.martenhinrichs.de .

There is an instance of mosquitto already running.  Probably time to reboot the 
pi. 

  -Les



> On 27 Mar 2021, at 17:43, Tom Hackett  wrote:
> 
> This is my Belchertown skin setup
> # MQTT Websockets defaults
> mqtt_websockets_enabled = 0
> mqtt_websockets_host = "192.168.1.170"
> mqtt_websockets_port = 9001
> mqtt_websockets_ssl = 0
> mqtt_websockets_topic = "weather/loop"
> disconnect_live_website_visitor = 30
> 
> I tried sudo netstat -anp | grep 9001 and got 
> pi@raspberrypi:~ $ sudo netstat -anp | grep 9001
> tcp0  0 0.0.0.0:9001 0.0.0.0:*  
>  LISTEN  27650/mosquitto 
> pi@raspberrypi:~ $ # MQTT Websockets defaults
> pi@raspberrypi:~ $ mqtt_websockets_enabled = 0
> bash: mqtt_websockets_enabled: command not found
> pi@raspberrypi:~ $ mqtt_websockets_host = "192.168.1.170"
> bash: mqtt_websockets_host: command not found
> pi@raspberrypi:~ $ mqtt_websockets_port = 9001
> bash: mqtt_websockets_port: command not found
> pi@raspberrypi:~ $ mqtt_websockets_ssl = 0
> bash: mqtt_websockets_ssl: command not found
> pi@raspberrypi:~ $ mqtt_websockets_topic = "weather/loop"
> bash: mqtt_websockets_topic: command not found
> pi@raspberrypi:~ $ disconnect_live_website_visitor = 30
> 
> I'll try tomorrow to find what is running.
> Thanks,Tom
> 
> On Sat, Mar 27, 2021 at 8:32 PM Les Niles  > wrote:
> Now it looks like something else is already running on port 9001.  Without 
> trying to start mosquitto, see what you get with
> sudo netstat -anp | grep 9001
> If you get something like “tcp0  0 0.0.0.0:9001 
>  0.0.0.0:* LISTEN   9676/something” then there’s another instance of 
>  running on port 9001; that number right before the “/“ is the 
> process ID.  
> 
> If not, then undo the last change and see if the publishing at least works 
> again, because obviously I don’t know what I’m talking about.
> 
> BTW, once you get the publishing working again, if your web browser is 
> running on the same pi, or at least on the same 192.168.1 subnet, then for 
> testing purposes you could replace gw.martenhinrichs.de 
>  with the 192.168.1.170 IP address in the 
> [[Belchertown]][[[Extras]]] config; if that magically makes it work, then the 
> issue is related to your networking rather than the broker itself.   
> 
>   -Les
> 
> 
> 
>> On 27 Mar 2021, at 15:52, Tom Hackett > > wrote:
>> 
>> Thanks.
>> I took out those lines. Since everything is running on same pi I figured I 
>> wouldn't need any special networking.
>> I'm now getting a connection refused.
>> Mosquitto.log:
>> 1616884948: mosquitto version 1.5.7 starting
>> 1616884948: Config loaded from /etc/mosquitto/mosquitto.conf.
>> 1616884948: Opening ipv4 listen socket on port 1883.
>> 1616884948: Opening ipv6 listen socket on port 1883.
>> 1616884948: Opening websockets listen socket on port 9001.
>> 1616884948: Error: Unable to create websockets listener on port 9001.
>> 1616884948: mosquitto version 1.5.7 starting
>> 1616884948: Config loaded from /etc/mosquitto/mosquitto.conf.
>> 1616884948: Opening ipv4 listen socket on port 1883.
>> 1616884948: Opening ipv6 listen socket on port 1883.
>> 1616884948: Opening websockets listen socket on port 9001.
>> 1616884948: Error: Unable to create websockets listener on port 9001.
>> 
>> syslog:
>> Mar 27 18:43:52 raspberrypi weewx[8242] ERROR weewx.restx: MQTT: Failed to 
>> publish record 2021-03-27 18:02:56 EDT (1616882576): Failed upload after 3 
>> tries
>> Mar 27 18:43:52 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload 
>> attempt 1: [Errno 111] Connection refused
>> Mar 27 18:43:57 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload 
>> attempt 2: [Errno 111] Connection refused
>> Mar 27 18:44:00 raspberrypi weewx[8242] DEBUG user.gw1000: Next update in 20 
>> seconds
>> Mar 27 18:44:02 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload 
>> attempt 3: [Errno 111] Connection refused
>> Mar 27 18:44:04 raspberrypi weewx[8242] DEBUG user.gw1000: Next update in 20 
>> seconds
>> Mar 27 18:44:07 raspberrypi weewx[8242] ERROR weewx.restx: MQTT: Failed to 
>> publish record 2021-03-27 18:02:59 EDT (1616882579): Failed upload after 3 
>> tries
>> Mar 27 18:44:07 raspberrypi weewx[8242] DEBUG user.mqtt: 

Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Tom Hackett
This is my Belchertown skin setup
# MQTT Websockets defaults
mqtt_websockets_enabled = 0
mqtt_websockets_host = "192.168.1.170"
mqtt_websockets_port = 9001
mqtt_websockets_ssl = 0
mqtt_websockets_topic = "weather/loop"
disconnect_live_website_visitor = 30

I tried sudo netstat -anp | grep 9001 and got
pi@raspberrypi:~ $ sudo netstat -anp | grep 9001
tcp0  0 0.0.0.0:90010.0.0.0:*   LISTEN
 27650/mosquitto
pi@raspberrypi:~ $ # MQTT Websockets defaults
pi@raspberrypi:~ $ mqtt_websockets_enabled = 0
bash: mqtt_websockets_enabled: command not found
pi@raspberrypi:~ $ mqtt_websockets_host = "192.168.1.170"
bash: mqtt_websockets_host: command not found
pi@raspberrypi:~ $ mqtt_websockets_port = 9001
bash: mqtt_websockets_port: command not found
pi@raspberrypi:~ $ mqtt_websockets_ssl = 0
bash: mqtt_websockets_ssl: command not found
pi@raspberrypi:~ $ mqtt_websockets_topic = "weather/loop"
bash: mqtt_websockets_topic: command not found
pi@raspberrypi:~ $ disconnect_live_website_visitor = 30

I'll try tomorrow to find what is running.
Thanks,Tom

On Sat, Mar 27, 2021 at 8:32 PM Les Niles  wrote:

> Now it looks like something else is already running on port 9001.  Without
> trying to start mosquitto, see what you get with
> sudo netstat -anp | grep 9001
> If you get something like “tcp0  0 0.0.0.0:9001 0.0.0.0:*
> LISTEN   9676/something” then there’s another instance of 
> running on port 9001; that number right before the “/“ is the process ID.
>
> If not, then undo the last change and see if the publishing at least works
> again, because obviously I don’t know what I’m talking about.
>
> BTW, once you get the publishing working again, if your web browser is
> running on the same pi, or at least on the same 192.168.1 subnet, then for
> testing purposes you could replace gw.martenhinrichs.de with the
> 192.168.1.170 IP address in the [[Belchertown]][[[Extras]]] config; if that
> magically makes it work, then the issue is related to your networking
> rather than the broker itself.
>
>   -Les
>
>
>
> On 27 Mar 2021, at 15:52, Tom Hackett  wrote:
>
> Thanks.
> I took out those lines. Since everything is running on same pi I figured I
> wouldn't need any special networking.
> I'm now getting a connection refused.
> Mosquitto.log:
> 1616884948: mosquitto version 1.5.7 starting
> 1616884948: Config loaded from /etc/mosquitto/mosquitto.conf.
> 1616884948: Opening ipv4 listen socket on port 1883.
> 1616884948: Opening ipv6 listen socket on port 1883.
> 1616884948: Opening websockets listen socket on port 9001.
> 1616884948: Error: Unable to create websockets listener on port 9001.
> 1616884948: mosquitto version 1.5.7 starting
> 1616884948: Config loaded from /etc/mosquitto/mosquitto.conf.
> 1616884948: Opening ipv4 listen socket on port 1883.
> 1616884948: Opening ipv6 listen socket on port 1883.
> 1616884948: Opening websockets listen socket on port 9001.
> 1616884948: Error: Unable to create websockets listener on port 9001.
>
> syslog:
> Mar 27 18:43:52 raspberrypi weewx[8242] ERROR weewx.restx: MQTT: Failed to
> publish record 2021-03-27 18:02:56 EDT (1616882576): Failed upload after 3
> tries
> Mar 27 18:43:52 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload
> attempt 1: [Errno 111] Connection refused
> Mar 27 18:43:57 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload
> attempt 2: [Errno 111] Connection refused
> Mar 27 18:44:00 raspberrypi weewx[8242] DEBUG user.gw1000: Next update in
> 20 seconds
> Mar 27 18:44:02 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload
> attempt 3: [Errno 111] Connection refused
> Mar 27 18:44:04 raspberrypi weewx[8242] DEBUG user.gw1000: Next update in
> 20 seconds
> Mar 27 18:44:07 raspberrypi weewx[8242] ERROR weewx.restx: MQTT: Failed to
> publish record 2021-03-27 18:02:59 EDT (1616882579): Failed upload after 3
> tries
> Mar 27 18:44:07 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload
> attempt 1: [Errno 111] Connection refused
> Mar 27 18:44:12 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload
> attempt 2: [Errno 111] Connection refused
> Mar 27 18:44:17 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload
> attempt 3: [Errno 111] Connection refused
> Mar 27 18:44:21 raspberrypi weewx[8242] DEBUG user.gw1000: Next update in
> 20 seconds
>
> When I run systemctl status mosquitto.service I get
> mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker
>Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor
> preset: enabled)
>Active: failed (Result: exit-code) since Sat 2021-03-27 18:42:29 EDT;
> 8min ago
>  Docs: man:mosquitto.conf(5)
>man:mosquitto(8)
>   Process: 20719 ExecStart=/usr/sbin/mosquitto -c
> /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE)
>  Main PID: 20719 (code=exited, status=1/FAILURE)
>
> Mar 27 18:42:29 raspberrypi systemd[1]: mosquitto.service: Service
> RestartSec=100ms expired, 

Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Les Niles
Now it looks like something else is already running on port 9001.  Without 
trying to start mosquitto, see what you get with
sudo netstat -anp | grep 9001
If you get something like “tcp0  0 0.0.0.0:9001 0.0.0.0:* LISTEN   
9676/something” then there’s another instance of  running on port 
9001; that number right before the “/“ is the process ID.  

If not, then undo the last change and see if the publishing at least works 
again, because obviously I don’t know what I’m talking about.

BTW, once you get the publishing working again, if your web browser is running 
on the same pi, or at least on the same 192.168.1 subnet, then for testing 
purposes you could replace gw.martenhinrichs.de  
with the 192.168.1.170 IP address in the [[Belchertown]][[[Extras]]] config; if 
that magically makes it work, then the issue is related to your networking 
rather than the broker itself.   

  -Les



> On 27 Mar 2021, at 15:52, Tom Hackett  wrote:
> 
> Thanks.
> I took out those lines. Since everything is running on same pi I figured I 
> wouldn't need any special networking.
> I'm now getting a connection refused.
> Mosquitto.log:
> 1616884948: mosquitto version 1.5.7 starting
> 1616884948: Config loaded from /etc/mosquitto/mosquitto.conf.
> 1616884948: Opening ipv4 listen socket on port 1883.
> 1616884948: Opening ipv6 listen socket on port 1883.
> 1616884948: Opening websockets listen socket on port 9001.
> 1616884948: Error: Unable to create websockets listener on port 9001.
> 1616884948: mosquitto version 1.5.7 starting
> 1616884948: Config loaded from /etc/mosquitto/mosquitto.conf.
> 1616884948: Opening ipv4 listen socket on port 1883.
> 1616884948: Opening ipv6 listen socket on port 1883.
> 1616884948: Opening websockets listen socket on port 9001.
> 1616884948: Error: Unable to create websockets listener on port 9001.
> 
> syslog:
> Mar 27 18:43:52 raspberrypi weewx[8242] ERROR weewx.restx: MQTT: Failed to 
> publish record 2021-03-27 18:02:56 EDT (1616882576): Failed upload after 3 
> tries
> Mar 27 18:43:52 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload 
> attempt 1: [Errno 111] Connection refused
> Mar 27 18:43:57 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload 
> attempt 2: [Errno 111] Connection refused
> Mar 27 18:44:00 raspberrypi weewx[8242] DEBUG user.gw1000: Next update in 20 
> seconds
> Mar 27 18:44:02 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload 
> attempt 3: [Errno 111] Connection refused
> Mar 27 18:44:04 raspberrypi weewx[8242] DEBUG user.gw1000: Next update in 20 
> seconds
> Mar 27 18:44:07 raspberrypi weewx[8242] ERROR weewx.restx: MQTT: Failed to 
> publish record 2021-03-27 18:02:59 EDT (1616882579): Failed upload after 3 
> tries
> Mar 27 18:44:07 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload 
> attempt 1: [Errno 111] Connection refused
> Mar 27 18:44:12 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload 
> attempt 2: [Errno 111] Connection refused
> Mar 27 18:44:17 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload 
> attempt 3: [Errno 111] Connection refused
> Mar 27 18:44:21 raspberrypi weewx[8242] DEBUG user.gw1000: Next update in 20 
> seconds
> 
> When I run systemctl status mosquitto.service I get 
> mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker
>Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor 
> preset: enabled)
>Active: failed (Result: exit-code) since Sat 2021-03-27 18:42:29 EDT; 8min 
> ago
>  Docs: man:mosquitto.conf(5)
>man:mosquitto(8)
>   Process: 20719 ExecStart=/usr/sbin/mosquitto -c 
> /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE)
>  Main PID: 20719 (code=exited, status=1/FAILURE)
> 
> Mar 27 18:42:29 raspberrypi systemd[1]: mosquitto.service: Service 
> RestartSec=100ms expired, scheduling restart.
> Mar 27 18:42:29 raspberrypi systemd[1]: mosquitto.service: Scheduled restart 
> job, restart counter is at 5.
> Mar 27 18:42:29 raspberrypi systemd[1]: Stopped Mosquitto MQTT v3.1/v3.1.1 
> Broker.
> Mar 27 18:42:29 raspberrypi systemd[1]: mosquitto.service: Start request 
> repeated too quickly.
> Mar 27 18:42:29 raspberrypi systemd[1]: mosquitto.service: Failed with result 
> 'exit-code'.
> Mar 27 18:42:29 raspberrypi systemd[1]: Failed to start Mosquitto MQTT 
> v3.1/v3.1.1 Broker.
> 
> I seemed to have gone backwards today.
> 
> 
> 
> On Sat, Mar 27, 2021 at 6:35 PM Les Niles  > wrote:
> The only odd thing I see now are the certfile, cafile, and keyfile lines 
> under the websockets listener — that may be turning on SSL for websockets.  
> You can just delete those lines (along with the second “protocol 
> websockets”).  
> 
> And confirm that you’ve restarted mosquitto, so the conf changes will take 
> effect?
> 
> The other potential issue is network topology & routing.  
> gw.martenhinrichs.de  presumably points to the 
> mosquitto server’s internal IP 192.168.1.170.  

[weewx-user] Custom Search Min/Max/Avg during daylight hours

2021-03-27 Thread Russell van vlack
I want to be able to find the min/max/avg value for various weather 
observations (uv index for example) but only during the time when the sun 
is up. I am struggling to write a custom search item for that and wonder 
who could get it started for me or lead me in a good direction.

If it is before sunrise for the day, the min/max/avg would all be null or 
undefined or none... something like that.
If it is after sunrise but before sunset, the min/max/avg would be 
calculated from sunrise to current time.
If it is after both sunrise and sunset, the min/max/avg would be calculated 
for times between the sunrise and sunset times only.

Is it possible?

Any thoughts or help would be appreciated. I'm not a real adept Python 
programmer.


-- 
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/3686b446-573e-4170-ae10-2160a0471234n%40googlegroups.com.


Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Tom Hackett
Thanks.
I took out those lines. Since everything is running on same pi I figured I
wouldn't need any special networking.
I'm now getting a connection refused.
Mosquitto.log:
1616884948: mosquitto version 1.5.7 starting
1616884948: Config loaded from /etc/mosquitto/mosquitto.conf.
1616884948: Opening ipv4 listen socket on port 1883.
1616884948: Opening ipv6 listen socket on port 1883.
1616884948: Opening websockets listen socket on port 9001.
1616884948: Error: Unable to create websockets listener on port 9001.
1616884948: mosquitto version 1.5.7 starting
1616884948: Config loaded from /etc/mosquitto/mosquitto.conf.
1616884948: Opening ipv4 listen socket on port 1883.
1616884948: Opening ipv6 listen socket on port 1883.
1616884948: Opening websockets listen socket on port 9001.
1616884948: Error: Unable to create websockets listener on port 9001.

syslog:
Mar 27 18:43:52 raspberrypi weewx[8242] ERROR weewx.restx: MQTT: Failed to
publish record 2021-03-27 18:02:56 EDT (1616882576): Failed upload after 3
tries
Mar 27 18:43:52 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload
attempt 1: [Errno 111] Connection refused
Mar 27 18:43:57 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload
attempt 2: [Errno 111] Connection refused
Mar 27 18:44:00 raspberrypi weewx[8242] DEBUG user.gw1000: Next update in
20 seconds
Mar 27 18:44:02 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload
attempt 3: [Errno 111] Connection refused
Mar 27 18:44:04 raspberrypi weewx[8242] DEBUG user.gw1000: Next update in
20 seconds
Mar 27 18:44:07 raspberrypi weewx[8242] ERROR weewx.restx: MQTT: Failed to
publish record 2021-03-27 18:02:59 EDT (1616882579): Failed upload after 3
tries
Mar 27 18:44:07 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload
attempt 1: [Errno 111] Connection refused
Mar 27 18:44:12 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload
attempt 2: [Errno 111] Connection refused
Mar 27 18:44:17 raspberrypi weewx[8242] DEBUG user.mqtt: Failed upload
attempt 3: [Errno 111] Connection refused
Mar 27 18:44:21 raspberrypi weewx[8242] DEBUG user.gw1000: Next update in
20 seconds

When I run systemctl status mosquitto.service I get
mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker
   Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor
preset: enabled)
   Active: failed (Result: exit-code) since Sat 2021-03-27 18:42:29 EDT;
8min ago
 Docs: man:mosquitto.conf(5)
   man:mosquitto(8)
  Process: 20719 ExecStart=/usr/sbin/mosquitto -c
/etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE)
 Main PID: 20719 (code=exited, status=1/FAILURE)

Mar 27 18:42:29 raspberrypi systemd[1]: mosquitto.service: Service
RestartSec=100ms expired, scheduling restart.
Mar 27 18:42:29 raspberrypi systemd[1]: mosquitto.service: Scheduled
restart job, restart counter is at 5.
Mar 27 18:42:29 raspberrypi systemd[1]: Stopped Mosquitto MQTT v3.1/v3.1.1
Broker.
Mar 27 18:42:29 raspberrypi systemd[1]: mosquitto.service: Start request
repeated too quickly.
Mar 27 18:42:29 raspberrypi systemd[1]: mosquitto.service: Failed with
result 'exit-code'.
Mar 27 18:42:29 raspberrypi systemd[1]: Failed to start Mosquitto MQTT
v3.1/v3.1.1 Broker.

I seemed to have gone backwards today.



On Sat, Mar 27, 2021 at 6:35 PM Les Niles  wrote:

> The only odd thing I see now are the certfile, cafile, and keyfile lines
> under the websockets listener — that may be turning on SSL for websockets.
> You can just delete those lines (along with the second “protocol
> websockets”).
>
> And confirm that you’ve restarted mosquitto, so the conf changes will take
> effect?
>
> The other potential issue is network topology & routing.
> gw.martenhinrichs.de presumably points to the mosquitto server’s internal
> IP 192.168.1.170.  Does that address translation work for connecting from
> wherever your web browser is running?  I had to do some config on my router
> to make the “hairpin” connection work.
>
>   -Les
>
>
>
> On 27 Mar 2021, at 12:52, Tom Hackett  wrote:
>
> /etc/mosquitto/mosquitto.conf:
>
>
>
>
>
>
>
>
>
>
>
>
>
> *# Place your local configuration in /etc/mosquitto/conf.d/## A full
> description of the configuration file is at#
> /usr/share/doc/mosquitto/examples/mosquitto.conf.example#pid_file
> /var/run/mosquitto.pidpersistence truepersistence_location
> /var/lib/mosquitto/log_dest file
> /var/log/mosquitto/mosquitto.loginclude_dir /etc/mosquitto/conf.d*
>
> */etc/mosquitto/conf.d/mosquitto.conf:*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *# Place your local configuration in /etc/mosquitto/conf.d/## A full
> description of the configuration file is at#
> /usr/share/doc/mosquitto/examples/mosquitto.conf.examplepid_file
> /var/run/mosquitto.pid#persistence falseallow_anonymous truepassword_file
> /etc/mosquitto/passwdacl_file /etc/mosquitto/acl# Insecure mqtt to
> localhost only, and secure mqttlistener 1883 localhostlistener 8883certfile
> /etc/mosquitto/certs/cert.pemcafile 

Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Les Niles
The only odd thing I see now are the certfile, cafile, and keyfile lines under 
the websockets listener — that may be turning on SSL for websockets.  You can 
just delete those lines (along with the second “protocol websockets”).  

And confirm that you’ve restarted mosquitto, so the conf changes will take 
effect?

The other potential issue is network topology & routing.  gw.martenhinrichs.de 
 presumably points to the mosquitto server’s 
internal IP 192.168.1.170.  Does that address translation work for connecting 
from wherever your web browser is running?  I had to do some config on my 
router to make the “hairpin” connection work. 

  -Les



> On 27 Mar 2021, at 12:52, Tom Hackett  wrote:
> 
> /etc/mosquitto/mosquitto.conf:
> # Place your local configuration in /etc/mosquitto/conf.d/
> #
> # A full description of the configuration file is at
> # /usr/share/doc/mosquitto/examples/mosquitto.conf.example
> 
> #pid_file /var/run/mosquitto.pid
> 
> 
> persistence true
> persistence_location /var/lib/mosquitto/
> 
> log_dest file /var/log/mosquitto/mosquitto.log
> 
> include_dir /etc/mosquitto/conf.d
> 
> /etc/mosquitto/conf.d/mosquitto.conf:
> # Place your local configuration in /etc/mosquitto/conf.d/
> #
> # A full description of the configuration file is at
> # /usr/share/doc/mosquitto/examples/mosquitto.conf.example
> 
> pid_file /var/run/mosquitto.pid
> 
> #persistence false
> allow_anonymous true
> password_file /etc/mosquitto/passwd
> acl_file /etc/mosquitto/acl
> # Insecure mqtt to localhost only, and secure mqtt
> listener 1883 localhost
> listener 8883
> certfile /etc/mosquitto/certs/cert.pem
> cafile /etc/mosquitto/certs/chain.pem
> keyfile /etc/mosquitto/certs/privkey.pem
> protocol mqtt
> # websockets
> listener 9001
> protocol websockets
> certfile /etc/mosquitto/certs/cert.pem
> cafile /etc/mosquitto/certs/chain.pem
> keyfile /etc/mosquitto/certs/privkey.pem
> protocol websockets
> 
> #persistence_location /var/lib/mosquitto/
> 
> log_dest file /var/log/mosquitto/mosquitto.log
> 
> The acl:
> # Allow anonymous access to the sys
> topic read $SYS/#
> 
> # Allow anonymous to read weather
> topic read weather/#
> 
> # weewx readwrite to the loop
> user 
> topic weather/#
> 
> Here is part of mosquitto log:
> 1616874562: New connection from 192.168.1.170 on port 1883.
> 1616874562: New client connected from 192.168.1.170 as weewx_4b8e89f4 (c1, 
> k60, u'tph06784').
> 1616874562: Client weewx_4b8e89f4 disconnected.
> 1616874563: New connection from 192.168.1.170 on port 1883.
> 1616874563: New client connected from 192.168.1.170 as weewx_17c9704e (c1, 
> k60, u'tph06784').
> 1616874563: Client weewx_17c9704e disconnected.
> 1616874565: New connection from 192.168.1.170 on port 1883.
> 1616874565: New client connected from 192.168.1.170 as weewx_3ad70f87 (c1, 
> k60, u'tph06784').
> 1616874565: Client weewx_3ad70f87 disconnected.
> 1616874583: New connection from 192.168.1.170 on port 1883.
> 1616874583: New client connected from 192.168.1.170 as weewx_4d17e0e9 (c1, 
> k60, u'tph06784').
> 1616874584: Client weewx_4d17e0e9 disconnected.
> 1616874585: New connection from 192.168.1.170 on port 1883.
> 1616874585: New client connected from 192.168.1.170 as weewx_aa8f33c8 (c1, 
> k60, u'tph06784').
> 1616874585: Client weewx_aa8f33c8 disconnected.
> 1616874603: New connection from 192.168.1.170 on port 1883.
> 1616874603: New client connected from 192.168.1.170 as weewx_76212562 (c1, 
> k60, u'tph06784').
> 1616874603: Client weewx_76212562 disconnected.
> 1616874605: New connection from 192.168.1.170 on port 1883.
> 
> Thanks for taking the time to look at this.
> Tom
> 
> On Sat, Mar 27, 2021 at 3:06 PM Les Niles  > wrote:
> The include_dir line in mosquitto.conf is commented out, so the stuff in 
> /etc/mosquitto/conf.d/mosquitto.conf never gets picked up.  Remove the “#” at 
> the beginning of the line. Also, remove the include_dir line in 
> /etc/mosquitto/conf.d/mosquitto.conf to avoid a potentially infinite 
> recursion. 
> 
> Please post your acl_file (should be /etc/mosquitto/acl).  It should have a 
> line like
> topic read weather/#
> near the top, to enable anonymous read access.
> 
> What are you seeing in the mosquitto log?
> 
>   -Les
> 
> 
> 
>> On 27 Mar 2021, at 11:41, Tom Hackett > > wrote:
>> 
>> I believe SSL is off. I have mqtt_websockets_ssl = 0 in my skin.conf
>> My mqtt (mosquito) config file is in /etc/mosquitto/mosquitto.conf is
>> # Place your local configuration in /etc/mosquitto/conf.d/
>> #
>> # A full description of the configuration file is at
>> # /usr/share/doc/mosquitto/examples/mosquitto.conf.example
>> 
>> pid_file /var/run/mosquitto.pid
>> 
>> persistence true
>> persistence_location /var/lib/mosquitto/
>> 
>> log_dest file /var/log/mosquitto/mosquitto.log
>> 
>> #include_dir /etc/mosquitto/conf.d
>> 
>> There is also in /etc/mosquitto/conf.d/mosquitto.conf
>> # Place your local 

Re: [weewx-user] Re: webserver-integration failed

2021-03-27 Thread Stephan Schmieg
Hi,

thank you for all the replys on my post. I decided to do a clean reinstall, 
based on the instructions on jackstromberg.com . Usually, doing an apt-get 
install installation is the easiest way, but it doesn't provide a lot of 
feedback I could post here. Thanks paricularly to Rainer Lang, who lead me 
to this webpage.

Kind regards

Stephan

vince schrieb am Samstag, 27. März 2021 um 20:20:40 UTC+1:

> Did you post a followup to the wrong thread ?
> Didn't you mean to post to the one you opened about MQTT issues ?
>
> On Saturday, March 27, 2021 at 10:52:55 AM UTC-7 tom0...@gmail.com wrote:
>
>> Weewx is running.
>> You can see it here www.shermanctweather.org/weewx
>>
>> I used to install sudo apt-get install weewx
>> *I tried to include all I can think of but will provide anything you 
>> want.*
>>
>> *Thanks for looking at this.  I really appreciate it.*
>>  
>> [[MQTT]]
>> server_url = mqtt://tph06784:03...@192.168.1.170:1883 
>> 
>> topic = weather
>> unit_system = US
>> binding = archive, loop
>> aggregation = aggregate
>> log_success = true
>> In extras
>>  # MQTT Websockets defaults
>> mqtt_websockets_enabled = 1
>> mqtt_websockets_host = "192.168.1.170"
>> mqtt_websockets_port = 9001
>> mqtt_websockets_ssl = 0
>> mqtt_websockets_topic = "weather/loop"
>> disconnect_live_website_visitor = 30
>> Part of syslog:
>> ar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: service version is 
>> 0.23
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: binding to 
>> ['archive', 'loop']
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: topic is weather
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: desired unit 
>> system is US
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: data will be 
>> uploaded to mqtt://tph06784:xxx@localhost:1883
>> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Finished 
>> loading service user.mqtt.MQTT
>> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Loading 
>> service weewx.engine.StdPrint
>> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Finished 
>> loading service weewx.engine.StdPrint
>> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Loading 
>> service weewx.engine.StdReport
>> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Finished 
>> loading service weewx.engine.StdReport
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO __main__: Starting up weewx 
>> version 4.4.0
>> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Station does 
>> not support reading the time
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.engine: Using binding 
>> 'wx_binding' to database 'weewx.sdb'
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.manager: Starting 
>> backfill of daily summaries
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.manager: Daily 
>> summaries up to date
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.engine: Starting main 
>> packet loop.
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.gw1000: Using 'rainyear' 
>> for rain total
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.gw1000: skipping rain 
>> measurement of 170.6: no last rain
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.gw1000: Using 'rainyear' 
>> for rain total
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.gw1000: skipping rain 
>> measurement of 170.6: no last rain
>> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.manager: Daily summary 
>> version is 4.0
>> Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.wxxtypes: Type beaufort 
>> has been deprecated. Use unit beaufort instead.
>> Mar 27 12:01:23 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published 
>> record 2021-03-27 12:01:16 EDT (1616860876)
>> Mar 27 12:01:34 raspberrypi kernel: [   89.084095] Bluetooth: HIDP (Human 
>> Interface Emulation) ver 1.2
>> Mar 27 12:01:34 raspberrypi kernel: [   89.084114] Bluetooth: HIDP socket 
>> layer initialized
>> Mar 27 12:01:34 raspberrypi kernel: [   89.096967] apple 
>> 0005:05AC:0255.0002: unknown main item tag 0x0
>> Mar 27 12:01:34 raspberrypi kernel: [   89.098125] input: Cathy Hackett’s 
>> Keyboard as 
>> /devices/platform/soc/fe201000.serial/tty/ttyAMA0/hci0/hci0:11/0005:05AC:0255.0002/input/input1
>> Mar 27 12:01:34 raspberrypi kernel: [   89.100666] apple 
>> 0005:05AC:0255.0002: input,hidraw1: BLUETOOTH HID v0.50 Keyboard [Cathy 
>> Hackett’s Keyboard] on dc:a6:32:e9:5b:77
>> Mar 27 12:01:34 raspberrypi systemd-udevd[1713]: Process 
>> '/usr/sbin/th-cmd --socket /var/run/thd.socket --passfd --udev' failed with 
>> exit code 1.
>> Mar 27 12:01:37 raspberrypi weewx[558] DEBUG user.gw1000: Next update in 
>> 20 seconds
>> Mar 27 12:01:37 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published 
>> record 2021-03-27 12:01:36 EDT (1616860896)
>> Mar 27 12:01:39 raspberrypi weewx[558] DEBUG user.gw1000: Next update in 
>> 20 

Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Tom Hackett
/etc/mosquitto/mosquitto.conf:













*# Place your local configuration in /etc/mosquitto/conf.d/## A full
description of the configuration file is at#
/usr/share/doc/mosquitto/examples/mosquitto.conf.example#pid_file
/var/run/mosquitto.pidpersistence truepersistence_location
/var/lib/mosquitto/log_dest file
/var/log/mosquitto/mosquitto.loginclude_dir /etc/mosquitto/conf.d*

*/etc/mosquitto/conf.d/mosquitto.conf:*




























*# Place your local configuration in /etc/mosquitto/conf.d/## A full
description of the configuration file is at#
/usr/share/doc/mosquitto/examples/mosquitto.conf.examplepid_file
/var/run/mosquitto.pid#persistence falseallow_anonymous truepassword_file
/etc/mosquitto/passwdacl_file /etc/mosquitto/acl# Insecure mqtt to
localhost only, and secure mqttlistener 1883 localhostlistener 8883certfile
/etc/mosquitto/certs/cert.pemcafile /etc/mosquitto/certs/chain.pemkeyfile
/etc/mosquitto/certs/privkey.pemprotocol mqtt# websocketslistener
9001protocol websocketscertfile /etc/mosquitto/certs/cert.pemcafile
/etc/mosquitto/certs/chain.pemkeyfile
/etc/mosquitto/certs/privkey.pemprotocol websockets#persistence_location
/var/lib/mosquitto/log_dest file /var/log/mosquitto/mosquitto.log*

*The acl:*









*# Allow anonymous access to the systopic read $SYS/## Allow anonymous to
read weathertopic read weather/## weewx readwrite to the loopuser
topic weather/#*

*Here is part of mosquitto log:*
1616874562: New connection from 192.168.1.170 on port 1883.
1616874562: New client connected from 192.168.1.170 as weewx_4b8e89f4 (c1,
k60, u'tph06784').
1616874562: Client weewx_4b8e89f4 disconnected.
1616874563: New connection from 192.168.1.170 on port 1883.
1616874563: New client connected from 192.168.1.170 as weewx_17c9704e (c1,
k60, u'tph06784').
1616874563: Client weewx_17c9704e disconnected.
1616874565: New connection from 192.168.1.170 on port 1883.
1616874565: New client connected from 192.168.1.170 as weewx_3ad70f87 (c1,
k60, u'tph06784').
1616874565: Client weewx_3ad70f87 disconnected.
1616874583: New connection from 192.168.1.170 on port 1883.
1616874583: New client connected from 192.168.1.170 as weewx_4d17e0e9 (c1,
k60, u'tph06784').
1616874584: Client weewx_4d17e0e9 disconnected.
1616874585: New connection from 192.168.1.170 on port 1883.
1616874585: New client connected from 192.168.1.170 as weewx_aa8f33c8 (c1,
k60, u'tph06784').
1616874585: Client weewx_aa8f33c8 disconnected.
1616874603: New connection from 192.168.1.170 on port 1883.
1616874603: New client connected from 192.168.1.170 as weewx_76212562 (c1,
k60, u'tph06784').
1616874603: Client weewx_76212562 disconnected.
1616874605: New connection from 192.168.1.170 on port 1883.

Thanks for taking the time to look at this.
Tom

On Sat, Mar 27, 2021 at 3:06 PM Les Niles  wrote:

> The include_dir line in mosquitto.conf is commented out, so the stuff in
> /etc/mosquitto/conf.d/mosquitto.conf never gets picked up.  Remove the “#”
> at the beginning of the line. Also, remove the include_dir line in
> /etc/mosquitto/conf.d/mosquitto.conf to avoid a potentially infinite
> recursion.
>
> Please post your acl_file (should be /etc/mosquitto/acl).  It should have
> a line like
> topic read weather/#
> near the top, to enable anonymous read access.
>
> What are you seeing in the mosquitto log?
>
>   -Les
>
>
>
> On 27 Mar 2021, at 11:41, Tom Hackett  wrote:
>
> I believe SSL is off. I have mqtt_websockets_ssl = 0 in my skin.conf
> My mqtt (mosquito) config file is in /etc/mosquitto/mosquitto.conf is
> # Place your local configuration in /etc/mosquitto/conf.d/
>
>
>
>
>
>
>
>
>
>
>
> *## A full description of the configuration file is at#
> /usr/share/doc/mosquitto/examples/mosquitto.conf.examplepid_file
> /var/run/mosquitto.pidpersistence truepersistence_location
> /var/lib/mosquitto/log_dest file
> /var/log/mosquitto/mosquitto.log#include_dir /etc/mosquitto/conf.d*
>
> *There is also in /etc/mosquitto/conf.d/mosquitto.conf*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *# Place your local configuration in /etc/mosquitto/conf.d/## A full
> description of the configuration file is at#
> /usr/share/doc/mosquitto/examples/mosquitto.conf.example#pid_file
> /var/run/mosquitto.pidpersistence falseallow_anonymous truepassword_file
> /etc/mosquitto/passwdacl_file /etc/mosquitto/acl# Insecure mqtt to
> localhost only, and secure mqttlistener 1883 localhostlistener 8883certfile
> /etc/mosquitto/certs/cert.pemcafile /etc/mosquitto/certs/chain.pemkeyfile
> /etc/mosquitto/certs/privkey.pemprotocol mqtt# websocketslistener
> 9001certfile /etc/mosquitto/certs/cert.pemcafile
> /etc/mosquitto/certs/chain.pemkeyfile
> /etc/mosquitto/certs/privkey.pemprotocol websockets#persistence_location
> /var/lib/mosquitto/log_dest file
> /var/log/mosquitto/mosquitto.loginclude_dir /etc/mosquitto/conf.d*
>
> Tom
>
> On Sat, Mar 27, 2021 at 2:30 PM Les Niles  wrote:
>
>> It looks like weewx is sending updates to the mqtt server.  But the web

Re: [weewx-user] Re: webserver-integration failed

2021-03-27 Thread vince
Did you post a followup to the wrong thread ?
Didn't you mean to post to the one you opened about MQTT issues ?

On Saturday, March 27, 2021 at 10:52:55 AM UTC-7 tom0...@gmail.com wrote:

> Weewx is running.
> You can see it here www.shermanctweather.org/weewx
>
> I used to install sudo apt-get install weewx
> *I tried to include all I can think of but will provide anything you want.*
>
> *Thanks for looking at this.  I really appreciate it.*
>  
> [[MQTT]]
> server_url = mqtt://tph06784:03...@192.168.1.170:1883 
> 
> topic = weather
> unit_system = US
> binding = archive, loop
> aggregation = aggregate
> log_success = true
> In extras
>  # MQTT Websockets defaults
> mqtt_websockets_enabled = 1
> mqtt_websockets_host = "192.168.1.170"
> mqtt_websockets_port = 9001
> mqtt_websockets_ssl = 0
> mqtt_websockets_topic = "weather/loop"
> disconnect_live_website_visitor = 30
> Part of syslog:
> ar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: service version is 
> 0.23
> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: binding to 
> ['archive', 'loop']
> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: topic is weather
> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: desired unit system 
> is US
> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: data will be 
> uploaded to mqtt://tph06784:xxx@localhost:1883
> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Finished 
> loading service user.mqtt.MQTT
> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Loading service 
> weewx.engine.StdPrint
> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Finished 
> loading service weewx.engine.StdPrint
> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Loading service 
> weewx.engine.StdReport
> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Finished 
> loading service weewx.engine.StdReport
> Mar 27 12:01:22 raspberrypi weewx[558] INFO __main__: Starting up weewx 
> version 4.4.0
> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Station does 
> not support reading the time
> Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.engine: Using binding 
> 'wx_binding' to database 'weewx.sdb'
> Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.manager: Starting 
> backfill of daily summaries
> Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.manager: Daily summaries 
> up to date
> Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.engine: Starting main 
> packet loop.
> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.gw1000: Using 'rainyear' 
> for rain total
> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.gw1000: skipping rain 
> measurement of 170.6: no last rain
> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.gw1000: Using 'rainyear' 
> for rain total
> Mar 27 12:01:22 raspberrypi weewx[558] INFO user.gw1000: skipping rain 
> measurement of 170.6: no last rain
> Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.manager: Daily summary 
> version is 4.0
> Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.wxxtypes: Type beaufort 
> has been deprecated. Use unit beaufort instead.
> Mar 27 12:01:23 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published 
> record 2021-03-27 12:01:16 EDT (1616860876)
> Mar 27 12:01:34 raspberrypi kernel: [   89.084095] Bluetooth: HIDP (Human 
> Interface Emulation) ver 1.2
> Mar 27 12:01:34 raspberrypi kernel: [   89.084114] Bluetooth: HIDP socket 
> layer initialized
> Mar 27 12:01:34 raspberrypi kernel: [   89.096967] apple 
> 0005:05AC:0255.0002: unknown main item tag 0x0
> Mar 27 12:01:34 raspberrypi kernel: [   89.098125] input: Cathy Hackett’s 
> Keyboard as 
> /devices/platform/soc/fe201000.serial/tty/ttyAMA0/hci0/hci0:11/0005:05AC:0255.0002/input/input1
> Mar 27 12:01:34 raspberrypi kernel: [   89.100666] apple 
> 0005:05AC:0255.0002: input,hidraw1: BLUETOOTH HID v0.50 Keyboard [Cathy 
> Hackett’s Keyboard] on dc:a6:32:e9:5b:77
> Mar 27 12:01:34 raspberrypi systemd-udevd[1713]: Process '/usr/sbin/th-cmd 
> --socket /var/run/thd.socket --passfd --udev' failed with exit code 1.
> Mar 27 12:01:37 raspberrypi weewx[558] DEBUG user.gw1000: Next update in 
> 20 seconds
> Mar 27 12:01:37 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published 
> record 2021-03-27 12:01:36 EDT (1616860896)
> Mar 27 12:01:39 raspberrypi weewx[558] DEBUG user.gw1000: Next update in 
> 20 seconds
> Mar 27 12:01:39 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published 
> record 2021-03-27 12:01:39 EDT (1616860899)
> Mar 27 12:01:57 raspberrypi weewx[558] DEBUG user.gw1000: Next update in 
> 20 seconds
> Mar 27 12:01:57 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published 
> record 2021-03-27 12:01:57 EDT (1616860917)
> Mar 27 12:01:59 raspberrypi weewx[558] DEBUG user.gw1000: Next update in 
> 20 seconds
> Mar 27 12:01:59 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published 
> record 

Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Les Niles
The include_dir line in mosquitto.conf is commented out, so the stuff in 
/etc/mosquitto/conf.d/mosquitto.conf never gets picked up.  Remove the “#” at 
the beginning of the line. Also, remove the include_dir line in 
/etc/mosquitto/conf.d/mosquitto.conf to avoid a potentially infinite recursion. 

Please post your acl_file (should be /etc/mosquitto/acl).  It should have a 
line like
topic read weather/#
near the top, to enable anonymous read access.

What are you seeing in the mosquitto log?

  -Les



> On 27 Mar 2021, at 11:41, Tom Hackett  wrote:
> 
> I believe SSL is off. I have mqtt_websockets_ssl = 0 in my skin.conf
> My mqtt (mosquito) config file is in /etc/mosquitto/mosquitto.conf is
> # Place your local configuration in /etc/mosquitto/conf.d/
> #
> # A full description of the configuration file is at
> # /usr/share/doc/mosquitto/examples/mosquitto.conf.example
> 
> pid_file /var/run/mosquitto.pid
> 
> persistence true
> persistence_location /var/lib/mosquitto/
> 
> log_dest file /var/log/mosquitto/mosquitto.log
> 
> #include_dir /etc/mosquitto/conf.d
> 
> There is also in /etc/mosquitto/conf.d/mosquitto.conf
> # Place your local configuration in /etc/mosquitto/conf.d/
> #
> # A full description of the configuration file is at
> # /usr/share/doc/mosquitto/examples/mosquitto.conf.example
> 
> #pid_file /var/run/mosquitto.pid
> 
> persistence false
> allow_anonymous true
> password_file /etc/mosquitto/passwd
> acl_file /etc/mosquitto/acl
> # Insecure mqtt to localhost only, and secure mqtt
> listener 1883 localhost
> listener 8883
> certfile /etc/mosquitto/certs/cert.pem
> cafile /etc/mosquitto/certs/chain.pem
> keyfile /etc/mosquitto/certs/privkey.pem
> protocol mqtt
> # websockets
> listener 9001
> certfile /etc/mosquitto/certs/cert.pem
> cafile /etc/mosquitto/certs/chain.pem
> keyfile /etc/mosquitto/certs/privkey.pem
> protocol websockets
> 
> #persistence_location /var/lib/mosquitto/
> 
> log_dest file /var/log/mosquitto/mosquitto.log
> 
> include_dir /etc/mosquitto/conf.d
> 
> Tom
> 
> On Sat, Mar 27, 2021 at 2:30 PM Les Niles  > wrote:
> It looks like weewx is sending updates to the mqtt server.  But the web 
> browser isn’t connecting to the mqtt server to retrieve those updates.  
> Please post your mqtt (mosquito) config file — you need to have websockets 
> enabled there, on port 9001.  
> 
> My suggestion is to turn off SSL on the websockets connection. If you’re not 
> doing authentication on the websockets log-in — usually it’s just set up as 
> read-only but publicly-available — then I don’t see much use for encrypting 
> the connection.  At any rate, turn off SSL until you get everything working 
> without it.
> 
>   -Les
> 
> 
> 
>> On 27 Mar 2021, at 9:46, Tom Hackett > > wrote:
>> 
>> This is the mosquitto log since the change
>> 1616862009: New connection from 192.168.1.170 on port 1883.
>> 1616862009: New client connected from 192.168.1.170 as weewx_94c44d84 (c1, 
>> k60, u'tph06784').
>> 1616862009: Client weewx_94c44d84 disconnected.
>> 1616862028: New connection from 192.168.1.170 on port 1883.
>> 1616862028: New client connected from 192.168.1.170 as weewx_61789889 (c1, 
>> k60, u'tph06784').
>> 1616862028: Client weewx_61789889 disconnected.
>> 1616862030: New connection from 192.168.1.170 on port 1883.
>> 1616862030: New client connected from 192.168.1.170 as weewx_28e94234 (c1, 
>> k60, u'tph06784').
>> 1616862030: Client weewx_28e94234 disconnected.
>> 1616862048: New connection from 192.168.1.170 on port 1883.
>> 1616862048: New client connected from 192.168.1.170 as weewx_38f31fdb (c1, 
>> k60, u'tph06784').
>> 1616862048: Client weewx_38f31fdb disconnected.
>> 
>> On Sat, Mar 27, 2021 at 12:42 PM Tom Hackett > > wrote:
>> I have changed MQTT to
>> [[MQTT]]
>> server_url = mqtt://tph06784:0350@192.168.1.170:1883 
>> 
>> topic = weather
>> unit_system = US
>> binding = archive, loop
>> aggregation = aggregate
>> log_success = true1883
>> 
>> No change
>> 
>> On Sat, Mar 27, 2021 at 11:51 AM vince > > wrote:
>> > server_url = mqtt://tph06784:@localhost:1883 <>
>> 
>> This is becoming a FAQ.
>> 
>> Do not use 'localhost'.  Use the fully qualified domain name of the MQTT 
>> broker host or its IP address.
>> 
>> On Saturday, March 27, 2021 at 8:47:11 AM UTC-7 mh081...@gmail.com 
>>  wrote:
>> Hi,
>> 
>> if you will that mqtt working from ootside of your website you must config 
>> public dns names . 
>> 
>> example from mx site
>> 
>> weewx.conf
>> 
>> [[MQTT]]
>> server_url = mqtt://pi:pass...@gw.martenhinrichs.de:8883/ 
>> 
>> topic = weather
>> unit_system = METRIC
>> binding = archive, loop
>> aggregation = aggregate
>> log_success = False
>>

Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Tom Hackett
I believe SSL is off. I have mqtt_websockets_ssl = 0 in my skin.conf
My mqtt (mosquito) config file is in /etc/mosquitto/mosquitto.conf is
# Place your local configuration in /etc/mosquitto/conf.d/











*## A full description of the configuration file is at#
/usr/share/doc/mosquitto/examples/mosquitto.conf.examplepid_file
/var/run/mosquitto.pidpersistence truepersistence_location
/var/lib/mosquitto/log_dest file
/var/log/mosquitto/mosquitto.log#include_dir /etc/mosquitto/conf.d*

*There is also in /etc/mosquitto/conf.d/mosquitto.conf*





























*# Place your local configuration in /etc/mosquitto/conf.d/## A full
description of the configuration file is at#
/usr/share/doc/mosquitto/examples/mosquitto.conf.example#pid_file
/var/run/mosquitto.pidpersistence falseallow_anonymous truepassword_file
/etc/mosquitto/passwdacl_file /etc/mosquitto/acl# Insecure mqtt to
localhost only, and secure mqttlistener 1883 localhostlistener 8883certfile
/etc/mosquitto/certs/cert.pemcafile /etc/mosquitto/certs/chain.pemkeyfile
/etc/mosquitto/certs/privkey.pemprotocol mqtt# websocketslistener
9001certfile /etc/mosquitto/certs/cert.pemcafile
/etc/mosquitto/certs/chain.pemkeyfile
/etc/mosquitto/certs/privkey.pemprotocol websockets#persistence_location
/var/lib/mosquitto/log_dest file
/var/log/mosquitto/mosquitto.loginclude_dir /etc/mosquitto/conf.d*

Tom

On Sat, Mar 27, 2021 at 2:30 PM Les Niles  wrote:

> It looks like weewx is sending updates to the mqtt server.  But the web
> browser isn’t connecting to the mqtt server to retrieve those updates.
> Please post your mqtt (mosquito) config file — you need to have websockets
> enabled there, on port 9001.
>
> My suggestion is to turn off SSL on the websockets connection. If you’re
> not doing authentication on the websockets log-in — usually it’s just set
> up as read-only but publicly-available — then I don’t see much use for
> encrypting the connection.  At any rate, turn off SSL until you get
> everything working without it.
>
>   -Les
>
>
>
> On 27 Mar 2021, at 9:46, Tom Hackett  wrote:
>
> This is the mosquitto log since the change
> 1616862009: New connection from 192.168.1.170 on port 1883.
> 1616862009: New client connected from 192.168.1.170 as weewx_94c44d84 (c1,
> k60, u'tph06784').
> 1616862009: Client weewx_94c44d84 disconnected.
> 1616862028: New connection from 192.168.1.170 on port 1883.
> 1616862028: New client connected from 192.168.1.170 as weewx_61789889 (c1,
> k60, u'tph06784').
> 1616862028: Client weewx_61789889 disconnected.
> 1616862030: New connection from 192.168.1.170 on port 1883.
> 1616862030: New client connected from 192.168.1.170 as weewx_28e94234 (c1,
> k60, u'tph06784').
> 1616862030: Client weewx_28e94234 disconnected.
> 1616862048: New connection from 192.168.1.170 on port 1883.
> 1616862048: New client connected from 192.168.1.170 as weewx_38f31fdb (c1,
> k60, u'tph06784').
> 1616862048: Client weewx_38f31fdb disconnected.
>
> On Sat, Mar 27, 2021 at 12:42 PM Tom Hackett  wrote:
>
>> I have changed MQTT to
>> [[MQTT]]
>> server_url = mqtt://tph06784:0350@192.168.1.170:1883
>> topic = weather
>> unit_system = US
>> binding = archive, loop
>> aggregation = aggregate
>> log_success = true1883
>>
>> No change
>>
>> On Sat, Mar 27, 2021 at 11:51 AM vince  wrote:
>>
>>> > server_url = mqtt://tph06784:@localhost:1883
>>>
>>> This is becoming a FAQ.
>>>
>>> Do not use 'localhost'.  Use the fully qualified domain name of the MQTT
>>> broker host or its IP address.
>>>
>>> On Saturday, March 27, 2021 at 8:47:11 AM UTC-7 mh081...@gmail.com
>>> wrote:
>>>
 Hi,

 if you will that mqtt working from ootside of your website you must
 config public dns names .

 example from mx site

 weewx.conf

 [[MQTT]]
 server_url = mqtt://pi:pass...@gw.martenhinrichs.de:8883/
 
 topic = weather
 unit_system = METRIC
 binding = archive, loop
 aggregation = aggregate
 log_success = False
 log_failure = True
 [[[tls]]]
 tls_version = tlsv12
 ca_certs = /etc/ssl/certs/ca-certificates.crt
 [[[inputs]]]
 dayRain
 name = dayRain_mm
 units = mm
 rainRate
 name = rainRate_mm_per_hour
 units = mm_per_hour

 [[Belchertown]]
  [[[Extras]]]

 mqtt_websockets_enabled = 1
 mqtt_websockets_host = gw.martenhinrichs.de
 mqtt_websockets_port = 9001
 mqtt_websockets_ssl = 1
 mqtt_websockets_topic = weather/loop


 Only difference i use ssl and metric



 tom0...@gmail.com schrieb am Samstag, 27. März 2021 um 15:33:58 UTC+1:


Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Les Niles
It looks like weewx is sending updates to the mqtt server.  But the web browser 
isn’t connecting to the mqtt server to retrieve those updates.  Please post 
your mqtt (mosquito) config file — you need to have websockets enabled there, 
on port 9001.  

My suggestion is to turn off SSL on the websockets connection. If you’re not 
doing authentication on the websockets log-in — usually it’s just set up as 
read-only but publicly-available — then I don’t see much use for encrypting the 
connection.  At any rate, turn off SSL until you get everything working without 
it.

  -Les



> On 27 Mar 2021, at 9:46, Tom Hackett  wrote:
> 
> This is the mosquitto log since the change
> 1616862009: New connection from 192.168.1.170 on port 1883.
> 1616862009: New client connected from 192.168.1.170 as weewx_94c44d84 (c1, 
> k60, u'tph06784').
> 1616862009: Client weewx_94c44d84 disconnected.
> 1616862028: New connection from 192.168.1.170 on port 1883.
> 1616862028: New client connected from 192.168.1.170 as weewx_61789889 (c1, 
> k60, u'tph06784').
> 1616862028: Client weewx_61789889 disconnected.
> 1616862030: New connection from 192.168.1.170 on port 1883.
> 1616862030: New client connected from 192.168.1.170 as weewx_28e94234 (c1, 
> k60, u'tph06784').
> 1616862030: Client weewx_28e94234 disconnected.
> 1616862048: New connection from 192.168.1.170 on port 1883.
> 1616862048: New client connected from 192.168.1.170 as weewx_38f31fdb (c1, 
> k60, u'tph06784').
> 1616862048: Client weewx_38f31fdb disconnected.
> 
> On Sat, Mar 27, 2021 at 12:42 PM Tom Hackett  > wrote:
> I have changed MQTT to
> [[MQTT]]
> server_url = mqtt://tph06784:0350@192.168.1.170:1883 
> 
> topic = weather
> unit_system = US
> binding = archive, loop
> aggregation = aggregate
> log_success = true1883
> 
> No change
> 
> On Sat, Mar 27, 2021 at 11:51 AM vince  > wrote:
> > server_url = mqtt://tph06784:@localhost:1883
> 
> This is becoming a FAQ.
> 
> Do not use 'localhost'.  Use the fully qualified domain name of the MQTT 
> broker host or its IP address.
> 
> On Saturday, March 27, 2021 at 8:47:11 AM UTC-7 mh081...@gmail.com 
>  wrote:
> Hi,
> 
> if you will that mqtt working from ootside of your website you must config 
> public dns names . 
> 
> example from mx site
> 
> weewx.conf
> 
> [[MQTT]]
> server_url = mqtt://pi:pass...@gw.martenhinrichs.de:8883/ 
> 
> topic = weather
> unit_system = METRIC
> binding = archive, loop
> aggregation = aggregate
> log_success = False
> log_failure = True
> [[[tls]]]
> tls_version = tlsv12
> ca_certs = /etc/ssl/certs/ca-certificates.crt
> [[[inputs]]]
> dayRain
> name = dayRain_mm
> units = mm
> rainRate
> name = rainRate_mm_per_hour
> units = mm_per_hour
> 
> [[Belchertown]]
>  [[[Extras]]]
> 
> mqtt_websockets_enabled = 1
> mqtt_websockets_host = gw.martenhinrichs.de 
> 
> mqtt_websockets_port = 9001
> mqtt_websockets_ssl = 1
> mqtt_websockets_topic = weather/loop
> 
> 
> Only difference i use ssl and metric
> 
> 
> 
> tom0...@gmail.com <> schrieb am Samstag, 27. März 2021 um 15:33:58 UTC+1:
> Site only says Connecting to weather station real time data and no updates 
> are happening.
> 
> On Sat, Mar 27, 2021 at 10:25 AM Graham Eddy > wrote:
> what’s not working?
> 
>> On 28 Mar 2021, at 12:33 am, Tom Hackett > wrote:
>> 
>> I just can't figure this out.
> 
> 
> -- 
> 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/7A79B922-E098-48AE-A46C-3A128A3F9D90%40gmail.com
>  
> .
> 
> 
> -- 
> http://www.shermanctweather.org/wxgraphic.php?type=banner_big 
> https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>  
> https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>  
> https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>  
> http://www.shermanctweather.org/wxgraphic.php?type=banner_big
>  

Re: [weewx-user] Re: webserver-integration failed

2021-03-27 Thread Tom Hackett
Weewx is running.
You can see it here www.shermanctweather.org/weewx

I used to install sudo apt-get install weewx
*I tried to include all I can think of but will provide anything you want.*

*Thanks for looking at this.  I really appreciate it.*

[[MQTT]]
server_url = mqtt://tph06784:0350@192.168.1.170:1883
topic = weather
unit_system = US
binding = archive, loop
aggregation = aggregate
log_success = true
In extras
 # MQTT Websockets defaults
mqtt_websockets_enabled = 1
mqtt_websockets_host = "192.168.1.170"
mqtt_websockets_port = 9001
mqtt_websockets_ssl = 0
mqtt_websockets_topic = "weather/loop"
disconnect_live_website_visitor = 30
Part of syslog:
ar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: service version is
0.23
Mar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: binding to
['archive', 'loop']
Mar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: topic is weather
Mar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: desired unit system
is US
Mar 27 12:01:22 raspberrypi weewx[558] INFO user.mqtt: data will be
uploaded to mqtt://tph06784:xxx@localhost:1883
Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Finished loading
service user.mqtt.MQTT
Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Loading service
weewx.engine.StdPrint
Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Finished loading
service weewx.engine.StdPrint
Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Loading service
weewx.engine.StdReport
Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Finished loading
service weewx.engine.StdReport
Mar 27 12:01:22 raspberrypi weewx[558] INFO __main__: Starting up weewx
version 4.4.0
Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.engine: Station does not
support reading the time
Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.engine: Using binding
'wx_binding' to database 'weewx.sdb'
Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.manager: Starting
backfill of daily summaries
Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.manager: Daily summaries
up to date
Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.engine: Starting main
packet loop.
Mar 27 12:01:22 raspberrypi weewx[558] INFO user.gw1000: Using 'rainyear'
for rain total
Mar 27 12:01:22 raspberrypi weewx[558] INFO user.gw1000: skipping rain
measurement of 170.6: no last rain
Mar 27 12:01:22 raspberrypi weewx[558] INFO user.gw1000: Using 'rainyear'
for rain total
Mar 27 12:01:22 raspberrypi weewx[558] INFO user.gw1000: skipping rain
measurement of 170.6: no last rain
Mar 27 12:01:22 raspberrypi weewx[558] DEBUG weewx.manager: Daily summary
version is 4.0
Mar 27 12:01:22 raspberrypi weewx[558] INFO weewx.wxxtypes: Type beaufort
has been deprecated. Use unit beaufort instead.
Mar 27 12:01:23 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published
record 2021-03-27 12:01:16 EDT (1616860876)
Mar 27 12:01:34 raspberrypi kernel: [   89.084095] Bluetooth: HIDP (Human
Interface Emulation) ver 1.2
Mar 27 12:01:34 raspberrypi kernel: [   89.084114] Bluetooth: HIDP socket
layer initialized
Mar 27 12:01:34 raspberrypi kernel: [   89.096967] apple
0005:05AC:0255.0002: unknown main item tag 0x0
Mar 27 12:01:34 raspberrypi kernel: [   89.098125] input: Cathy Hackett’s
Keyboard as
/devices/platform/soc/fe201000.serial/tty/ttyAMA0/hci0/hci0:11/0005:05AC:0255.0002/input/input1
Mar 27 12:01:34 raspberrypi kernel: [   89.100666] apple
0005:05AC:0255.0002: input,hidraw1: BLUETOOTH HID v0.50 Keyboard [Cathy
Hackett’s Keyboard] on dc:a6:32:e9:5b:77
Mar 27 12:01:34 raspberrypi systemd-udevd[1713]: Process '/usr/sbin/th-cmd
--socket /var/run/thd.socket --passfd --udev' failed with exit code 1.
Mar 27 12:01:37 raspberrypi weewx[558] DEBUG user.gw1000: Next update in 20
seconds
Mar 27 12:01:37 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published
record 2021-03-27 12:01:36 EDT (1616860896)
Mar 27 12:01:39 raspberrypi weewx[558] DEBUG user.gw1000: Next update in 20
seconds
Mar 27 12:01:39 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published
record 2021-03-27 12:01:39 EDT (1616860899)
Mar 27 12:01:57 raspberrypi weewx[558] DEBUG user.gw1000: Next update in 20
seconds
Mar 27 12:01:57 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published
record 2021-03-27 12:01:57 EDT (1616860917)
Mar 27 12:01:59 raspberrypi weewx[558] DEBUG user.gw1000: Next update in 20
seconds
Mar 27 12:01:59 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published
record 2021-03-27 12:01:59 EDT (1616860919)
Mar 27 12:02:17 raspberrypi weewx[558] DEBUG user.gw1000: Next update in 20
seconds
Mar 27 12:02:17 raspberrypi weewx[558] INFO weewx.restx: MQTT: Published
record 2021-03-27 12:02:17 EDT (1616860937)
Mar 27 12:02:17 raspberrypi weewx[558] INFO weewx.manager: Added record
2021-03-27 12:02:00 EDT (1616860920) to database 'weewx.sdb'
Mar 27 12:02:17 raspberrypi weewx[558] INFO weewx.manager: Added record
2021-03-27 12:02:00 EDT 

Re: [weewx-user] Re: webserver-integration failed

2021-03-27 Thread vince
You have provided no logs, so it is difficult to try to help.   Is weewx 
even running ?Did you do a apt-get installation ?  A setup.py 
installation ?   

I suspect you did an apt-get installation, which does 'not' use 
/home/weewx, but you are not providing enough information by far.

-- 
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/15cf4380-d8cf-471e-a536-9156d72fa52cn%40googlegroups.com.


Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Tom Hackett
This is the mosquitto log since the change
1616862009: New connection from 192.168.1.170 on port 1883.
1616862009: New client connected from 192.168.1.170 as weewx_94c44d84 (c1,
k60, u'tph06784').
1616862009: Client weewx_94c44d84 disconnected.
1616862028: New connection from 192.168.1.170 on port 1883.
1616862028: New client connected from 192.168.1.170 as weewx_61789889 (c1,
k60, u'tph06784').
1616862028: Client weewx_61789889 disconnected.
1616862030: New connection from 192.168.1.170 on port 1883.
1616862030: New client connected from 192.168.1.170 as weewx_28e94234 (c1,
k60, u'tph06784').
1616862030: Client weewx_28e94234 disconnected.
1616862048: New connection from 192.168.1.170 on port 1883.
1616862048: New client connected from 192.168.1.170 as weewx_38f31fdb (c1,
k60, u'tph06784').
1616862048: Client weewx_38f31fdb disconnected.

On Sat, Mar 27, 2021 at 12:42 PM Tom Hackett  wrote:

> I have changed MQTT to
> [[MQTT]]
> server_url = mqtt://tph06784:0350@192.168.1.170:1883
> topic = weather
> unit_system = US
> binding = archive, loop
> aggregation = aggregate
> log_success = true1883
>
> No change
>
> On Sat, Mar 27, 2021 at 11:51 AM vince  wrote:
>
>> > server_url = mqtt://tph06784:@localhost:1883
>>
>> This is becoming a FAQ.
>>
>> Do not use 'localhost'.  Use the fully qualified domain name of the MQTT
>> broker host or its IP address.
>>
>> On Saturday, March 27, 2021 at 8:47:11 AM UTC-7 mh081...@gmail.com wrote:
>>
>>> Hi,
>>>
>>> if you will that mqtt working from ootside of your website you must
>>> config public dns names .
>>>
>>> example from mx site
>>>
>>> weewx.conf
>>>
>>> [[MQTT]]
>>> server_url = mqtt://pi:pass...@gw.martenhinrichs.de:8883/
>>> 
>>> topic = weather
>>> unit_system = METRIC
>>> binding = archive, loop
>>> aggregation = aggregate
>>> log_success = False
>>> log_failure = True
>>> [[[tls]]]
>>> tls_version = tlsv12
>>> ca_certs = /etc/ssl/certs/ca-certificates.crt
>>> [[[inputs]]]
>>> dayRain
>>> name = dayRain_mm
>>> units = mm
>>> rainRate
>>> name = rainRate_mm_per_hour
>>> units = mm_per_hour
>>>
>>> [[Belchertown]]
>>>  [[[Extras]]]
>>>
>>> mqtt_websockets_enabled = 1
>>> mqtt_websockets_host = gw.martenhinrichs.de
>>> mqtt_websockets_port = 9001
>>> mqtt_websockets_ssl = 1
>>> mqtt_websockets_topic = weather/loop
>>>
>>>
>>> Only difference i use ssl and metric
>>>
>>>
>>>
>>> tom0...@gmail.com schrieb am Samstag, 27. März 2021 um 15:33:58 UTC+1:
>>>
 Site only says Connecting to weather station real time data and no
 updates are happening.

 On Sat, Mar 27, 2021 at 10:25 AM Graham Eddy 
 wrote:

> what’s not working?
>
> On 28 Mar 2021, at 12:33 am, Tom Hackett  wrote:
>
> I just can't figure this out.
>
>
> --
> 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/7A79B922-E098-48AE-A46C-3A128A3F9D90%40gmail.com
> 
> .
>


 --
 http://www.shermanctweather.org/wxgraphic.php?type=banner_big*https://www.shermanctweather.org/wxgraphic.php?type=banner_big
 https://www.shermanctweather.org/wxgraphic.php?type=banner_big
 https://www.shermanctweather.org/wxgraphic.php?type=banner_big
 *
 *http://www.shermanctweather.org/wxgraphic.php?type=banner_big*
 

 --
>> 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/ec03055f-9ec1-443c-89a2-b2961f5e0088n%40googlegroups.com
>> 
>> .
>>
>
>
> --
> http://www.shermanctweather.org/wxgraphic.php?type=banner_big*https://www.shermanctweather.org/wxgraphic.php?type=banner_big
> 

Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Tom Hackett
I have changed MQTT to
[[MQTT]]
server_url = mqtt://tph06784:0350@192.168.1.170:1883
topic = weather
unit_system = US
binding = archive, loop
aggregation = aggregate
log_success = true1883

No change

On Sat, Mar 27, 2021 at 11:51 AM vince  wrote:

> > server_url = mqtt://tph06784:@localhost:1883
>
> This is becoming a FAQ.
>
> Do not use 'localhost'.  Use the fully qualified domain name of the MQTT
> broker host or its IP address.
>
> On Saturday, March 27, 2021 at 8:47:11 AM UTC-7 mh081...@gmail.com wrote:
>
>> Hi,
>>
>> if you will that mqtt working from ootside of your website you must
>> config public dns names .
>>
>> example from mx site
>>
>> weewx.conf
>>
>> [[MQTT]]
>> server_url = mqtt://pi:pass...@gw.martenhinrichs.de:8883/
>> 
>> topic = weather
>> unit_system = METRIC
>> binding = archive, loop
>> aggregation = aggregate
>> log_success = False
>> log_failure = True
>> [[[tls]]]
>> tls_version = tlsv12
>> ca_certs = /etc/ssl/certs/ca-certificates.crt
>> [[[inputs]]]
>> dayRain
>> name = dayRain_mm
>> units = mm
>> rainRate
>> name = rainRate_mm_per_hour
>> units = mm_per_hour
>>
>> [[Belchertown]]
>>  [[[Extras]]]
>>
>> mqtt_websockets_enabled = 1
>> mqtt_websockets_host = gw.martenhinrichs.de
>> mqtt_websockets_port = 9001
>> mqtt_websockets_ssl = 1
>> mqtt_websockets_topic = weather/loop
>>
>>
>> Only difference i use ssl and metric
>>
>>
>>
>> tom0...@gmail.com schrieb am Samstag, 27. März 2021 um 15:33:58 UTC+1:
>>
>>> Site only says Connecting to weather station real time data and no
>>> updates are happening.
>>>
>>> On Sat, Mar 27, 2021 at 10:25 AM Graham Eddy  wrote:
>>>
 what’s not working?

 On 28 Mar 2021, at 12:33 am, Tom Hackett  wrote:

 I just can't figure this out.


 --
 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/7A79B922-E098-48AE-A46C-3A128A3F9D90%40gmail.com
 
 .

>>>
>>>
>>> --
>>> http://www.shermanctweather.org/wxgraphic.php?type=banner_big*https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>>> https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>>> https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>>> *
>>> *http://www.shermanctweather.org/wxgraphic.php?type=banner_big*
>>> 
>>>
>>> --
> 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/ec03055f-9ec1-443c-89a2-b2961f5e0088n%40googlegroups.com
> 
> .
>


-- 
http://www.shermanctweather.org/wxgraphic.php?type=banner_big*https://www.shermanctweather.org/wxgraphic.php?type=banner_big
https://www.shermanctweather.org/wxgraphic.php?type=banner_big
https://www.shermanctweather.org/wxgraphic.php?type=banner_big
*
*http://www.shermanctweather.org/wxgraphic.php?type=banner_big*


-- 
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/CAK7_jHe3rKWRZ8ov3zYVxedsxsa7D63WFsuBmj9sdxyeaVd4Rg%40mail.gmail.com.


Re: [weewx-user] Re: Beta of V4.5.0 available

2021-03-27 Thread Tom Keffer
Unfortunately, there doesn't seem to be anything that can be done about
that. At least, without getting rid of the backquotes for the initial table
creation.

*echo "CREATE TABLE archive (`foo` REAL); ALTER TABLE archive RENAME foo to
`baz`;" |sqlite3 test.sdb*


followed by

*echo ".schema" | sqlite3 test.sdb*


yields

CREATE TABLE archive ("baz" REAL);


The good news is that the pragma "table_info()" does the right thing:

*echo "pragma table_info(archive)" | sqlite3 test.sdb*
0|baz|REAL|0||0




On Sat, Mar 27, 2021 at 8:38 AM Paul R Anderson  wrote:

> Hi Tom
> Verified that when adding a column it now gets created with the backquotes.
> The 2nd issue that I mentioned was that when renaming a column it gets
> renamed to a  name enclosed in double quotes.
>
> So when running my example of adding  a column named addedcolumn,  and
> renaming column heatindex to renamedheatindex we get:
> sqlite> .schema archive
> CREATE TABLE archive (`dateTime` INTEGER NOT NULL UNIQUE PRIMARY KEY,
> `usUnits` INTEGER NOT NULL, `interval` INTEGER NOT NULL, `altimeter` REAL,
> `barometer` REAL, `dewpoint` REAL, `ET` REAL, "renamedheatindex" REAL, 
> `addedcolumn`
> REAL);
>
> I tried modifying line 478 manager.py from:
> cursor.execute("ALTER TABLE %s RENAME COLUMN %s TO %s"
> to:
> cursor.execute("ALTER TABLE %s RENAME COLUMN %s TO `%s`"
> But that made no difference, wish I had better python skills!
> Thanks,
> Paul
>
>
>
>
>
> On Sat, Mar 27, 2021 at 9:13 AM Tom Keffer  wrote:
>
>> When the database is created, the column names are put in backquotes.
>> This is because, under MySQL, the name "interval" is a reserved keyword, so
>> it must be "escaped" with backquotes.
>>
>> However, when adding a column, the name is not put in backquotes.
>>
>> I've changed the "add column" code to include the backquotes. Hopefully,
>> the results will be consistent now!
>>
>> commit 2e7f146
>> 
>>
>>
>>
>> On Fri, Mar 26, 2021 at 8:12 AM Paul R Anderson  wrote:
>>
>>> Column naming curiosity
>>>
>>> Tried the add, and rename columns feature of the wee_database utility.
>>> Both seemed to work fine, however I noticed a peculiarity in the column
>>> names that were renamed, or created .
>>> Normally a sqlite3 query of .schema archive shows ALL column names
>>> surrounded by what seems to be the U+0060 GRAVE ACCENT Character.
>>> However a sqlite3 query after --rename-column shows the added column
>>> surrounded by double quotes.
>>> Also a sqlite3 query after --add-column shows a naked column name not
>>> surrounded at all?
>>> Please note that what I perceive as a column naming peculiarity, seems
>>> to have no noticeable effect on the database, it functions normally.
>>> My wild speculation is that there's an inconsistency between handing of
>>> string to unicode in the table create and new add column rename column
>>> function.
>>> Spied this in /weedb/sqlite.py
>>>  # Extract the table name. Sqlite returns unicode, so always
>>>  # convert to a regular string:
>>>
>>> I am sure this is hard to follow, so here is an outline of my test
>>> methodology hopefully it helps,and doesn't make it more confusing!
>>>
>>> Let WeeWx create new database with a few fields using wview_small.py
>>> reduced to these fields:
>>>
>>> table = [('dateTime', 'INTEGER NOT NULL UNIQUE PRIMARY KEY'),
>>>  ('usUnits',  'INTEGER NOT NULL'),
>>>  ('interval', 'INTEGER NOT NULL'),
>>>  ('altimeter','REAL'),
>>>  ('barometer','REAL'),
>>>  ('dewpoint', 'REAL'),
>>>  ('ET',   'REAL'),
>>>  ('heatindex','REAL'),
>>>  ]
>>>
>>> *sqlite3 query of .schema archive after database creation*
>>>
>>> sqlite> .schema archive
>>> CREATE TABLE archive (`dateTime` INTEGER NOT NULL UNIQUE PRIMARY KEY,
>>> `usUnits` INTEGER NOT NULL, `interval` INTEGER NOT NULL, `altimeter` REAL,
>>> `barometer` REAL, `dewpoint` REAL, `ET` REAL, `heatindex` REAL);
>>>
>>> *** Note what seems to be the U+0060 GRAVE ACCENT Character surrounding
>>> the column names.
>>>
>>> Rename heatindex to renamedheatindex
>>> wee_database --rename-column=heatindex --to-name=renamedheatindex
>>> Added addedcolumn
>>> wee_database --add-column=addedcolumn
>>>
>>> sqlite3 query of .schema archive after the Rename and add column
>>> operation
>>>
>>> sqlite> .schema archive
>>> CREATE TABLE archive (`dateTime` INTEGER NOT NULL UNIQUE PRIMARY KEY,
>>> `usUnits` INTEGER NOT NULL, `interval` INTEGER NOT NULL, `altimeter` REAL,
>>> `barometer` REAL, `dewpoint` REAL, `ET` REAL, "renamedheatindex" REAL,
>>> addedcolumn REAL);
>>>
>>> *** Note the name of the renamedheatindex column is surrounded by double
>>> quotes, and the added column addedcolumn isn't surrounded by anything.
>>> Thanks!
>>> Paul
>>>
>>> On Thu, Mar 25, 2021 at 9:12 PM Tom Keffer  wrote:
>>>
 Well, 

AW: [weewx-user] Re: webserver-integration failed

2021-03-27 Thread stephan.schmieg
Dear vince,

 

thank you for your reply. I think you got something wrong. I followed the 
instructions on the weewx webpage. As I can understand it, the installation 
routine should have installed a branch /weewx/ into /var/www/html/ . Then, all 
the generated files should be in /var/www/html/weewx/ . At least the layout 
chart with all the folders tells that.

 

Unfortunately, there is no /var/www/html/weewx/ . Absolutely no files were 
added.

 

Now, I noticed there is also /etc/weewx/apache/conf.d . As I understand this 
file, weewx is redirected to /home/weewx/ - a folder that doesn’t 
exist as there is no user weewx. 

 

Obviously, there should have been created a user weewx – something that didn’t 
happen. By the way, I did the installation  in relation to the debian 
instructions.

 

Thanks!

 

Stephan

 

Von: weewx-user@googlegroups.com  Im Auftrag von 
vince
Gesendet: Samstag, 27. März 2021 16:56
An: weewx-user 
Betreff: [weewx-user] Re: webserver-integration failed

 

On Saturday, March 27, 2021 at 8:51:43 AM UTC-7 stephan...@gmail.com 
  wrote:

Any suggestions why the http-integration failed?

 

 

Your apache configuration expects the html files in one directory.

Your weewx configuration puts them in a different place.

The result is that your webserver cannot find the files weewx generated.

 

See if https://www.weewx.com/docs/usersguide.htm#integrating_with_webserver 
helps any. 

-- 
You received this message because you are subscribed to a topic in the Google 
Groups "weewx-user" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/weewx-user/YEsvrbKKlVA/unsubscribe.
To unsubscribe from this group and all its topics, 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/2f4b3dbc-bfb8-49f3-b916-f0e0bc1087f9n%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/001a01d72324%24975e8d70%24c61ba850%24%40gmail.com.


[weewx-user] Re: webserver-integration failed

2021-03-27 Thread vince
On Saturday, March 27, 2021 at 8:51:43 AM UTC-7 stephan...@gmail.com wrote:

> Any suggestions why the http-integration failed?
>
>
Your apache configuration expects the html files in one directory.
Your weewx configuration puts them in a different place.
The result is that your webserver cannot find the files weewx generated.

See if https://www.weewx.com/docs/usersguide.htm#integrating_with_webserver 
helps any. 

-- 
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/2f4b3dbc-bfb8-49f3-b916-f0e0bc1087f9n%40googlegroups.com.


Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread vince
> server_url = mqtt://tph06784:@localhost:1883

This is becoming a FAQ.

Do not use 'localhost'.  Use the fully qualified domain name of the MQTT 
broker host or its IP address.

On Saturday, March 27, 2021 at 8:47:11 AM UTC-7 mh081...@gmail.com wrote:

> Hi,
>
> if you will that mqtt working from ootside of your website you must config 
> public dns names . 
>
> example from mx site
>
> weewx.conf
>
> [[MQTT]]
> server_url = mqtt://pi:pass...@gw.martenhinrichs.de:8883/ 
> 
> topic = weather
> unit_system = METRIC
> binding = archive, loop
> aggregation = aggregate
> log_success = False
> log_failure = True
> [[[tls]]]
> tls_version = tlsv12
> ca_certs = /etc/ssl/certs/ca-certificates.crt
> [[[inputs]]]
> dayRain
> name = dayRain_mm
> units = mm
> rainRate
> name = rainRate_mm_per_hour
> units = mm_per_hour
>
> [[Belchertown]]
>  [[[Extras]]]
>
> mqtt_websockets_enabled = 1
> mqtt_websockets_host = gw.martenhinrichs.de
> mqtt_websockets_port = 9001
> mqtt_websockets_ssl = 1
> mqtt_websockets_topic = weather/loop
>
>
> Only difference i use ssl and metric
>
>
>
> tom0...@gmail.com schrieb am Samstag, 27. März 2021 um 15:33:58 UTC+1:
>
>> Site only says Connecting to weather station real time data and no 
>> updates are happening.
>>
>> On Sat, Mar 27, 2021 at 10:25 AM Graham Eddy  wrote:
>>
>>> what’s not working?
>>>
>>> On 28 Mar 2021, at 12:33 am, Tom Hackett  wrote:
>>>
>>> I just can't figure this out.
>>>
>>>
>>> -- 
>>> 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/7A79B922-E098-48AE-A46C-3A128A3F9D90%40gmail.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> http://www.shermanctweather.org/wxgraphic.php?type=banner_big*https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>>  
>> https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>>  
>> https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>>  
>> *
>> *http://www.shermanctweather.org/wxgraphic.php?type=banner_big* 
>> 
>>
>>

-- 
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/ec03055f-9ec1-443c-89a2-b2961f5e0088n%40googlegroups.com.


[weewx-user] webserver-integration failed

2021-03-27 Thread Stephan Schmieg
Hi weewx folks, 

I just gave it a try to install weewx on a raspberry pi 3. Before 
installing weewx, I installed the apache webserver.

Now, after installing weewx, I expected to get at least some kind of output 
entering the url

http:///weewx/index.html .

Unfortunately, there was nothing of that kind. I looked up /var/www/html/ 
and found that there is nothing in this directory besides the standard 
index.html coming from apache2. The entire weewx-branch is missing.

Any suggestions why the http-integration failed?

Thanks a lot for your help!

Stephan

-- 
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/fb305c45-472b-4b20-8ced-d2700cdf872an%40googlegroups.com.


Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread mh081...@gmail.com
And of course allow ports on your firewall/router etc.

mh081...@gmail.com schrieb am Samstag, 27. März 2021 um 16:47:11 UTC+1:

> Hi,
>
> if you will that mqtt working from ootside of your website you must config 
> public dns names . 
>
> example from mx site
>
> weewx.conf
>
> [[MQTT]]
> server_url = mqtt://pi:pass...@gw.martenhinrichs.de:8883/ 
> 
> topic = weather
> unit_system = METRIC
> binding = archive, loop
> aggregation = aggregate
> log_success = False
> log_failure = True
> [[[tls]]]
> tls_version = tlsv12
> ca_certs = /etc/ssl/certs/ca-certificates.crt
> [[[inputs]]]
> dayRain
> name = dayRain_mm
> units = mm
> rainRate
> name = rainRate_mm_per_hour
> units = mm_per_hour
>
> [[Belchertown]]
>  [[[Extras]]]
>
> mqtt_websockets_enabled = 1
> mqtt_websockets_host = gw.martenhinrichs.de
> mqtt_websockets_port = 9001
> mqtt_websockets_ssl = 1
> mqtt_websockets_topic = weather/loop
>
>
> Only difference i use ssl and metric
>
>
>
> tom0...@gmail.com schrieb am Samstag, 27. März 2021 um 15:33:58 UTC+1:
>
>> Site only says Connecting to weather station real time data and no 
>> updates are happening.
>>
>> On Sat, Mar 27, 2021 at 10:25 AM Graham Eddy  wrote:
>>
>>> what’s not working?
>>>
>>> On 28 Mar 2021, at 12:33 am, Tom Hackett  wrote:
>>>
>>> I just can't figure this out.
>>>
>>>
>>> -- 
>>> 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/7A79B922-E098-48AE-A46C-3A128A3F9D90%40gmail.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> http://www.shermanctweather.org/wxgraphic.php?type=banner_big*https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>>  
>> https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>>  
>> https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>>  
>> *
>> *http://www.shermanctweather.org/wxgraphic.php?type=banner_big* 
>> 
>>
>>

-- 
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/b0887a44-27d1-479f-a320-bba8842eda82n%40googlegroups.com.


Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread mh081...@gmail.com
Hi,

if you will that mqtt working from ootside of your website you must config 
public dns names . 

example from mx site

weewx.conf

[[MQTT]]
server_url = mqtt://pi:passw...@gw.martenhinrichs.de:8883/
topic = weather
unit_system = METRIC
binding = archive, loop
aggregation = aggregate
log_success = False
log_failure = True
[[[tls]]]
tls_version = tlsv12
ca_certs = /etc/ssl/certs/ca-certificates.crt
[[[inputs]]]
dayRain
name = dayRain_mm
units = mm
rainRate
name = rainRate_mm_per_hour
units = mm_per_hour

[[Belchertown]]
 [[[Extras]]]

mqtt_websockets_enabled = 1
mqtt_websockets_host = gw.martenhinrichs.de
mqtt_websockets_port = 9001
mqtt_websockets_ssl = 1
mqtt_websockets_topic = weather/loop


Only difference i use ssl and metric



tom0...@gmail.com schrieb am Samstag, 27. März 2021 um 15:33:58 UTC+1:

> Site only says Connecting to weather station real time data and no updates 
> are happening.
>
> On Sat, Mar 27, 2021 at 10:25 AM Graham Eddy  wrote:
>
>> what’s not working?
>>
>> On 28 Mar 2021, at 12:33 am, Tom Hackett  wrote:
>>
>> I just can't figure this out.
>>
>>
>> -- 
>> 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/7A79B922-E098-48AE-A46C-3A128A3F9D90%40gmail.com
>>  
>> 
>> .
>>
>
>
> -- 
> http://www.shermanctweather.org/wxgraphic.php?type=banner_big*https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>  
> https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>  
> https://www.shermanctweather.org/wxgraphic.php?type=banner_big
>  
> *
> *http://www.shermanctweather.org/wxgraphic.php?type=banner_big* 
> 
>
>

-- 
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/33846884-3597-45f7-9098-23375c5f9fdbn%40googlegroups.com.


Re: [weewx-user] Re: Beta of V4.5.0 available

2021-03-27 Thread Paul R Anderson
Hi Tom
Verified that when adding a column it now gets created with the backquotes.
The 2nd issue that I mentioned was that when renaming a column it gets
renamed to a  name enclosed in double quotes.

So when running my example of adding  a column named addedcolumn,  and
renaming column heatindex to renamedheatindex we get:
sqlite> .schema archive
CREATE TABLE archive (`dateTime` INTEGER NOT NULL UNIQUE PRIMARY KEY,
`usUnits` INTEGER NOT NULL, `interval` INTEGER NOT NULL, `altimeter` REAL,
`barometer` REAL, `dewpoint` REAL, `ET` REAL, "renamedheatindex" REAL,
`addedcolumn`
REAL);

I tried modifying line 478 manager.py from:
cursor.execute("ALTER TABLE %s RENAME COLUMN %s TO %s"
to:
cursor.execute("ALTER TABLE %s RENAME COLUMN %s TO `%s`"
But that made no difference, wish I had better python skills!
Thanks,
Paul





On Sat, Mar 27, 2021 at 9:13 AM Tom Keffer  wrote:

> When the database is created, the column names are put in backquotes. This
> is because, under MySQL, the name "interval" is a reserved keyword, so it
> must be "escaped" with backquotes.
>
> However, when adding a column, the name is not put in backquotes.
>
> I've changed the "add column" code to include the backquotes. Hopefully,
> the results will be consistent now!
>
> commit 2e7f146
> 
>
>
>
> On Fri, Mar 26, 2021 at 8:12 AM Paul R Anderson  wrote:
>
>> Column naming curiosity
>>
>> Tried the add, and rename columns feature of the wee_database utility.
>> Both seemed to work fine, however I noticed a peculiarity in the column
>> names that were renamed, or created .
>> Normally a sqlite3 query of .schema archive shows ALL column names
>> surrounded by what seems to be the U+0060 GRAVE ACCENT Character.
>> However a sqlite3 query after --rename-column shows the added column
>> surrounded by double quotes.
>> Also a sqlite3 query after --add-column shows a naked column name not
>> surrounded at all?
>> Please note that what I perceive as a column naming peculiarity, seems to
>> have no noticeable effect on the database, it functions normally.
>> My wild speculation is that there's an inconsistency between handing of
>> string to unicode in the table create and new add column rename column
>> function.
>> Spied this in /weedb/sqlite.py
>>  # Extract the table name. Sqlite returns unicode, so always
>>  # convert to a regular string:
>>
>> I am sure this is hard to follow, so here is an outline of my test
>> methodology hopefully it helps,and doesn't make it more confusing!
>>
>> Let WeeWx create new database with a few fields using wview_small.py
>> reduced to these fields:
>>
>> table = [('dateTime', 'INTEGER NOT NULL UNIQUE PRIMARY KEY'),
>>  ('usUnits',  'INTEGER NOT NULL'),
>>  ('interval', 'INTEGER NOT NULL'),
>>  ('altimeter','REAL'),
>>  ('barometer','REAL'),
>>  ('dewpoint', 'REAL'),
>>  ('ET',   'REAL'),
>>  ('heatindex','REAL'),
>>  ]
>>
>> *sqlite3 query of .schema archive after database creation*
>>
>> sqlite> .schema archive
>> CREATE TABLE archive (`dateTime` INTEGER NOT NULL UNIQUE PRIMARY KEY,
>> `usUnits` INTEGER NOT NULL, `interval` INTEGER NOT NULL, `altimeter` REAL,
>> `barometer` REAL, `dewpoint` REAL, `ET` REAL, `heatindex` REAL);
>>
>> *** Note what seems to be the U+0060 GRAVE ACCENT Character surrounding
>> the column names.
>>
>> Rename heatindex to renamedheatindex
>> wee_database --rename-column=heatindex --to-name=renamedheatindex
>> Added addedcolumn
>> wee_database --add-column=addedcolumn
>>
>> sqlite3 query of .schema archive after the Rename and add column operation
>>
>> sqlite> .schema archive
>> CREATE TABLE archive (`dateTime` INTEGER NOT NULL UNIQUE PRIMARY KEY,
>> `usUnits` INTEGER NOT NULL, `interval` INTEGER NOT NULL, `altimeter` REAL,
>> `barometer` REAL, `dewpoint` REAL, `ET` REAL, "renamedheatindex" REAL,
>> addedcolumn REAL);
>>
>> *** Note the name of the renamedheatindex column is surrounded by double
>> quotes, and the added column addedcolumn isn't surrounded by anything.
>> Thanks!
>> Paul
>>
>> On Thu, Mar 25, 2021 at 9:12 PM Tom Keffer  wrote:
>>
>>> Well, MySQL calls it "DROP COLUMN." SQLite doesn't offer it at all.
>>>
>>> Rather than invent new terminology, I'd like to stick with what's
>>> already in use.
>>>
>>> On Thu, Mar 25, 2021 at 1:26 PM vince  wrote:
>>>
 oops - I meant 'drop-field' and 'rebuild-field' there of course in the
 last paragraph...intent was to handle the case where somebody doesn't want
 to drop all summary tables, just the one matching the field they cleaned up
 in the archive table.

 On Thursday, March 25, 2021 at 12:17:15 PM UTC-7 vince wrote:

> I know 'drop' is a database term, but I'm wondering if --delete-column
> might be better wording here generically.
>
> We have 

Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Tom Hackett
Site only says Connecting to weather station real time data and no updates
are happening.

On Sat, Mar 27, 2021 at 10:25 AM Graham Eddy  wrote:

> what’s not working?
>
> On 28 Mar 2021, at 12:33 am, Tom Hackett  wrote:
>
> I just can't figure this out.
>
>
> --
> 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/7A79B922-E098-48AE-A46C-3A128A3F9D90%40gmail.com
> 
> .
>


-- 
http://www.shermanctweather.org/wxgraphic.php?type=banner_big*https://www.shermanctweather.org/wxgraphic.php?type=banner_big
https://www.shermanctweather.org/wxgraphic.php?type=banner_big
https://www.shermanctweather.org/wxgraphic.php?type=banner_big
*
*http://www.shermanctweather.org/wxgraphic.php?type=banner_big*


-- 
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/CAK7_jHdC8hYtQbd-KA2Qd3sCxH_%3DCzZLs9JjWnwp9%2B48hisajA%40mail.gmail.com.


Re: [weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Graham Eddy
what’s not working?

> On 28 Mar 2021, at 12:33 am, Tom Hackett  wrote:
> 
> I just can't figure this out.

-- 
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/7A79B922-E098-48AE-A46C-3A128A3F9D90%40gmail.com.


[weewx-user] MQTT for Belchertown skin

2021-03-27 Thread Tom Hackett
I'm new to weewx and raspberry pi.
I installed the Belchertown skin on a Raspberry Pi4.
Iy is running at www.shermanctweather.org/weewx
I'm trying to setup a MQTT server on the raspberry pi.
I installed MQTT:
"pi@raspberrypi:~ $ sudo wget -O weewx-mqtt.zip 
https://github.com/matthewwall/weewx-mqtt/archive/master.zip
--2021-03-27 08:25:48--  
https://github.com/matthewwall/weewx-mqtt/archive/master.zip
Resolving github.com (github.com)... 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/matthewwall/weewx-mqtt/zip/master 
[following]
--2021-03-27 08:25:48--  
https://codeload.github.com/matthewwall/weewx-mqtt/zip/master
Resolving codeload.github.com (codeload.github.com)... 140.82.114.10
Connecting to codeload.github.com 
(codeload.github.com)|140.82.114.10|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/zip]
Saving to: ‘weewx-mqtt.zip’

weewx-mqtt.zip  [ <=>]   8.43K  --.-KB/sin 
0.002s  

2021-03-27 08:25:49 (4.81 MB/s) - ‘weewx-mqtt.zip’ saved [8632]

pi@raspberrypi:~ $ sudo wee_extension --install weewx-mqtt.zip
Request to install 'weewx-mqtt.zip'
Extracting from zip archive weewx-mqtt.zip
Saving installer file to /usr/share/weewx/user/installer/mqtt
Saved configuration dictionary. Backup copy at 
/etc/weewx/weewx.conf.20210327082627
Finished installing extension 'weewx-mqtt.zip'"
My wwewx.conf file is:
under [StdRESTful]
[[MQTT]]
server_url = mqtt://tph06784:@localhost:1883
topic = weather
unit_system = US
binding = archive, loop
aggregation = aggregate
log_success = true

under [Extras] in skin.conf
 # MQTT Websockets defaults
mqtt_websockets_enabled = 1
mqtt_websockets_host = "192.168.1.170"
mqtt_websockets_port = 9001
mqtt_websockets_ssl = 0
mqtt_websockets_topic = "weather/loop"
disconnect_live_website_visitor = 30
and under [Engine]
restful_services = weewx.restx.StdStationRegistry, 
weewx.restx.StdWunderground, weewx.restx.StdPWSweather, 
weewx.restx.StdCWOP, weewx.restx.StdWOW, weewx.restx.StdAWEKAS, 
user.mqtt.MQTT

Part of my syslog that seems to be revelant
Mar 27 09:26:23 raspberrypi weewx[13200] INFO user.mqtt: service version is 
0.23
Mar 27 09:26:23 raspberrypi weewx[13200] INFO user.mqtt: binding to 
['archive', 'loop']
Mar 27 09:26:23 raspberrypi weewx[13200] INFO user.mqtt: topic is weather
Mar 27 09:26:23 raspberrypi weewx[13200] INFO user.mqtt: desired unit 
system is US
Mar 27 09:26:23 raspberrypi weewx[13200] INFO user.mqtt: data will be 
uploaded to mqtt://tph06784:xxx@localhost:1883
Mar 27 09:26:23 raspberrypi weewx[13200] DEBUG weewx.engine: Finished 
loading service user.mqtt.MQTT
Mar 27 09:26:23 raspberrypi weewx[13200] DEBUG weewx.engine: Loading 
service weewx.engine.StdPrint
Mar 27 09:26:23 raspberrypi weewx[13200] DEBUG weewx.engine: Finished 
loading service weewx.engine.StdPrint
Mar 27 09:26:23 raspberrypi weewx[13200] DEBUG weewx.engine: Loading 
service weewx.engine.StdReport
Mar 27 09:26:23 raspberrypi weewx[13200] DEBUG weewx.engine: Finished 
loading service weewx.engine.StdReport
Mar 27 09:26:23 raspberrypi weewx[13200] INFO __main__: Starting up weewx 
version 4.4.0
Mar 27 09:26:23 raspberrypi weewx[13200] DEBUG weewx.engine: Station does 
not support reading the time
Mar 27 09:26:23 raspberrypi weewx[13200] INFO weewx.engine: Using binding 
'wx_binding' to database 'weewx.sdb'
Mar 27 09:26:23 raspberrypi weewx[13200] INFO weewx.manager: Starting 
backfill of daily summaries
Mar 27 09:26:23 raspberrypi weewx[13200] INFO weewx.manager: Daily 
summaries up to date
Mar 27 09:26:23 raspberrypi weewx[13200] INFO weewx.engine: Starting main 
packet loop.
Mar 27 09:26:23 raspberrypi weewx[13200] INFO user.gw1000: Using 'rainyear' 
for rain total
Mar 27 09:26:23 raspberrypi weewx[13200] INFO user.gw1000: skipping rain 
measurement of 170.6: no last rain
Mar 27 09:26:23 raspberrypi weewx[13200] INFO user.gw1000: Using 'rainyear' 
for rain total
Mar 27 09:26:23 raspberrypi weewx[13200] INFO user.gw1000: skipping rain 
measurement of 170.6: no last rain
Mar 27 09:26:23 raspberrypi weewx[13200] INFO weewx.wxxtypes: Type beaufort 
has been deprecated. Use unit beaufort instead.
Mar 27 09:26:23 raspberrypi weewx[13200] DEBUG weewx.manager: Daily summary 
version is 4.0
Mar 27 09:26:23 raspberrypi weewx[13200] INFO weewx.restx: MQTT: Published 
record 2021-03-27 09:26:21 EDT (1616851581)
Mar 27 09:26:41 raspberrypi weewx[13200] DEBUG user.gw1000: Next update in 
20 seconds
Mar 27 09:26:41 raspberrypi weewx[13200] INFO weewx.restx: MQTT: Published 
record 2021-03-27 09:26:41 EDT (1616851601)

I just can't figure this out.
Any help would be appreciated.
Thanks, Tom



-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop 

Re: [weewx-user] Re: Beta of V4.5.0 available

2021-03-27 Thread Tom Keffer
When the database is created, the column names are put in backquotes. This
is because, under MySQL, the name "interval" is a reserved keyword, so it
must be "escaped" with backquotes.

However, when adding a column, the name is not put in backquotes.

I've changed the "add column" code to include the backquotes. Hopefully,
the results will be consistent now!

commit 2e7f146




On Fri, Mar 26, 2021 at 8:12 AM Paul R Anderson  wrote:

> Column naming curiosity
>
> Tried the add, and rename columns feature of the wee_database utility.
> Both seemed to work fine, however I noticed a peculiarity in the column
> names that were renamed, or created .
> Normally a sqlite3 query of .schema archive shows ALL column names
> surrounded by what seems to be the U+0060 GRAVE ACCENT Character.
> However a sqlite3 query after --rename-column shows the added column
> surrounded by double quotes.
> Also a sqlite3 query after --add-column shows a naked column name not
> surrounded at all?
> Please note that what I perceive as a column naming peculiarity, seems to
> have no noticeable effect on the database, it functions normally.
> My wild speculation is that there's an inconsistency between handing of
> string to unicode in the table create and new add column rename column
> function.
> Spied this in /weedb/sqlite.py
>  # Extract the table name. Sqlite returns unicode, so always
>  # convert to a regular string:
>
> I am sure this is hard to follow, so here is an outline of my test
> methodology hopefully it helps,and doesn't make it more confusing!
>
> Let WeeWx create new database with a few fields using wview_small.py
> reduced to these fields:
>
> table = [('dateTime', 'INTEGER NOT NULL UNIQUE PRIMARY KEY'),
>  ('usUnits',  'INTEGER NOT NULL'),
>  ('interval', 'INTEGER NOT NULL'),
>  ('altimeter','REAL'),
>  ('barometer','REAL'),
>  ('dewpoint', 'REAL'),
>  ('ET',   'REAL'),
>  ('heatindex','REAL'),
>  ]
>
> *sqlite3 query of .schema archive after database creation*
>
> sqlite> .schema archive
> CREATE TABLE archive (`dateTime` INTEGER NOT NULL UNIQUE PRIMARY KEY,
> `usUnits` INTEGER NOT NULL, `interval` INTEGER NOT NULL, `altimeter` REAL,
> `barometer` REAL, `dewpoint` REAL, `ET` REAL, `heatindex` REAL);
>
> *** Note what seems to be the U+0060 GRAVE ACCENT Character surrounding
> the column names.
>
> Rename heatindex to renamedheatindex
> wee_database --rename-column=heatindex --to-name=renamedheatindex
> Added addedcolumn
> wee_database --add-column=addedcolumn
>
> sqlite3 query of .schema archive after the Rename and add column operation
>
> sqlite> .schema archive
> CREATE TABLE archive (`dateTime` INTEGER NOT NULL UNIQUE PRIMARY KEY,
> `usUnits` INTEGER NOT NULL, `interval` INTEGER NOT NULL, `altimeter` REAL,
> `barometer` REAL, `dewpoint` REAL, `ET` REAL, "renamedheatindex" REAL,
> addedcolumn REAL);
>
> *** Note the name of the renamedheatindex column is surrounded by double
> quotes, and the added column addedcolumn isn't surrounded by anything.
> Thanks!
> Paul
>
> On Thu, Mar 25, 2021 at 9:12 PM Tom Keffer  wrote:
>
>> Well, MySQL calls it "DROP COLUMN." SQLite doesn't offer it at all.
>>
>> Rather than invent new terminology, I'd like to stick with what's already
>> in use.
>>
>> On Thu, Mar 25, 2021 at 1:26 PM vince  wrote:
>>
>>> oops - I meant 'drop-field' and 'rebuild-field' there of course in the
>>> last paragraph...intent was to handle the case where somebody doesn't want
>>> to drop all summary tables, just the one matching the field they cleaned up
>>> in the archive table.
>>>
>>> On Thursday, March 25, 2021 at 12:17:15 PM UTC-7 vince wrote:
>>>
 I know 'drop' is a database term, but I'm wondering if --delete-column
 might be better wording here generically.

 We have drop-daily and rebuild-daily for dealing with summary tables,
 so I'm thinking maybe the terminology meaning different things in different
 context might be confusing.  Just a thought.

 Similarly, we have lots of cases where folks get bad data in their
 archive for rain/whatever and need to clean those items up.  Is there a
 "drop-field" or "rename-field" or the like to help people drop/rebuild just
 the summary tables for a particular database element ?   Apologies if that
 already exists...


 On Wednesday, March 24, 2021 at 2:10:23 PM UTC-7 Tom Keffer wrote:

> Several interesting new features. Most notably, you can add, remove,
> or rename columns in the main database with the utility wee_database. No
> need to use --reconfigure with all the database shuffling involved!
> For example, to remove the type soilMoist2:
>
> wee_database --drop-columns=soilMoist2
>
>
> If you use this feature,