This is because your MQTT is isolated to localhost only. Local host in this 
case would be your weewx server, which you must have installed MQTT on as 
well. Which works for weewx ==> MQTT since they are on the same system, but 
nothing else

First, change your MQTT to listen on 1883 for external connections. Since 
you're not using SSL, you can remove the 8883, update your myconfig.conf 
with this. 

listener 1883
protocol mqtt

With this change it'll open port 1883 to external connections like your 
laptop. 

You can leave your weewx.conf [[MQTT]] config alone since they are on the 
same machine, localhost will work here like it already is. 

I don't see your skin options so I think you haven't done that. You're 
posting to MQTT with [[MQTT]], but now you need to retrieve - that's what 
the skin does. 

In weewx.conf you need to specify the Belchertown skin options for MQTT 
such as enabling it, hostname, topic, etc. 
<https://github.com/poblabs/weewx-belchertown#mqtt-for-real-time-streaming-options>
 You 
cannot use localhost here for mqtt_host, you need to specify the IP of the 
server hosting your MQTT. By saying 127.0.0.1 or localhost that means 
Chrome is going to try to connect to YOUR PC for MQTT data which probably 
doesn't exist. You need to specify the IP of the MQTT broker, like 
192.168.1.100 or whatever. This is where having a static IP or a DHCP 
reservation is important so the IP of your internal broker doesn't change.


On Thursday, December 27, 2018 at 2:38:06 AM UTC-5, Scott Grayban wrote:
>
> Pat
>
> I seem to have missed something in setting up MQTT for the skin... I 
> followed https://obrienlabs.net/how-to-setup-your-own-mqtt-broker/ except 
> the SLL stuff since I wouldn't need it.
>
> weewx.conf
>
>
>     [[MQTT]]
>         server_url = mqtt://weewx:xxxxxx@127.0.0.1:1883/
>         topic = weather/#
>         unit_system = US
>         binding = archive, loop
>         aggregation = aggregate
>
> and
>
> # cat /etc/mosquitto/conf.d/myconfig.conf
> persistence false
>  
> allow_anonymous true
> password_file /etc/mosquitto/passwd
>  
> acl_file /etc/mosquitto/acl
>
>
> listener 1883 localhost
> listener 8883
> protocol mqtt
>  
> # websockets
> listener 9001
> protocol websockets
>
> # cat /etc/mosquitto/acl
> # Allow anonymous access to the sys
> topic read $SYS/#
>  
> # Allow anonymous to read weather
> topic read weather/#
>  
> # weewx readwrite to the loop
> user weewx
> topic weather/#
>
> This test line works
>
> mosquitto_pub -h localhost -t "weather/test" -m "hello world. this is to 
> the weather topic with authentication" -u weewx -P xxxxxx
>
> But index page is showing *Connecting to weather station real time data.*
>
> MQTT is posting.....
>
> Dec 26 23:19:39 raspberrypi weewx[6544]: restx: MQTT: Published record 
> 2018-12-26 23:19:39 PST (1545895179)
> Dec 26 23:19:45 raspberrypi weewx[6544]: restx: MQTT: Published record 
> 2018-12-26 23:19:45 PST (1545895185)
>
> So I don't know what I did worng. I restraced all steps and I did it 
> correctly.
>
> On Friday, December 7, 2018 at 2:12:23 PM UTC-8, Pat wrote:
>>
>> The last thread was getting a bit long. So I've started a new one. 
>>
>> Belchertown Skin 0.8.1 has been released which fixes a couple of bugs. 
>> See the release notes, and install instructions here:
>>
>> https://github.com/poblabs/weewx-belchertown/releases
>>
>>
>>

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

Reply via email to