Try setting websockets topic to frogs/loop.

Regards,

Garry Lockyer
C: +1.250.689.0686
H: +1.250.495.5343
E: Garry.Lockyer.ca

>> On Jun 15, 2020, at 09:39, Ken Walker <[email protected]> wrote:
> OK, now I get it.  Thanks Garry and Pat.
> 
> Almost there.
> 
> I have added the MQTT extension and can verify that data is being published 
> to my mqtt broker by using the command line to subscribe to the topic.
> 
> The web page now says “Connected. Waiting for data….” , but does appear to 
> update.  I have the following in the skin.conf:
> # MQTT Websockets defaults
>     mqtt_websockets_enabled = 1
>     mqtt_websockets_host = "10.0.1.32"
>     mqtt_websockets_port = 9001
>     mqtt_websockets_ssl = 0
>     mqtt_websockets_topic = "frogs"
>     disconnect_live_website_visitor = 1800000
> 
> mqtt_websocets_topic is same as the [[MQTT]] topic in weewx.conf.  BTW, I’m 
> just using the “frogs” topic as a test
> 
> Here is a sample message  being posted to “frogs”:
> {"usUnits": "1.0", "dateTime": "1592238928.0", "rainRate_inch_per_hour": 
> "0.0", "hourRain_in": "0.0", "rain24_in": "0.0", "dayRain_in": "0.0", 
> "extraTemp1_F": "89.4", "barometer_inHg": "29.9"}
> 
> This must be being posted to a subtopic.  I can only see these messages with:
>    mosquitto_sub -h 10.0.1.32 -t frogs/#
> 
> 
>> On Jun 15, 2020, at 9:47 AM, Pat <[email protected]> wrote:
>> 
>> Belchertown expects the weather data to be in the same format as the weewx 
>> mqtt extension. If you're not publishing from the weewx mqtt extension, then 
>> you'll need to have your publisher emulate that extension's output. (rough 
>> example below, not all observations need to be in the same packet)
>> 
>> Your mqtt broker needs to have websockets enabled as well. Then you'll set 
>> your skin to connect to the websocket port to get the data. 
>> 
>> MQTT: {"dateTime": "1592228732.0", "usUnits": "1.0", "outTemp_F": 
>> "65.9","rain_in": "0.0", "rainRate_inch_per_hour": "0.0", 
>> "barometer_inHg":"30.514", "radiation_Wpm2": "691.0", "inTemp_F": "75.5", 
>> "inHumidity":"36.0", "outHumidity": "53.0", "windSpeed_mph": "5.0", 
>> "windGust_mph":"5.0", "UV": "4.1", "forecastRule": "9.0", "txBatteryStatus": 
>> "0.0","consBatteryVoltage_volt": "4.71", "windDir": "11.0", "windGustDir": 
>> "11.0","pressure_inHg": "30.05007732814778", 
>> "altimeter_inHg":"30.522342546117084", "windchill_F": "65.9", "heatindex_F": 
>> "65.9","dewpoint_F": "48.27895673606349", "inDewpoint_F": 
>> "46.66006121573143","appTemp_F": "62.71298653227457", "maxSolarRad_Wpm2": 
>> "725.56944104572","cloudbase_foot": "4434.782559985571", "humidex_F": 
>> "67.42878362134785","hourRain_in": "0.0", "rain24_in": "0.0", "dayRain_in": 
>> "0.0","windSpeed10_mph": "2.0", "stormRain_in": "0.0", "monthRain_in": 
>> "1.07","yearRain_in": "14.82", "dayET": "0.023", "monthET": "2.04", 
>> "yearET":"14.19", "leafWet4": "0.0", "insideAlarm": "0.0", "rainAlarm": 
>> "0.0","outsideAlarm1": "0.0", "outsideAlarm2": "0.0", "extraAlarm1": 
>> "0.0","extraAlarm2": "0.0", "extraAlarm3": "0.0", "extraAlarm4": 
>> "0.0","extraAlarm5": "0.0", "extraAlarm6": "0.0", "extraAlarm7": 
>> "0.0","extraAlarm8": "0.0", "soilLeafAlarm1": "0.0", "soilLeafAlarm2": 
>> "0.0","soilLeafAlarm3": "0.0", "soilLeafAlarm4": "0.0", "forecastIcon": 
>> "6.0","sunrise": "1592212752.0", "sunset": "1592268288.0"}
>> 
>> 
>> 
>>> On Sunday, June 14, 2020 at 11:39:15 PM UTC-4, Garry A Lockyer wrote:
>>> Seems to me you have to publish MQTT data (under [StdRESTful][[MQTT]] so 
>>> that you can later retrieve the data in 
>>> [StdReport][[Belchertown]][[[Extras]]].  I suppose it’s possible to have 
>>> one instance of weewx publish data and another instance subscribe to it, 
>>> but there has to be at least one publisher somewhere.
>>> 
>>> I can’t explain the “lost connection “ message.  If I turn off MQTT 
>>> publishing, I get a “Failed connecting...” message after a minute or so.
>>> 
>>> Regards,
>>> 
>>> Garry Lockyer
>>> C: +1.250.689.0686
>>> 
>>> 
>>>>> On Jun 14, 2020, at 19:40, Ken Walker <[email protected]> wrote:
>>>> Thanks.  I don’t want to publish since I’m already getting data from 
>>>> MQTT.  My subscribe settings are the same as yours(other than host and 
>>>> topic obviously).  But it does not work.
>>>> 
>>>> I’m perplexed :)
>>>> 
>>>>> On Jun 14, 2020, at 8:54 PM, [email protected] wrote:
>>>>> 
>>>>> Here’re the settings I’m currently using successfully:
>>>>>  
>>>>> [[MQTT]]
>>>>>         # This is to PUBLISH MQTT topics - username and password are 
>>>>> required, on my system.
>>>>>  
>>>>>         server_url = mqtt://username:[email protected]:1883/
>>>>>         topic = weather/OsoyoosLakeNorthEast
>>>>>         unit_system = METRIC
>>>>>         binding = archive, loop
>>>>>         aggregation = aggregate
>>>>>  
>>>>>             # This is to SUBSCRIBE to MQTT topics - a username and 
>>>>> password are not required – at least not on my system.
>>>>>  
>>>>>             mqtt_websockets_enabled = 1
>>>>>             mqtt_websockets_host = "192.168.1.140”
>>>>>             mqtt_websockets_topic = "weather/OsoyoosLakeNorthEast/loop"
>>>>>             mqtt_websockets_port = 9001
>>>>>             disconnect_live_website_visitor = 1800000
>>>>>  
>>>>> The “aggregation” option above controls publishing one variable at a 
>>>>> time, or publishing them all in a single connection (an aggregate).
>>>>>  
>>>>> Regards,
>>>>>  
>>>>> Garry
>>>>>  
>>>>>  
>>>>> From: [email protected] <[email protected]> On Behalf Of 
>>>>> Ken Walker
>>>>> Sent: June 14, 2020 5:11 PM
>>>>> To: [email protected]
>>>>> Subject: Re: [weewx-user] Belchertown MQTT
>>>>>  
>>>>> Is the implementation expecting one observation at a time returned from 
>>>>> the broker.  I am returning from 1 - 5 observations in one json string
>>>>> 
>>>>> 
>>>>>> On Jun 14, 2020, at 7:47 PM, Garry A Lockyer <[email protected]> wrote:
>>>>>>  
>>>>>> The websockets port probably should be 9001.  1883 is usually the MQTT 
>>>>>> broker.
>>>>>> 
>>>>>> Regards,
>>>>>>  
>>>>>> Garry Lockyer
>>>>>> C: +1.250.689.0686
>>>>>> E: [email protected]
>>>>>>  
>>>>>> 
>>>>>> 
>>>>>>>> On Jun 14, 2020, at 16:43, Ken Walker <[email protected]> wrote:
>>>>>>>> 
>>>>>>> 
>>>>>>> I'm getting my data from an internal MQTT server using the wxMesh 
>>>>>>> driver and all is working well.
>>>>>>>  
>>>>>>> I would like to enable the MQTT updates, but cannot get them to work.
>>>>>>>  
>>>>>>> I get a failed to connect message.  All items are on my internal 
>>>>>>> network.  
>>>>>>>  
>>>>>>> I have no trouble connecting from my weewx box(Raspberry Pi) with the 
>>>>>>> mosquito_sub client.
>>>>>>>  
>>>>>>> Am I missing something obvious?
>>>>>>>  
>>>>>>>  
>>>>>>> I have the following in my skin.conf:
>>>>>>>  
>>>>>>>     mqtt_websockets_enabled = 1
>>>>>>>     mqtt_websockets_host = "xx.xx.xx.xxx"
>>>>>>>     mqtt_websockets_port = 1883
>>>>>>>     mqtt_websockets_ssl = 0
>>>>>>>     mqtt_websockets_topic = "weather/davis"
>>>>>>>     disconnect_live_website_visitor = 1800000
>>>>>>> 
>>>>>>> 
>>>>>>>  
>>>>>>> -- 
>>>>>>> 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 [email protected].
>>>>>>> To view this discussion on the web visit 
>>>>>>> https://groups.google.com/d/msgid/weewx-user/7237fbdc-2531-477d-bc4d-cc61970f47cfo%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 [email protected].
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/weewx-user/7D2D3A35-5E77-4E92-BDB2-74FB55535A7A%40gmail.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 [email protected].
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/weewx-user/F502A4EB-043E-42EF-9AC7-47D47B6DF76B%40gmail.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 [email protected].
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/weewx-user/01f101d642af%2495a496b0%24c0edc410%24%40gmail.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 [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/weewx-user/4ACAAF83-9CAB-4325-9ED9-38448A575FA0%40gmail.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 [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/b7fba27b-626f-4300-9f2e-5377814eb08ao%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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/08070F93-35B3-4C89-BDE7-DEA0AB1C75F2%40gmail.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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/BDB0CE48-986A-4CF5-BF80-632AE1B4233D%40gmail.com.

Reply via email to