david
Junior Member
Posts: 95
Raspberry Pi: Yes
|
Post by david on Mar 15, 2020 9:20:59 GMT -8
Just checking, the new v2 board will communicate with Mosquitto MQTT but not (at least not yet) with PubNub to Alexa. Am I correct?
|
|
|
Post by SDL on Mar 16, 2020 13:52:50 GMT -8
Correct. V057 does not communicate with Alexa or PubNub. We are actually looking at a better way of communicating with Alexa and with Google Home. Probably won't get to that until early summer.
BP
|
|
david
Junior Member
Posts: 95
Raspberry Pi: Yes
|
Post by david on Mar 20, 2020 8:49:30 GMT -8
No problem. I got set up to communicate to Mosquitto on a Pi and then modified DataLogger (very crudely) so I can plot readings over time.
|
|
david
Junior Member
Posts: 95
Raspberry Pi: Yes
|
Post by david on Mar 24, 2020 7:28:21 GMT -8
Update: I have this working 'some of the time'. I have a very limited understanding of the Mosquitto subscribe. I have a python script on the raspberry pi that Mosquitto MQTT is on to subscribe and write to a MySQL database. When I monitor my OurWeather v2 serial output I see it is seems to successfully publish to MQTT. But the subscribe is very unreliable. Either the broker is not sending all messages or my script does not receive all. Is anyone using Mosquitto like this or a similar way? Any thoughts?
|
|
david
Junior Member
Posts: 95
Raspberry Pi: Yes
|
Post by david on Mar 26, 2020 14:22:23 GMT -8
Looking for help. I have been looking and digging into logs and running mosquitto_sub in terminal to monitor. And now I am convinced that the OurWeather is not reliably publishing to mosquitto. If I have a laptop connected to serial on OurWeather it looks like it is publishing just fine. But nothing comes into a mosquitto_sub in terminal on pi. If I do not monitor serial but instead use normal power supply, I will get several messages in the mosquitto_sub but after a few messages it stops getting messages. Any ideas?
|
|
|
Post by SDL on Mar 26, 2020 17:10:17 GMT -8
I have run the MQTT versions for a long time and they work for me.
What version of software are you running? There was a bug in pre-V057 but it didn't behave as you are describing.
Here is the command I use to test on the Pi.
mosquitto_sub -d -t OurWeather BP
|
|
david
Junior Member
Posts: 95
Raspberry Pi: Yes
|
Post by david on Mar 27, 2020 4:40:02 GMT -8
Mosquitto v1.6.8 OurWeather v57 (You will see in the mosquitto_sub capture that it has v55. Whenever I manually upload I change the version number so if anything goes bad the OTA update on the OurWeatherAdmin page will be able to overwrite what I uploaded, to rescue me) I have OurWeather set to publish every 120 sec. The mosquitto_sub capture is about 90 minutes. I am not sure it problem is OurWeather not publishing or mosquitto not receiving.
pi@raspberrypi:~ $ mosquitto_sub -d -t OurWeather Client mosq-h9I03Sem9FG0Ezi0JQ sending CONNECT Client mosq-h9I03Sem9FG0Ezi0JQ received CONNACK (0) Client mosq-h9I03Sem9FG0Ezi0JQ sending SUBSCRIBE (Mid: 1, Topic: OurWeather, QoS: 0, Options: 0x00) Client mosq-h9I03Sem9FG0Ezi0JQ received SUBACK Subscribed (mid: 1): 0 Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ received PUBLISH (d0, q0, r0, m0, 'OurWeather', ... (380 bytes)) {"stationname": David Weather Station, "softwareversion": 055, "hardware": esp32, "Controllerboard": V2, "connected": true ,"FullDataString": "21.07,86.24,25.42,100938.00,220.56,5.51,14.79,202.50,0.00,5.51,5.92,14.79,39.38,202.50,225.00,0,2020-03-27 06:44:23,David Weather Station,3024,4,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,V:,WXLMB ,1,,,0,,,0,0.00,-4800"} Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ received PUBLISH (d0, q0, r0, m0, 'OurWeather', ... (361 bytes)) {"stationname": David Weather Station, "softwareversion": 055, "hardware": esp32, "Controllerboard": V2, "connected": true ,"FullDataString": "20.86,87.24,25.34,100967.00,218.15,6.25,13.87,225.00,0.00,2.46,7.58,7.02,16.76,135.00,225.00,0,2020-03-27 07:26:25,David Weather Station,3216,4,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,V:,WXLMB ,1,"} Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ezi0JQ sending PINGREQ Client mosq-h9I03Sem9FG0Ezi0JQ received PINGRESP Client mosq-h9I03Sem9FG0Ez
|
|
david
Junior Member
Posts: 95
Raspberry Pi: Yes
|
Post by david on Mar 28, 2020 7:11:35 GMT -8
Still working on this.
This first clip is from logging of serial output. It did not come through to mosquitto_sub :
:23:20.359 -> as3935 irqSource: 0 08:23:20.745 -> Attempting MQTT connection...connected 08:23:21.210 -> RTOS Task Sending MQTT Packet 08:23:21.210 -> {"stationname": David Weather Station, "softwareversion": 055, "hardware": esp32, "Controllerboard": V2, "connected": true ,"FullDataString": "21.31,88.98,25.90,100912.00,222.79,8.50,16.97,225.00,0.00,7.97,8.50,16.97,23.77,225.00,225.00,0,2020-03-28 08:23:19,David Weather Station,3280,4,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,V:,WXLMB ,1,0 km,2020-03-28 08:22:43,0,Lightning detected,2020-03-28 08:22:43,1,0.00,-4600"} 08:23:21.804 -> MQTT publish result=0 08 This second clip from serial log did come through to mosquitto_sub
30:24.316 -> INT_L Interrupt: Lightning Detected. Stroke Distance:0 km 08:30:27.702 -> RTOS Task Sending MQTT Packet 08:30:27.702 -> {"stationname": David Weather Station, "softwareversion": 055, "hardware": esp32, "Controllerboard": V2, "connected": true ,"FullDataString": "21.41,88.88,26.86,100925.00,221.63,8.80,21.99,180.00,0.00,6.95,11.58,13.94,27.54,135.00,225.00,0,2020-03-28 08:30:23,David Weather Station,3184,4,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,V:,WXLMB ,1,"} 08:30:27.702 -> MQTT publish result=1 08 First clip has MQTT publish result=0 and second has MQTT publish result=1. Does 1 = success and 0 = failure? Or any indication of reason for failure?
As a side note you can see the second clip has an incomplete FullDataString payload. I have noticed that some of the messages that get to mosquitto have full FullDataString and some do not.
Thanks
|
|
david
Junior Member
Posts: 95
Raspberry Pi: Yes
|
Post by david on Mar 29, 2020 10:41:02 GMT -8
I do not want to celebrate prematurely, but I think I may finally made some improvement. MQTT_MAX_PACKET_SIZE in aPubSubClient.h was set to 400, I changed to 512 and looks like all messages are getting through.
|
|
|
Post by SDL on Mar 29, 2020 17:55:39 GMT -8
That could be. When you are comfortable with that, let me know and I'll update the main software.
BP
|
|
david
Junior Member
Posts: 95
Raspberry Pi: Yes
|
Post by david on Mar 30, 2020 19:05:30 GMT -8
Yes, all messages getting through for the past 24 hours. The MQTT_MAX_PACKET_SIZE change has resolved the issue I was having.
|
|
|
Post by SDL on Apr 1, 2020 15:40:09 GMT -8
Woohoo! Your fix is added to V058!
BP
|
|