cloudy cloudy

Author Topic: added MQTT support  (Read 1210 times)

0 Members and 1 Guest are viewing this topic.

Offline Weather Display

  • Posts: 86,527
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 73.0.3683.86
    • Weather Display
Re: added MQTT support
« Reply #15 on: April 11, 2019, 01:41:05 AM »
done that now, download again...

Offline renatohtpc

  • Posts: 66
  • Southampton, PA
  • OS/Browser:
  • Mac OS X 10.14
  • Firefox 60.0
    • N3KJE
Re: added MQTT support
« Reply #16 on: April 11, 2019, 02:55:24 AM »
Brian, it works.

3 questions

1) Here is the message I see:
bH9IkmPF7Lhvh5kgPLk5NhZ!12345 0.5 0.0 344 8.7 54 1017.1 0.0 11.4 254.5 0.00 0.00 20.9 47 100.0 13 0.0 0 0 0.0 -54.4 255.0 -65.0 -67.8 -100.0 -100.0 -100 -100 -100 22 49 16 N3KJE-10:49:16_PM 0 0 10 4 0.00 0.00 100 100 100 100 100 8.7 6.5 16.3 4.2 13 Night_time/Dry/Cloudy_with_clear_patches_ 1.5 1 1 2 2 2 2 1 1 1 1 1 0 0 0 0 0 0 0 0 0 10.0 -0.1 3625.5 4/10/2019 15.3 2.8 16.3 4.2 0.0 0 1 0 1 0 1 1 0 1 0 9.9 9.8 9.7 9.5 9.4 9.3 9.2 9.0 8.8 8.7 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 16.3 4.2 8.7 6.0 0 --- --- 308 0 0 -100.0 -100.0 0 -100 -100 -100 -100 0.0 22.4 20.0 7.4 1017.1 1006.3 7 9:49_PM 2:43_PM 23.5 3.1 6.9 -0.6 2 2019 0.0 -1 1 -1 199 92 67 87 89 73 214 215 252 344 0.0 255.0 0.3 5.2 40.18528 75.02556 0.0 91 38 0.0 5:49_AM 0.0 0.0 0.0 0.0 0.0 0.0 35.1 2:06_PM 5:49_AM 308 !!C10.37S94!!

I noticed that the message starts with a unique identifier and not !12345.  Is that by design?

2) Messages are published every 1 min. If I wanted to publish at the 2.5 sec interval supported by the Davis station, how would I do that?

3) The windows task manager shows 2 instance of crowndmqtt.exe running at all times. Is this by design? Should it just be one?

Thanks again for adding this great new feature.

Renato
Thanks
Renato
Davis Vantage Pro 2 - 6163
https://www.n3kje.net/weather/Southampton/

Offline Weather Display

  • Posts: 86,527
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 73.0.3683.86
    • Weather Display
Re: added MQTT support
« Reply #17 on: April 11, 2019, 03:00:50 AM »
I could make it where you can set the identifier (clientID) (which is followed by a !)

re udpate rate, yes,i could  make it where you set the update rate
there should be just the one running..maybe one has got stuck..kill it off?

Offline Weather Display

  • Posts: 86,527
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 73.0.3683.86
    • Weather Display
Re: added MQTT support
« Reply #18 on: April 11, 2019, 03:46:07 AM »
download a new zip again
where I have added ability to set the clientID and the update rate (seconds)

Offline renatohtpc

  • Posts: 66
  • Southampton, PA
  • OS/Browser:
  • Mac OS X 10.14
  • Firefox 60.0
    • N3KJE
Re: added MQTT support
« Reply #19 on: April 11, 2019, 04:44:41 AM »
Brian

Excellent job.  Works as advertised.

May I make a suggestion?  Perhaps the MQTT page most logical access should be from the "Control Panel" along with the other publications. My 2c.

Thanks again
Renato
Thanks
Renato
Davis Vantage Pro 2 - 6163
https://www.n3kje.net/weather/Southampton/

Offline Weather Display

  • Posts: 86,527
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 73.0.3683.86
    • Weather Display
Re: added MQTT support
« Reply #20 on: April 11, 2019, 04:56:20 AM »
maybe
but it is for the more advanced users, hence why its in the advanced setup

Offline renatohtpc

  • Posts: 66
  • Southampton, PA
  • OS/Browser:
  • Mac OS X 10.14
  • Firefox 60.0
    • N3KJE
Re: added MQTT support
« Reply #21 on: April 12, 2019, 01:16:42 AM »
Brian

some new feedback.  My MQTT server became unavailable earlier in the day. Later this evening I started the Task Manager on the machine running WD and noticed that there were hundreds of cronwdmqtt.exe processes running!

Are you starting a new process every time?  Also, you may want to consider adding exception handling logic.

Renato
Thanks
Renato
Davis Vantage Pro 2 - 6163
https://www.n3kje.net/weather/Southampton/

Offline Weather Display

  • Posts: 86,527
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 73.0.3683.86
    • Weather Display
Re: added MQTT support
« Reply #22 on: April 12, 2019, 01:22:28 AM »
i do have exception handling logic in place
the program should be closing after the data is sent
(and yes then a new one is spawned)
but what I could do is add a time out -> close

Offline Weather Display

  • Posts: 86,527
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 73.0.3683.86
    • Weather Display
Re: added MQTT support
« Reply #23 on: April 12, 2019, 01:34:51 AM »

Offline renatohtpc

  • Posts: 66
  • Southampton, PA
  • OS/Browser:
  • Mac OS X 10.14
  • Firefox 60.0
    • N3KJE
Re: added MQTT support
« Reply #24 on: April 12, 2019, 01:40:45 AM »
Brian

would it make more sense to have the connection only be established at startup and leave it connected?

For example, I have built about a dozen IOT devices using ESP8266 which publish to an MQTT server every sec.  I establish a connection as the ESP boots up. The only time I re-estaglish the connection is if the connection dies (i.e. wifi becomes unavailable, mqtt pod crashes etc) at which point, I try to reconnect every 5 mins.

I am not trying to tell you how to code, just a suggestion.

Renato
Thanks
Renato
Davis Vantage Pro 2 - 6163
https://www.n3kje.net/weather/Southampton/

Offline Weather Display

  • Posts: 86,527
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 73.0.3683.86
    • Weather Display
Re: added MQTT support
« Reply #25 on: April 12, 2019, 01:51:46 AM »
i was not really envisaging people wanting to send data frequently, that was all
otherwise yes I would do it that way, and still could yet
anyway , make sure to use this new update and see how that goes

Offline renatohtpc

  • Posts: 66
  • Southampton, PA
  • OS/Browser:
  • Mac OS X 10.14
  • Firefox 60.0
    • N3KJE
Re: added MQTT support
« Reply #26 on: April 12, 2019, 01:52:59 AM »
Brian

I tried the new program, but it does not publish any messages. I replaced the new one with n-1 and messages started showing up.

Renato
Thanks
Renato
Davis Vantage Pro 2 - 6163
https://www.n3kje.net/weather/Southampton/

Offline Weather Display

  • Posts: 86,527
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 73.0.3683.86
    • Weather Display
Re: added MQTT support
« Reply #27 on: April 12, 2019, 02:10:16 AM »
my bad
try again

http://www.weather-display.com/downloadfiles/cronwdmqtt.zip

once this runs stable then can work on having it stay logged in and running

Offline renatohtpc

  • Posts: 66
  • Southampton, PA
  • OS/Browser:
  • Mac OS X 10.14
  • Firefox 60.0
    • N3KJE
Re: added MQTT support
« Reply #28 on: April 12, 2019, 02:17:20 AM »
Yep, that did it.

Tomorrow morning (my time) I am going to simulate MQTT going offline and will keep an eye on the total number of mqtt processes.

Thanks again
Renato
Thanks
Renato
Davis Vantage Pro 2 - 6163
https://www.n3kje.net/weather/Southampton/

Offline Weather Display

  • Posts: 86,527
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 73.0.3683.86
    • Weather Display
Re: added MQTT support
« Reply #29 on: April 12, 2019, 02:38:09 AM »
actually download yet again
as I need to have added a time out
because if no connection then it will not close

 

cumulus