MQTT disconnect when MQTT publishes new data since adding soil moisture sensors

216 views
Skip to first unread message

Stefan Gliessmann

unread,
Oct 5, 2023, 8:17:29 AM10/5/23
to weewx-user
Hello group!

Yesterday, I added soil moisture sensors to my EcoWitt GW1100.
I added also a graph in my Belchertown skin:

Screenshot 2023-10-05 at 14.04.21.png

However, since then I notice this:
Screenshot 2023-10-05 at 13.56.38.png

The same MQTT server is used for another weewx instance and, hence, I knew it is not the MQTT server or broadcasting.

Today, I used the inspection function of google chrome and I found this error message:
Screenshot 2023-10-05 at 14.09.33.png
I haven't seen this issue since I have added the soil moisture sensors. Hence, it should be correlated, shouldn't it?

This is the Gateway Driver & MQTT data from the syslog:

Oct  5 14:12:55 weewx weewx[140241] INFO weewx.restx: MQTT: Published record 2023-10-05 14:12:55 CEST (1696507975)

Oct  5 14:13:00 weewx weewx[140241] DEBUG user.gw1000: Sending packet 'FF FF 27 03 2A' to 192.168.178.45:45000

Oct  5 14:13:00 weewx weewx[140241] DEBUG user.gw1000: Received response 'FF FF 27 00 54 01 00 DD 06 32 08 27 9D 09 27 FB 02 00 A6 07 46 0A 00 C7 0B 00 04 0C 00 0A 15 00 02 3A F0 16 00 A5 17 01 2C 0E 2E 16 30 15 32 1E 62 00 00 00 00 61 65 1C 15 90 60 0A 19 00 3D 0E 00 00 10 00 00 11 00 51 12 00 00 00 51 13 00 00 08 61 0D 00 00 AF'

Oct  5 14:13:00 weewx weewx[140241] DEBUG user.gw1000: Sending packet 'FF FF 57 03 5A' to 192.168.178.45:45000

Oct  5 14:13:00 weewx weewx[140241] DEBUG user.gw1000: Received response 'FF FF 57 00 29 0E 00 00 10 00 00 00 00 11 00 00 00 51 12 00 00 00 51 13 00 00 08 61 0D 00 00 0F 00 64 88 00 01 00 7A 01 7B 00 DE'

Oct  5 14:13:00 weewx weewx[140241] DEBUG user.gw1000: Unknown field address '7B' detected. Remaining data '00' ignored.

Oct  5 14:13:00 weewx weewx[140241] DEBUG user.gw1000: Parsed data: {'intemp': 22.1, 'inhumid': 50, 'absbarometer': 1014.1, 'relbarometer': 1023.5, 'outtemp': 16.6, 'outhumid': 70, 'winddir': 199, 'windspeed': 0.4, 'gustspeed': 1.0, 'light': 14616.0, 'uv': 16.5, 'uvi': 1, 'soilmoist1': 14, 'soilmoist2': 22, 'soilmoist3': 21, 'soilmoist4': 30, 'lightningcount': 0, 'lightningdettime': 1696339344, 'lightningdist': 10, 'daymaxwind': 6.1, 't_rainrate': 0.0, 't_rainday': 0.0, 't_rainweek': 8.1, 't_rainmonth': 8.1, 't_rainyear': 214.5, 't_rainevent': 0.0, 't_rainhour': 10.0, 'day_reset': 0, 'week_reset': 1, 'annual_reset': 0, 'rain_source': 1, 'datetime': 1696507980}

Oct  5 14:13:00 weewx weewx[140241] DEBUG user.gw1000: Sending packet 'FF FF 3C 03 3F' to 192.168.178.45:45000

Oct  5 14:13:00 weewx weewx[140241] DEBUG user.gw1000: Received response 'FF FF 3C 01 5B 00 00 00 00 3C 00 04 01 FF FF FF FF FF 00 02 FF FF FF FF FF 00 03 FF FF FF FF 1F 00 04 FF FF FF FF 00 00 05 FF FF FF FF 00 00 06 FF FF FF FE 00 00 07 FF FF FF FF 00 00 08 FF FF FF FF 00 00 09 FF FF FF FF 00 00 0A FF FF FF FF 00 00 0B FF FF FF FF 00 00 0C FF FF FF FF 00 00 0D FF FF FF FF 00 00 0E 00 0D A4 DD 10 04 0F 00 0D A2 13 10 04 10 00 0D 83 A5 10 04 11 00 0D A4 94 10 04 12 FF FF FF FF 1F 00 13 FF FF FF FF 1F 00 14 FF FF FF FF 1F 00 15 FF FF FF FF 1F 00 16 FF FF FF FF 0F 00 17 FF FF FF FF 0F 00 18 FF FF FF FF 0F 00 19 FF FF FF FF 0F 00 1A 00 01 0B B8 04 04 1B FF FF FF FF 0F 00 1C FF FF FF FF 0F 00 1D FF FF FF FF 0F 00 1E FF FF FF FF 0F 00 1F FF FF FF FF FF 00 20 FF FF FF FF FF 00 21 FF FF FF FF FF 00 22 FF FF FF FF FF 00 23 FF FF FF FF FF 00 24 FF FF FF FF FF 00 25 FF FF FF FF FF 00 26 FF FF FF FF FF 00 27 FF FF FF FF 0F 00 28 FF FF FF FF FF 00 29 FF FF FF FF FF 00 2A FF FF FF FF FF 00 2B FF FF FF FF FF 00 2C FF FF FF FF FF 00 2D FF FF FF FF FF 00 2E FF FF FF FF FF 00 2F FF FF FF FF FF 00 30 FF FF FF FF FF 00 B8'

Oct  5 14:13:00 weewx weewx[140241] DEBUG user.gw1000: Processed parsed data: {'intemp': 22.1, 'inhumid': 50, 'absbarometer': 1014.1, 'relbarometer': 1023.5, 'outtemp': 16.6, 'outhumid': 70, 'winddir': 199, 'windspeed': 0.4, 'gustspeed': 1.0, 'light': 14616.0, 'uv': 16.5, 'uvi': 1, 'soilmoist1': 14, 'soilmoist2': 22, 'soilmoist3': 21, 'soilmoist4': 30, 'lightningcount': 0, 'lightningdettime': 1696339344, 'lightningdist': 10, 'daymaxwind': 6.1, 't_rainrate': 0.0, 't_rainday': 0.0, 't_rainweek': 8.1, 't_rainmonth': 8.1, 't_rainyear': 214.5, 't_rainevent': 0.0, 't_rainhour': 10.0, 'day_reset': 0, 'week_reset': 1, 'annual_reset': 0, 'rain_source': 1, 'datetime': 1696507980, 'wh65_batt': 0, 'wh65_sig': 4, 'wh51_ch1_batt': 1.6, 'wh51_ch1_sig': 4, 'wh51_ch2_batt': 1.6, 'wh51_ch2_sig': 4, 'wh51_ch3_batt': 1.6, 'wh51_ch3_sig': 4, 'wh51_ch4_batt': 1.6, 'wh51_ch4_sig': 4, 'wh57_batt': 4, 'wh57_sig': 4}

Oct  5 14:13:00 weewx weewx[140241] DEBUG user.gw1000: Next update in 5 seconds

Oct  5 14:13:00 weewx weewx[140241] INFO user.gw1000: GatewayDriver: Packet 2023-10-05 14:13:00 CEST (1696507980): {'dateTime': '1696507980', 'daymaxwind': '6.1', 'dayRain': '0.0', 'inHumidity': '50', 'inTemp': '22.1', 'lightning_distance': '10', 'lightning_last_det_time': '1696339344', 'lightning_strike_count': '0', 'lightningcount': '0', 'luminosity': '14616.0', 'monthRain': '8.1', 'outHumidity': '70', 'outTemp': '16.6', 'pressure': '1014.1', 'rain': '0.0', 'rainRate': '0.0', 'relbarometer': '1023.5', 'soilMoist1': '14', 'soilMoist2': '22', 'soilMoist3': '21', 'soilMoist4': '30', 'stormRain': '0.0', 'usUnits': '17', 'UV': '1', 'uvradiation': '16.5', 'weekRain': '8.1', 'wh51_ch1_batt': '1.6', 'wh51_ch1_sig': '4', 'wh51_ch2_batt': '1.6', 'wh51_ch2_sig': '4', 'wh51_ch3_batt': '1.6', 'wh51_ch3_sig': '4', 'wh51_ch4_batt': '1.6', 'wh51_ch4_sig': '4', 'wh57_batt': '4', 'wh57_sig': '4', 'wh65_batt': '0', 'wh65_sig': '4', 'windDir': '199', 'windGust': '1.0', 'windSpeed': '0.4', 'yearRain': '214.5'}

Oct  5 14:13:00 weewx weewx[140241] DEBUG weewx.wxservices: Unknown extensible type 'lightning_distance'

Oct  5 14:13:00 weewx weewx[140241] DEBUG user.mqtt: data: {'dateTime': '1696507980.0', 'inTemp_C': '22.1', 'outTemp_C': '16.6', 'inHumidity': '50.0', 'outHumidity': '70.0', 'pressure_mbar': '1014.1', 'relbarometer': '1023.5', 'luminosity': '14616.0', 'uvradiation': '16.5', 'UV': '1.0', 'lightning_distance_km': '9.999999996180481', 'lightning_last_det_time': '1696339344.0', 'lightningcount': '0.0', 'rain_cm': '0.0', 'stormRain_cm': '0.0', 'rainRate_cm_per_hour': '0.0', 'dayRain_cm': '0.0', 'weekRain': '8.1', 'monthRain_cm': '0.8099999999999999', 'yearRain_cm': '21.45', 'windDir': '199.0', 'windSpeed_kph': '1.4400035791069632', 'windGust_kph': '3.600008947767408', 'daymaxwind': '6.1', 'wh65_batt': '0.0', 'wh57_batt': '4.0', 'wh65_sig': '4.0', 'wh57_sig': '4.0', 'radiation_Wpm2': '115.35911602209944', 'altimeter_mbar': '1017.7876737945435', 'appTemp_C': '16.67405819726683', 'barometer_mbar': '1017.6788513300322', 'cloudbase_meter': '715.3367336252038', 'dewpoint_C': '11.102661688925366', 'heatindex_C': '16.143333333333334', 'humidex_C': '18.404753903115186', 'inDewpoint_C': '11.182156862189714', 'maxSolarRad_Wpm2': '467.4683736140874', 'windchill_C': '16.6', 'lightning_strike_count_count': '0.0', 'soilMoist1_centibar': '14.0', 'wh51_ch1_batt': '1.6', 'wh51_ch1_sig': '4.0', 'soilMoist2_centibar': '22.0', 'wh51_ch2_batt': '1.6', 'wh51_ch2_sig': '4.0', 'soilMoist3_centibar': '21.0', 'wh51_ch3_batt': '1.6', 'wh51_ch3_sig': '4.0', 'soilMoist4_centibar': '30.0', 'wh51_ch4_batt': '1.6', 'wh51_ch4_sig': '4.0', 'hourRain_cm': '0.0', 'rain24_cm': '0.0', 'usUnits': '16.0'}

Oct  5 14:13:00 weewx weewx[140241] INFO weewx.restx: MQTT: Published record 2023-10-05 14:13:00 CEST (1696507980)

Oct  5 14:13:05 weewx weewx[140241] DEBUG user.gw1000: Sending packet 'FF FF 27 03 2A' to 192.168.178.45:45000

Oct  5 14:13:05 weewx weewx[140241] DEBUG user.gw1000: Received response 'FF FF 27 00 54 01 00 DD 06 32 08 27 9D 09 27 FB 02 00 A6 07 46 0A 00 C7 0B 00 04 0C 00 0A 15 00 02 3A F0 16 00 A5 17 01 2C 0E 2E 16 30 15 32 1E 62 00 00 00 00 61 65 1C 15 90 60 0A 19 00 3D 0E 00 00 10 00 00 11 00 51 12 00 00 00 51 13 00 00 08 61 0D 00 00 AF'

Oct  5 14:13:05 weewx weewx[140241] DEBUG user.gw1000: Sending packet 'FF FF 57 03 5A' to 192.168.178.45:45000

Oct  5 14:13:05 weewx weewx[140241] DEBUG user.gw1000: Received response 'FF FF 57 00 29 0E 00 00 10 00 00 00 00 11 00 00 00 51 12 00 00 00 51 13 00 00 08 61 0D 00 00 0F 00 64 88 00 01 00 7A 01 7B 00 DE'

Oct  5 14:13:05 weewx weewx[140241] DEBUG user.gw1000: Unknown field address '7B' detected. Remaining data '00' ignored.

Oct  5 14:13:05 weewx weewx[140241] DEBUG user.gw1000: Parsed data: {'intemp': 22.1, 'inhumid': 50, 'absbarometer': 1014.1, 'relbarometer': 1023.5, 'outtemp': 16.6, 'outhumid': 70, 'winddir': 199, 'windspeed': 0.4, 'gustspeed': 1.0, 'light': 14616.0, 'uv': 16.5, 'uvi': 1, 'soilmoist1': 14, 'soilmoist2': 22, 'soilmoist3': 21, 'soilmoist4': 30, 'lightningcount': 0, 'lightningdettime': 1696339344, 'lightningdist': 10, 'daymaxwind': 6.1, 't_rainrate': 0.0, 't_rainday': 0.0, 't_rainweek': 8.1, 't_rainmonth': 8.1, 't_rainyear': 214.5, 't_rainevent': 0.0, 't_rainhour': 10.0, 'day_reset': 0, 'week_reset': 1, 'annual_reset': 0, 'rain_source': 1, 'datetime': 1696507985}

Oct  5 14:13:05 weewx weewx[140241] DEBUG user.gw1000: Sending packet 'FF FF 3C 03 3F' to 192.168.178.45:45000

Oct  5 14:13:05 weewx weewx[140241] DEBUG user.gw1000: Received response 'FF FF 3C 01 5B 00 00 00 00 3C 00 04 01 FF FF FF FF FF 00 02 FF FF FF FF FF 00 03 FF FF FF FF 1F 00 04 FF FF FF FF 00 00 05 FF FF FF FF 00 00 06 FF FF FF FE 00 00 07 FF FF FF FF 00 00 08 FF FF FF FF 00 00 09 FF FF FF FF 00 00 0A FF FF FF FF 00 00 0B FF FF FF FF 00 00 0C FF FF FF FF 00 00 0D FF FF FF FF 00 00 0E 00 0D A4 DD 10 04 0F 00 0D A2 13 10 04 10 00 0D 83 A5 10 04 11 00 0D A4 94 10 04 12 FF FF FF FF 1F 00 13 FF FF FF FF 1F 00 14 FF FF FF FF 1F 00 15 FF FF FF FF 1F 00 16 FF FF FF FF 0F 00 17 FF FF FF FF 0F 00 18 FF FF FF FF 0F 00 19 FF FF FF FF 0F 00 1A 00 01 0B B8 04 04 1B FF FF FF FF 0F 00 1C FF FF FF FF 0F 00 1D FF FF FF FF 0F 00 1E FF FF FF FF 0F 00 1F FF FF FF FF FF 00 20 FF FF FF FF FF 00 21 FF FF FF FF FF 00 22 FF FF FF FF FF 00 23 FF FF FF FF FF 00 24 FF FF FF FF FF 00 25 FF FF FF FF FF 00 26 FF FF FF FF FF 00 27 FF FF FF FF 0F 00 28 FF FF FF FF FF 00 29 FF FF FF FF FF 00 2A FF FF FF FF FF 00 2B FF FF FF FF FF 00 2C FF FF FF FF FF 00 2D FF FF FF FF FF 00 2E FF FF FF FF FF 00 2F FF FF FF FF FF 00 30 FF FF FF FF FF 00 B8'

Oct  5 14:13:05 weewx weewx[140241] DEBUG user.gw1000: Processed parsed data: {'intemp': 22.1, 'inhumid': 50, 'absbarometer': 1014.1, 'relbarometer': 1023.5, 'outtemp': 16.6, 'outhumid': 70, 'winddir': 199, 'windspeed': 0.4, 'gustspeed': 1.0, 'light': 14616.0, 'uv': 16.5, 'uvi': 1, 'soilmoist1': 14, 'soilmoist2': 22, 'soilmoist3': 21, 'soilmoist4': 30, 'lightningcount': 0, 'lightningdettime': 1696339344, 'lightningdist': 10, 'daymaxwind': 6.1, 't_rainrate': 0.0, 't_rainday': 0.0, 't_rainweek': 8.1, 't_rainmonth': 8.1, 't_rainyear': 214.5, 't_rainevent': 0.0, 't_rainhour': 10.0, 'day_reset': 0, 'week_reset': 1, 'annual_reset': 0, 'rain_source': 1, 'datetime': 1696507985, 'wh65_batt': 0, 'wh65_sig': 4, 'wh51_ch1_batt': 1.6, 'wh51_ch1_sig': 4, 'wh51_ch2_batt': 1.6, 'wh51_ch2_sig': 4, 'wh51_ch3_batt': 1.6, 'wh51_ch3_sig': 4, 'wh51_ch4_batt': 1.6, 'wh51_ch4_sig': 4, 'wh57_batt': 4, 'wh57_sig': 4}

Oct  5 14:13:05 weewx weewx[140241] DEBUG user.gw1000: Next update in 5 seconds

Oct  5 14:13:05 weewx weewx[140241] INFO user.gw1000: GatewayDriver: Packet 2023-10-05 14:13:05 CEST (1696507985): {'dateTime': '1696507985', 'daymaxwind': '6.1', 'dayRain': '0.0', 'inHumidity': '50', 'inTemp': '22.1', 'lightning_distance': '10', 'lightning_last_det_time': '1696339344', 'lightning_strike_count': '0', 'lightningcount': '0', 'luminosity': '14616.0', 'monthRain': '8.1', 'outHumidity': '70', 'outTemp': '16.6', 'pressure': '1014.1', 'rain': '0.0', 'rainRate': '0.0', 'relbarometer': '1023.5', 'soilMoist1': '14', 'soilMoist2': '22', 'soilMoist3': '21', 'soilMoist4': '30', 'stormRain': '0.0', 'usUnits': '17', 'UV': '1', 'uvradiation': '16.5', 'weekRain': '8.1', 'wh51_ch1_batt': '1.6', 'wh51_ch1_sig': '4', 'wh51_ch2_batt': '1.6', 'wh51_ch2_sig': '4', 'wh51_ch3_batt': '1.6', 'wh51_ch3_sig': '4', 'wh51_ch4_batt': '1.6', 'wh51_ch4_sig': '4', 'wh57_batt': '4', 'wh57_sig': '4', 'wh65_batt': '0', 'wh65_sig': '4', 'windDir': '199', 'windGust': '1.0', 'windSpeed': '0.4', 'yearRain': '214.5'}

Oct  5 14:13:05 weewx weewx[140241] DEBUG weewx.wxservices: Unknown extensible type 'lightning_distance'

Oct  5 14:13:05 weewx weewx[140241] DEBUG user.mqtt: data: {'dateTime': '1696507985.0', 'inTemp_C': '22.1', 'outTemp_C': '16.6', 'inHumidity': '50.0', 'outHumidity': '70.0', 'pressure_mbar': '1014.1', 'relbarometer': '1023.5', 'luminosity': '14616.0', 'uvradiation': '16.5', 'UV': '1.0', 'lightning_distance_km': '9.999999996180481', 'lightning_last_det_time': '1696339344.0', 'lightningcount': '0.0', 'rain_cm': '0.0', 'stormRain_cm': '0.0', 'rainRate_cm_per_hour': '0.0', 'dayRain_cm': '0.0', 'weekRain': '8.1', 'monthRain_cm': '0.8099999999999999', 'yearRain_cm': '21.45', 'windDir': '199.0', 'windSpeed_kph': '1.4400035791069632', 'windGust_kph': '3.600008947767408', 'daymaxwind': '6.1', 'wh65_batt': '0.0', 'wh57_batt': '4.0', 'wh65_sig': '4.0', 'wh57_sig': '4.0', 'radiation_Wpm2': '115.35911602209944', 'altimeter_mbar': '1017.7876737945435', 'appTemp_C': '16.67405819726683', 'barometer_mbar': '1017.6788513300322', 'cloudbase_meter': '715.3367336252038', 'dewpoint_C': '11.102661688925366', 'heatindex_C': '16.143333333333334', 'humidex_C': '18.404753903115186', 'inDewpoint_C': '11.182156862189714', 'maxSolarRad_Wpm2': '467.3898443214722', 'windchill_C': '16.6', 'lightning_strike_count_count': '0.0', 'soilMoist1_centibar': '14.0', 'wh51_ch1_batt': '1.6', 'wh51_ch1_sig': '4.0', 'soilMoist2_centibar': '22.0', 'wh51_ch2_batt': '1.6', 'wh51_ch2_sig': '4.0', 'soilMoist3_centibar': '21.0', 'wh51_ch3_batt': '1.6', 'wh51_ch3_sig': '4.0', 'soilMoist4_centibar': '30.0', 'wh51_ch4_batt': '1.6', 'wh51_ch4_sig': '4.0', 'hourRain_cm': '0.0', 'rain24_cm': '0.0', 'usUnits': '16.0'}

Oct  5 14:13:05 weewx weewx[140241] INFO weewx.restx: MQTT: Published record 2023-10-05 14:13:05 CEST (1696507985)


Any clue what is happening?

Stefan Gliessmann

unread,
Oct 9, 2023, 10:29:36 AM10/9/23
to weewx-user
Since ever I have the soil moisture sensors installed, MQTT displays in the Belchertown skin "Lost connection" whenever a new MQTT dataset is broadcasted.

Using the inspect function of google chrome, I see this error message:

MQTT: 2023-10-09T16:01:34+02:00: mqtt Connection Lost: AMQJS0005E Internal error. Error Message: minimumFractionDigits value is out of range., Stack trace: No Error Stack Available

I can see that the GW1100 is broadcasting the soil moisture values as integers in the EcoWitt app as well as the gw1000 weewx driver: 
  'soilmoist1': 12, 'soilmoist2': 20, 'soilmoist3': 17, 'soilmoist4': 26

I can also see that user.mqtt sends the values as fractions adding ".0" to the values from gw1000 driver: 
  'soilMoist1_centibar': '12.0', 'wh51_ch1_batt': '1.6', 'wh51_ch1_sig': '4.0', 'soilMoist2_centibar': '20.0', 'wh51_ch2_batt': '1.6', 'wh51_ch2_sig': '4.0', 'soilMoist3_centibar': '17.0', 'wh51_ch3_batt': '1.6', 'wh51_ch3_sig': '4.0', 'soilMoist4_centibar': '26.0', 'wh51_ch4_batt': '1.6', 'wh51_ch4_sig': '4.0'

In my graph for soil moisture I can see "sometimes" fractions, too, which are not ".0" (as it is archive data and not loop data?):
Screenshot 2023-10-09 at 16.25.08.png

Any clue what I need to adjust?

TIA,
Stefan

Greg Troxel

unread,
Oct 9, 2023, 10:37:18 AM10/9/23
to Stefan Gliessmann, weewx-user
Stefan Gliessmann <stefan.g...@gmail.com> writes:

> Using the inspect function of google chrome, I see this error message:
>
> *MQTT: 2023-10-09T16:01:34+02:00: mqtt Connection Lost: AMQJS0005E Internal
> error. Error Message: minimumFractionDigits value is out of range., Stack
> trace: No Error Stack Available*
>
> I can see that the GW1100 is broadcasting the soil moisture values as
> integers in the EcoWitt app as well as the gw1000 weewx driver:
> *'soilmoist1': 12, 'soilmoist2': 20, 'soilmoist3': 17, 'soilmoist4': 26*

mqtt is strings. It is not integers or floats.

It is perfectly normal for a receiver to try to parse a number from
that string, but I would say that "17" is a perfectly reasonable number
and that objecting to it because it is not "17.0" is a bug. If that's
what is going on of course!

> I can also see that user.mqtt sends the values as fractions adding ".0" to
> the values from gw1000 driver:
> *'soilMoist1_centibar': '12.0'*, 'wh51_ch1_batt': '1.6', 'wh51_ch1_sig':
> '4.0', *'soilMoist2_centibar': '20.0'*, 'wh51_ch2_batt': '1.6',
> 'wh51_ch2_sig': '4.0', *'soilMoist3_centibar': '17.0'*, 'wh51_ch3_batt':
> '1.6', 'wh51_ch3_sig': '4.0', *'soilMoist4_centibar': '26.0'*,
> 'wh51_ch4_batt': '1.6', 'wh51_ch4_sig': '4.0'
>
> In my graph for soil moisture I can see "sometimes" fractions, too, which
> are not ".0" (as it is archive data and not loop data?):
> [image: Screenshot 2023-10-09 at 16.25.08.png]
>
> Any clue what I need to adjust?

First you need to find out what the resolution of the sensor really is.
(Very cool that is it moisture in pressure instead of the usual %.)
Then a publisher might need to adjust. Separately the subscriber
should probably be fixed too.

Stefan Gliessmann

unread,
Oct 9, 2023, 10:45:36 AM10/9/23
to weewx-user
Uncaught Error: AMQJS0011E Invalid state not connecting or connected.
    at d.disconnect (paho-mqtt.min.js:35:305)
    at Client.disconnect (paho-mqtt.min.js:74:193)
    at inactive (belchertown.js?1696860019:1586:12)
d.disconnect @ paho-mqtt.min.js:35
Client.disconnect @ paho-mqtt.min.js:74
inactive @ belchertown.js?1696860019:1586

I just noticed this as well in the inspect frame of google chrome ...

Stefan Gliessmann

unread,
Oct 10, 2023, 4:42:49 AM10/10/23
to Greg Troxel, weewx-user
Hi Greg et al.,

My soil moisture sensors are Ecowitt WH51.
Online I found their specs:
Moisture Range: 0 - 100 %
Resolution: 1 %

(so, it is % and not centibar?!)

I do not understand how my moisture graph displays values after the decimal point.

I use the https://github.com/matthewwall/weewx-mqtt weewx mqtt extension version 0.24 for broadcasting the Ecowitt GW 1100 data thru a local mosquitto server into Belchertown skin.

Is there another weewx mqtt extension which is recommended to be used as a publisher?

TIA,
Stefan

Greg Troxel

unread,
Oct 10, 2023, 8:50:37 AM10/10/23
to Stefan Gliessmann, weewx-user

Greg Troxel

unread,
Oct 10, 2023, 8:58:45 AM10/10/23
to Stefan Gliessmann, weewx-user
Stefan Gliessmann <stefan.g...@gmail.com> writes:

> My soil moisture sensors are Ecowitt WH51.
> Online I found their specs:
> Moisture Range: 0 - 100 %
> Resolution: 1 %
> (so, it is % and not centibar?!)

Yes, that is % moisture. The WH51 is a very normal sensor. I have one
and read it via rtl_433. See src/devices/fineoffset.c at
https://github.com/merbanan/rtl_433/ for details.n

It reads in integer %, but there is also an ADC raw value that one can
use to calculate.

> I do not understand how my moisture graph displays values after the decimal
> point.

I don't either, but to figure that out you will need to trace data flow
through the entire system, examining each step. That may require you to
read docs on various other things and dig in enough to understand.

> I use the https://github.com/matthewwall/weewx-mqtt weewx mqtt extension
> version 0.24 for broadcasting the Ecowitt GW 1100 data thru a local
> mosquitto server into Belchertown skin.

I would recommend looking at what is in your weewx database, and also
subscribe manually to the mqtt feed and look at that. It is likely
that somehwere, something is off, but I don't expect anyone here to guess.

> Is there another weewx mqtt extension which is recommended to be used as a
> publisher?

That's the standard approach. I have been using it for years with no
issues.

Stefan Gliessmann

unread,
Oct 10, 2023, 9:12:49 AM10/10/23
to Greg Troxel, weewx-user
Thanks again, Greg, for you "moral" support ;)

with the appropiate setting in weewx.conf for the MQTT extension, the soil moisture values have no digits after the decimal point.

By now, I believe it is a mqtt topic issue.
It is a bit odd as I use the same infrastructure for my other weewx station (rv.stegli.de) and, there MQTT just Works fine with the topic RV.
For weather.stegli.de the topic is weather ... and that worked well prior adding the WH51s ...

Oh well - it keeps me busy 😅

Thanks again!
Stefan 

bell...@gmail.com

unread,
Oct 10, 2023, 7:57:25 PM10/10/23
to weewx-user
Disclaimer, I don’t know anything about the Belchertown skin, but since your site is public, I thought I would poke around see if I could help.

From, https://www.w3schools.com/jsref/jsref_tolocalestring_number.asp, it looks like valid values for minimumFractionDigits is 0 to 20.
I guessed that the exception was in the onMessageArrived callback.
If you trace the code from when a MQTT message arrive, at line 1675 is
‘html_output = parseFloat(parseFloat(data[mqttdata])).toLocaleString("en-US", {minimumFractionDigits: unit_rounding_array[thisElementClass], maximumFractionDigits: unit_rounding_array[thisElementClass], useGrouping: localeStringUseGrouping}) + unit_label_array[thisElementClass]'

When the exception is raised, thisElementClass = lightning_strike_count and unit_rounding_array[‘lightning_strike_count’] = %d. Reading the code, unit_rounding_array is sourced from weewx_data.json.

Any chance that you also started publishing_lightning_strike_count when you started publishing soilMoistN?

Hopefully someone who uses/knows Belchertown can tell you how weewx_data.json is created. If not, I’d stop publishing lightning_strike_count (and any other observations with non-numeric values in weewx_data.json) and see if that helps.
rich

Stefan Gliessmann

unread,
Oct 11, 2023, 5:47:37 AM10/11/23
to weewx...@googlegroups.com
Oh My God!
THANK YOU!

lightning_distance, lightning_strike_count
are published since I added the lightning sensor in August 2023.

However, I added lightning_distance & lightning_strike_count in the weewx.conf Belchertown stanza the same time as I added graph.conf for the soil moisture sensors.

#            station_observations = inTemp, inHumidity, outHumidity, barometer, dewpoint, rainWithRainRate, radiation, lightning_distance, lightning_strike_count

            station_observations = inTemp, inHumidity, outHumidity, barometer, dewpoint, rainWithRainRate, radiation, lightning_distance


Since it showed correctly "0" in the skin, I was not even thinking that this could be the issue.

I just removed it in weewx.conf and now MQTT just works fine again!


Thank you again for your investigation :)


Now, I just have to figure out what continues to wrong with lightning_distance, lightning_strike_count


--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/iQIKvF4_tn0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/9512be5f-2f4b-4d1b-a82a-b5c5d5f3c868n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages