Unable to pull $current.windDir from DB just reports N/A Any help would be amazing....

49 views
Skip to first unread message

KB3OSP

unread,
Feb 21, 2021, 5:47:46 AM2/21/21
to weewx-user
I'm using a SDR with my weewx setup. I also have aprx running in the background to put the WX on RF.

I thought I had everything working fine but now it seems as it is not putting the current wind direction into the DB.

I have looked at everything that I can think of in trying to fix this.

Cwop packet is:

2021-02-21 02:55:29 CST: KB3OSP-13>APRS,TCPIP*,qAC,CWOP-6:@210855z4114.95N/07924.29W_.../000g000t003r...p000P...b.....h87.weewx-4.4.0-SDR

My aprs packet is:

2021-02-21 02:57:48 CST: KB3OSP-13>APRX29,TCPIP*,qAS,KB3OSP-1:@210855z4114.95N/07924.29W_.../000g000t002r...p...P...b.....h87

Syntax I use to call the value for my aprs packet is:

$current.windDir.format(format_string="_%03d", None_string="_...", add_label=False)

The value I get in index.html is:

<tr> 
  <td class="stats_label">Wind</td> 
  <td class="stats_data">0 mph from    N/A (N/A)</td>
</tr> 

Syntax I use to call the value for html is:

<tr>
  <td class="stats_label">Wind</td>
  <td class="stats_data">$current.windSpeed from $current.windDir ($current.windDir.ordinal_compass)</td>
</tr>

Weewx.conf:

[SDR]
    # This section is for the software-defined radio driver.

    # The driver to use
    driver = user.sdr
    cmd = rtl_433 -M utc -M level -F json
    path = /usr/local/bin/

    [[sensor_map]]
        txBatteryStatus = battery.0FFB.Acurite5n1PacketV2
        windSpeed = wind_speed.0FFB.Acurite5n1PacketV2
        windDir = wind_dir.0FFB.Acurite5n1PacketV2
        outTemp = temperature.0FFB.Acurite5n1PacketV2
        outHumidity = humidity.0FFB.Acurite5n1PacketV2
        rain_total = rain_total.0FFB.Acurite5n1PacketV2

Running Weewx Directly:

LOOP:   2021-02-21 08:57:34 UTC (1613897854) dateTime: 1613897854, maxSolarRad: None, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windDir: None, windSpeed: 0.0
LOOP:   2021-02-21 08:57:34 UTC (1613897854) dateTime: 1613897854, maxSolarRad: None, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windDir: None, windSpeed: 0.0
LOOP:   2021-02-21 08:57:34 UTC (1613897854) dateTime: 1613897854, maxSolarRad: None, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windDir: None, windSpeed: 0.0
LOOP:   2021-02-21 08:57:52 UTC (1613897872) appTemp: -3.801660916116319, cloudbase: 2041.2450764651608, dateTime: 1613897872, dewpoint: 0.012921663553292717, heatindex: 2.5, humidex: 2.5, maxSolarRad: None, outHumidity: 89.0, outTemp: 2.5, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windchill: 2.5, windSpeed: 0.0
LOOP:   2021-02-21 08:57:52 UTC (1613897872) appTemp: -3.801660916116319, cloudbase: 2041.2450764651608, dateTime: 1613897872, dewpoint: 0.012921663553292717, heatindex: 2.5, humidex: 2.5, maxSolarRad: None, outHumidity: 89.0, outTemp: 2.5, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windchill: 2.5, windSpeed: 0.0
LOOP:   2021-02-21 08:57:52 UTC (1613897872) appTemp: -3.801660916116319, cloudbase: 2041.2450764651608, dateTime: 1613897872, dewpoint: 0.012921663553292717, heatindex: 2.5, humidex: 2.5, maxSolarRad: None, outHumidity: 89.0, outTemp: 2.5, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windchill: 2.5, windSpeed: 0.0
LOOP:   2021-02-21 08:58:11 UTC (1613897891) dateTime: 1613897891, maxSolarRad: None, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windDir: None, windSpeed: 0.0
LOOP:   2021-02-21 08:58:11 UTC (1613897891) dateTime: 1613897891, maxSolarRad: None, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windDir: None, windSpeed: 0.0
LOOP:   2021-02-21 08:58:11 UTC (1613897891) dateTime: 1613897891, maxSolarRad: None, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windDir: None, windSpeed: 0.0
LOOP:   2021-02-21 08:58:29 UTC (1613897909) appTemp: -3.801660916116319, cloudbase: 2041.2450764651608, dateTime: 1613897909, dewpoint: 0.012921663553292717, heatindex: 2.5, humidex: 2.5, maxSolarRad: None, outHumidity: 89.0, outTemp: 2.5, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windchill: 2.5, windSpeed: 0.0
LOOP:   2021-02-21 08:58:29 UTC (1613897909) appTemp: -3.801660916116319, cloudbase: 2041.2450764651608, dateTime: 1613897909, dewpoint: 0.012921663553292717, heatindex: 2.5, humidex: 2.5, maxSolarRad: None, outHumidity: 89.0, outTemp: 2.5, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windchill: 2.5, windSpeed: 0.0
LOOP:   2021-02-21 08:58:29 UTC (1613897909) appTemp: -3.801660916116319, cloudbase: 2041.2450764651608, dateTime: 1613897909, dewpoint: 0.012921663553292717, heatindex: 2.5, humidex: 2.5, maxSolarRad: None, outHumidity: 89.0, outTemp: 2.5, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windchill: 2.5, windSpeed: 0.0
LOOP:   2021-02-21 08:58:48 UTC (1613897928) dateTime: 1613897928, maxSolarRad: None, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windDir: None, windSpeed: 0.0
LOOP:   2021-02-21 08:58:48 UTC (1613897928) dateTime: 1613897928, maxSolarRad: None, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windDir: None, windSpeed: 0.0
LOOP:   2021-02-21 08:58:48 UTC (1613897928) dateTime: 1613897928, maxSolarRad: None, rainRate: 0.0, txBatteryStatus: 1, usUnits: 1, windDir: None, windSpeed: 0.0

Syslog with Weewx in debug mode:

Feb 21 08:57:37 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=['{"time" : "2021-02-21 08:57:34", "model" : "Acurite-5n1", "message_type" : 49, "id" : 4091, "channel" : "A", "sequence_num" : 0, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "wind_dir_deg" : 270.000, "rain_in" : 1.030, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.944, "rssi" : -0.120, "snr" : 13.070, "noise" : -13.190}\n', '{"time" : "2021-02-21 08:57:34", "model" : "Acurite-5n1", "message_type" : 49, "id" : 4091, "channel" : "A", "sequence_num" : 1, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "wind_dir_deg" : 270.000, "rain_in" : 1.030, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.944, "rssi" : -0.120, "snr" : 13.070, "noise" : -13.190}\n', '{"time" : "2021-02-21 08:57:34", "model" : "Acurite-5n1", "message_type" : 49, "id" : 4091, "channel" : "A", "sequence_num" : 2, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "wind_dir_deg" : 270.000, "rain_in" : 1.030, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.944, "rssi" : -0.120, "snr" : 13.070, "noise" : -13.190}\n']
Feb 21 08:57:37 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'windDir': 270.0, 'dateTime': 1613897854, 'usUnits': 1}
Feb 21 08:57:37 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'windDir': 270.0, 'dateTime': 1613897854, 'usUnits': 1}
Feb 21 08:57:37 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'windDir': 270.0, 'dateTime': 1613897854, 'usUnits': 1}
Feb 21 08:57:40 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:57:43 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:57:46 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:57:49 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:57:52 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:57:56 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=['{"time" : "2021-02-21 08:57:52", "model" : "Acurite-5n1", "message_type" : 56, "id" : 4091, "channel" : "A", "sequence_num" : 0, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "temperature_F" : 2.500, "humidity" : 89, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.941, "rssi" : -1.826, "snr" : 24.877, "noise" : -26.704}\n', '{"time" : "2021-02-21 08:57:52", "model" : "Acurite-5n1", "message_type" : 56, "id" : 4091, "channel" : "A", "sequence_num" : 1, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "temperature_F" : 2.500, "humidity" : 89, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.941, "rssi" : -1.826, "snr" : 24.877, "noise" : -26.704}\n', '{"time" : "2021-02-21 08:57:52", "model" : "Acurite-5n1", "message_type" : 56, "id" : 4091, "channel" : "A", "sequence_num" : 2, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "temperature_F" : 2.500, "humidity" : 89, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.941, "rssi" : -1.826, "snr" : 24.877, "noise" : -26.704}\n']
Feb 21 08:57:56 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'outTemp': 2.5, 'outHumidity': 89.0, 'dateTime': 1613897872, 'usUnits': 1}
Feb 21 08:57:56 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'outTemp': 2.5, 'outHumidity': 89.0, 'dateTime': 1613897872, 'usUnits': 1}
Feb 21 08:57:56 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'outTemp': 2.5, 'outHumidity': 89.0, 'dateTime': 1613897872, 'usUnits': 1}
Feb 21 08:57:59 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:02 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:05 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:08 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:11 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:14 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=['{"time" : "2021-02-21 08:58:11", "model" : "Acurite-5n1", "message_type" : 49, "id" : 4091, "channel" : "A", "sequence_num" : 0, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "wind_dir_deg" : 270.000, "rain_in" : 1.030, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.945, "rssi" : -2.229, "snr" : 21.786, "noise" : -24.015}\n', '{"time" : "2021-02-21 08:58:11", "model" : "Acurite-5n1", "message_type" : 49, "id" : 4091, "channel" : "A", "sequence_num" : 1, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "wind_dir_deg" : 270.000, "rain_in" : 1.030, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.945, "rssi" : -2.229, "snr" : 21.786, "noise" : -24.015}\n', '{"time" : "2021-02-21 08:58:11", "model" : "Acurite-5n1", "message_type" : 49, "id" : 4091, "channel" : "A", "sequence_num" : 2, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "wind_dir_deg" : 270.000, "rain_in" : 1.030, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.945, "rssi" : -2.229, "snr" : 21.786, "noise" : -24.015}\n']
Feb 21 08:58:14 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'windDir': 270.0, 'dateTime': 1613897891, 'usUnits': 1}
Feb 21 08:58:14 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'windDir': 270.0, 'dateTime': 1613897891, 'usUnits': 1}
Feb 21 08:58:14 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'windDir': 270.0, 'dateTime': 1613897891, 'usUnits': 1}
Feb 21 08:58:17 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:20 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:23 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:26 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:29 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:33 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=['{"time" : "2021-02-21 08:58:29", "model" : "Acurite-5n1", "message_type" : 56, "id" : 4091, "channel" : "A", "sequence_num" : 0, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "temperature_F" : 2.500, "humidity" : 89, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.944, "rssi" : -2.774, "snr" : 20.797, "noise" : -23.571}\n', '{"time" : "2021-02-21 08:58:29", "model" : "Acurite-5n1", "message_type" : 56, "id" : 4091, "channel" : "A", "sequence_num" : 1, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "temperature_F" : 2.500, "humidity" : 89, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.944, "rssi" : -2.774, "snr" : 20.797, "noise" : -23.571}\n', '{"time" : "2021-02-21 08:58:29", "model" : "Acurite-5n1", "message_type" : 56, "id" : 4091, "channel" : "A", "sequence_num" : 2, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "temperature_F" : 2.500, "humidity" : 89, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.944, "rssi" : -2.774, "snr" : 20.797, "noise" : -23.571}\n']
Feb 21 08:58:33 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'outTemp': 2.5, 'outHumidity': 89.0, 'dateTime': 1613897909, 'usUnits': 1}
Feb 21 08:58:33 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'outTemp': 2.5, 'outHumidity': 89.0, 'dateTime': 1613897909, 'usUnits': 1}
Feb 21 08:58:33 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'outTemp': 2.5, 'outHumidity': 89.0, 'dateTime': 1613897909, 'usUnits': 1}
Feb 21 08:58:36 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:39 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:42 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:45 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:48 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=[]
Feb 21 08:58:51 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: lines=['{"time" : "2021-02-21 08:58:48", "model" : "Acurite-5n1", "message_type" : 49, "id" : 4091, "channel" : "A", "sequence_num" : 0, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "wind_dir_deg" : 270.000, "rain_in" : 1.030, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.946, "rssi" : -2.766, "snr" : 24.194, "noise" : -26.959}\n', '{"time" : "2021-02-21 08:58:48", "model" : "Acurite-5n1", "message_type" : 49, "id" : 4091, "channel" : "A", "sequence_num" : 1, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "wind_dir_deg" : 270.000, "rain_in" : 1.030, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.946, "rssi" : -2.766, "snr" : 24.194, "noise" : -26.959}\n', '{"time" : "2021-02-21 08:58:48", "model" : "Acurite-5n1", "message_type" : 49, "id" : 4091, "channel" : "A", "sequence_num" : 2, "battery_ok" : 1, "wind_avg_km_h" : 0.000, "wind_dir_deg" : 270.000, "rain_in" : 1.030, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.946, "rssi" : -2.766, "snr" : 24.194, "noise" : -26.959}\n']
Feb 21 08:58:51 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'windDir': 270.0, 'dateTime': 1613897928, 'usUnits': 1}
Feb 21 08:58:51 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'windDir': 270.0, 'dateTime': 1613897928, 'usUnits': 1}
Feb 21 08:58:51 KB3OSP-APRS-Weather weewx[1398] DEBUG user.sdr: packet={'txBatteryStatus': 1, 'windSpeed': 0.0, 'windDir': 270.0, 'dateTime': 1613897928, 'usUnits': 1}

gjr80

unread,
Feb 21, 2021, 7:23:32 AM2/21/21
to weewx-user
Hi,

The default behaviour of WeeWX is to set windDir = None when windSpeed is zero (the rational being when you have no wind how can you have a wind direction).  windSpeed is zero in all of the packets you show above so that may explain why all of your windDir values are None. That is consistent with what you are seeing in your aprs packets and index.html. Do you have the same result when windSpeed is not 0? If windDir remains None when windSpeed > 0 then you have a problem.

What can you do (assuming windDir picks up when windSpeed is not zero)? If it is really annoying you can override the default behaviour by using the force_null config option or you could live with it, there is no error or you could alter what is displayed in your aprs packets or in index.html when windDir is None.

Gary

KB3OSP

unread,
Feb 21, 2021, 11:35:42 AM2/21/21
to weewx-user
Thanks Gary for the response. 

I was thinking that since the value would change that it should be recoding it. I do understand "how can there be a direction if there is no wind" but if there is no wind why is it changing. Unfortunately it was a bad cut from the syslog to show this. Maybe I should look at changing to km/h instead of mph or maybe knots? Or have a section that would convert it to whatever format I would like to call. 

Jon 

gjr80

unread,
Feb 21, 2021, 3:44:39 PM2/21/21
to weewx-user
Under default operation wind direction is set to None before data is stored in the database so that is why you are seeing no wind direction in the database (when wind speed is zero).

When you say it’s changing I presume you mean in the raw sdr data in the syslog. If wind direction does change, and wind speed remains at zero, it could be there is enough wind to move the wind vane but not rotate the cups, it could be birds, I don’t know. Probably not that easy to coordinate but observing the anemometer when wind direction is changing might help, if there is absolutely no wind or movement of the wind vane that might indicate something amiss internally.

Not sure what you are trying to achieve by changing wind speed units. Changing the wind speed display units will have no effect on the wind direction behaviour, whether force_null is set or not. Not sure if you meant changing the wind speed units in the database but this will similarly have no effect (Note that database units are determined by the unit system in use, either US customary, Metric or MetricWX. The unit system sets numerous units, you cannot just change the wind speed units in isolation. Unless you have good cause to change you are best advised leaving the database unit system as is.) .

Setting force_null as required and formatting the output to suit your requirements is probably the way ahead.  Though to remove any doubt you might want to satisfy yourself that your anemometer is functioning correctly now that you know how WeeWX processes wind speed/direction. 

Gary
Reply all
Reply to author
Forward
0 new messages