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 
<http://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 <tom06...@gmail.com> 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 <tph06784>
> 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 <l...@2pi.org 
> <mailto:l...@2pi.org>> 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 <tom06...@gmail.com 
>> <mailto:tom06...@gmail.com>> 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 <l...@2pi.org 
>> <mailto:l...@2pi.org>> 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 <tom06...@gmail.com 
>>> <mailto:tom06...@gmail.com>> 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 <tom06...@gmail.com 
>>> <mailto:tom06...@gmail.com>> wrote:
>>> I have changed MQTT to
>>> [[MQTT]]
>>>         server_url = mqtt://tph06784:0350@192.168.1.170:1883 
>>> <http://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 <vinceska...@gmail.com 
>>> <mailto:vinceska...@gmail.com>> wrote:
>>> > server_url = mqtt://tph06784:xxxx@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 
>>> <mailto: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/ 
>>> <http://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 
>>> <http://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 <graha...@gmail.com <>> wrote:
>>> what’s not working?
>>> 
>>>> On 28 Mar 2021, at 12:33 am, Tom Hackett <tom0...@gmail.com <>> 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
>>>  
>>> <https://groups.google.com/d/msgid/weewx-user/7A79B922-E098-48AE-A46C-3A128A3F9D90%40gmail.com?utm_medium=email&utm_source=footer>.
>>> 
>>> 
>>> -- 
>>> http://www.shermanctweather.org/wxgraphic.php?type=banner_big 
>>> <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
>>>  
>>> <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
>>>  <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 
>>> <mailto: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
>>>  
>>> <https://groups.google.com/d/msgid/weewx-user/ec03055f-9ec1-443c-89a2-b2961f5e0088n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>>> 
>>> 
>>> -- 
>>> http://www.shermanctweather.org/wxgraphic.php?type=banner_big 
>>> <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
>>>  
>>> <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
>>>  <http://www.shermanctweather.org/wxgraphic.php?type=banner_big>
>>> 
>>> 
>>> 
>>> -- 
>>> http://www.shermanctweather.org/wxgraphic.php?type=banner_big 
>>> <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
>>>  
>>> <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
>>>  <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 
>>> <mailto:weewx-user+unsubscr...@googlegroups.com>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/CAK7_jHcr_m2Je09DxRiSH4GuiZyDhP4ac9ic7MpW54ubdNb4Qw%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/weewx-user/CAK7_jHcr_m2Je09DxRiSH4GuiZyDhP4ac9ic7MpW54ubdNb4Qw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>> 
>> 
>> -- 
>> 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 
>> <mailto:weewx-user+unsubscr...@googlegroups.com>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/9E5443B7-7618-42E4-9E58-91BB415B73BB%402pi.org
>>  
>> <https://groups.google.com/d/msgid/weewx-user/9E5443B7-7618-42E4-9E58-91BB415B73BB%402pi.org?utm_medium=email&utm_source=footer>.
>> 
>> 
>> -- 
>> http://www.shermanctweather.org/wxgraphic.php?type=banner_big 
>> <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
>>  
>> <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
>>  <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 
>> <mailto:weewx-user+unsubscr...@googlegroups.com>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/CAK7_jHd5RY28x4P9BZPsfqSjeqAsGf6Nf%3DJE0bDdGyjBw2cymg%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/CAK7_jHd5RY28x4P9BZPsfqSjeqAsGf6Nf%3DJE0bDdGyjBw2cymg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> 
> 
> -- 
> 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 
> <mailto:weewx-user+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/3E6BCDDD-1785-4C97-A3FD-567600D1F954%402pi.org
>  
> <https://groups.google.com/d/msgid/weewx-user/3E6BCDDD-1785-4C97-A3FD-567600D1F954%402pi.org?utm_medium=email&utm_source=footer>.
> 
> 
> -- 
> http://www.shermanctweather.org/wxgraphic.php?type=banner_big 
> <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
>  
> <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
>  <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 
> <mailto:weewx-user+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/CAK7_jHfLWWUobW9rTp%3DZy0ryEsV09jL8tNp5mTxH%3DzttCU47Mw%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/weewx-user/CAK7_jHfLWWUobW9rTp%3DZy0ryEsV09jL8tNp5mTxH%3DzttCU47Mw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
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/7196B38C-A621-4525-A324-FD803D966E8D%402pi.org.

Reply via email to