morrowwm / weewxMQTT

A driver for weewx which receives data as MQTT topics containing key:value pairs.
23 stars 11 forks source link

Example code #1

Closed Hofstad closed 5 months ago

Hofstad commented 6 years ago

Hello Great project for Weewx. I am trying to build a Arduino that send over Ethernet/Wifi/GSM to weewx and came over your project. But I have som questions.

Is it possible to change the units from US to Metric? Can you show me how a message is sendt from the mosquitto client/device? I was thinking to test with the mosquitto client before I fix my Arduino code. I have tried this one but with no result "mosquitto_pub -t weather - i Arduino-station -u username P password -m HUMT:32" What am I doing wrong? Could you show me an example from your Arduino sketch if you have one?

This is the setting I have set in /etc/weewx/weewx.conf

loop_on_init=true station_type = wxMesh

[wxMesh] host = 127.0.0.1 client = Arduino-station username = username password = password topic = weather driver = user.wxMesh poll_interval = 1

[[label_map]] TIME = dateTime HUMT = outTemp RHUM = outHumidity INTE = inTemp INHU = inHumidity BARP = barometer IRRA = radiation PHOV = supplyVoltage BATV = consBatteryVoltage AMBT = extraTemp1 SYST = extraTemp2

This is the setting I have set in /usr/share/weewx/user/wxMesh.py

where to find the data file

  self.host = stn_dict.get('host', '127.0.0.1')
  self.topic = stn_dict.get('topic', 'weather')
  self.username = stn_dict.get('username', 'username')
  self.password = stn_dict.get('password', 'password')
  self.client_id = stn_dict.get('client', 'Arduino-station') # MQTT client id - adjust $
morrowwm commented 5 months ago

Forgot to work on this. Please re-open if you still have an issue.