mqtt extention - not all topics send to server

91 views
Skip to first unread message

Gerrit Otto

unread,
Apr 18, 2020, 8:32:46 AM4/18/20
to weewx-user
I have an ecowitt weather, interceptor and mqtt extention to send messages to mosquito.

I have 5 moisture sensors connected to ecowitt. The issue I am facing is that it seems the mqtt extention is only send 4 out of the 5 moisture sencors to mosquito.

The interceptor is receiving the data from the ecowitt and can see that in the logs. The mosquito logs does not have an entry for the specific message received.

I am not sure where to track the mqtt extention logs - the only log entry in weewx.log is: 
restx: MQTT: Published record 2020-04-18 16:25:00 +04 (1587212700)


Messages send to mosquite and what I can see in logs and client is:
weather/soilMoist1_centibar
weather/soilMoist2_centibar
weather/soilMoist3_centibar
weather/soilMoist4_centibar

However the below message is missing and not send from weewx to mosquito:
weather/soilMoist5_centibar

Some help will be appreciated.

Gerrit


Gerrit Otto

unread,
Apr 18, 2020, 10:14:57 AM4/18/20
to weewx-user
UPDATE: I have noticed the required tables is not created in the sqlite database. The interceptor is capturing the data but seems not stored in database:

Apr 18 18:10:38 gerrithome-ZBOX weewx[28509]: interceptor: MainThread: raw packet: {'solar_radiation': 37.88, 'dateTime': 1587219037, 'humidity_in': 65.0, 'temperature_out': 79.2, 'usUnits': 1, 'soil_battery_1': 1.6, 'soil_battery_2': 1.5, 'soil_battery_3': 1.6, 'soil_battery_4': 1.5, 'soil_battery_6': 1.6, 'pressure': 29.819, 'wind_dir': 224.0, 'wind_speed': 3.36, 'temperature_in': 76.3, 'wind_gust': 8.05, 'humidity_out': 68.0, 'uv': 0.0, 'wh26_battery': 0.0, 'soil_moisture_1': 69.0, 'soil_moisture_2': 50.0, 'soil_moisture_3': 88.0, 'soil_moisture_4': 78.0, 'soil_moisture_6': 61.0}
Apr 18 18:10:38 gerrithome-ZBOX weewx[28509]: interceptor: MainThread: mapped packet: {'soilMoist4': 78.0, 'soilMoist3': 88.0, 'pressure': 29.819, 'outHumidity': 68.0, 'UV': 0.0, 'radiation': 37.88, 'soilMoist1': 69.0, 'dateTime': 1587219037, 'windDir': 224.0, 'outTemp': 79.2, 'windSpeed': 3.36, 'inHumidity': 65.0, 'inTemp': 76.3, 'windGust': 8.05, 'soilMoist2': 50.0, 'usUnits': 1}
Apr 18 18:10:38 gerrithome-ZBOX weewx[28509]: manager: Added record 2020-04-18 18:10:00 +04 (1587219000) to database 'weewx.sdb'
Apr 18 18:10:38 gerrithome-ZBOX weewx[28509]: manager: Added record 2020-04-18 18:10:00 +04 (1587219000) to daily summary in 'weewx.sdb'



The value soil_moisture_6 has no table created in sqlite database.

Any idea? Is it possible to maybe dump and try re-create the database?

Thanks.

gjr80

unread,
Apr 18, 2020, 2:50:46 PM4/18/20
to weewx-user
Hi,

As you have found out your database only includes soilMoist1 to soilMoist4. So the first thing you need to do is extend your schema to include soilMoist5 (or soildMoist6 - your choice), this is covered in the section Adding a new type to the database in the Customization Guide. Note that once you have added your new field to the database you will need to tell WeeWX what unit group your new field belongs to. This is covered in the section Assigning a unit group in the Customization Guide. In your case the unit group you would add your new field to is group_moisture rather than group_energy used in the example. Also, you should place your code that assigns the unit group in extensions.py rather than electricity.py used in the example. You will find extensions.py in /home/weewx/bin/user or /usr/share/weewx/user depending on your WeeWX install type.

Gary

mwall

unread,
Apr 19, 2020, 9:24:19 AM4/19/20
to weewx-user
On Saturday, April 18, 2020 at 10:14:57 AM UTC-4, Gerrit Otto wrote:

The value soil_moisture_6 has no table created in sqlite database.

Any idea? Is it possible to maybe dump and try re-create the database?

if you just want to publish the data using MQTT, then you do not need to add fields to the database.  just configure the weewx-mqtt extension so that it sends LOOP packets.

see the 'binding' option in the weewx-mqtt instructions:


notice that you can bind to loop, archive, or both.  default is archive, which is why you do not see data that do not have corresponding fields in the database.

m

Gerrit Otto

unread,
Apr 23, 2020, 7:56:34 AM4/23/20
to weewx-user
SOLVED: I have followed the extention guide BUT still did not get data into the extended database. Since I am using the interceptor, I also had add mapping configurations in the weewx.conf

[Interceptor]
    # This section is for the network traffic interceptor driver.

    # The driver to use:
    driver = user.interceptor
    device_type = ecowitt-client
    port = 8000

    [[sensor_map_extensions]]
        soilMoist5 = soil_moisture_5

Thanks for the help guys!



On Saturday, 18 April 2020 16:32:46 UTC+4, Gerrit Otto wrote:
Reply all
Reply to author
Forward
0 new messages