Page 1 of 3

AirLink In/Out.

Posted: Fri 24 Sep 2021 10:37 am
by Phil23
Can't be 100% sure this is not my issue, but am seeing unexpected values in the Airlink Reading.

I added a Weatherduino AQM a few days back & I'm seeing identical readings from both it & the real Davis which is outside.

http://weather.inverellit.com/index2.htm
Screenshot 2021-09-24 201948.jpg

Code: Select all

  <tr class="tableseparator_airqual">
    <td colspan="1">Air Quality Index</td>
	<td>In</td>
	<td colspan="2">Out</td>
	<td>In</td>
	<td>Out</td>
  </tr>
  <tr class="td_airqual_data">
    <td>pm2.5 - Now</td>
	<td><#AirLinkPm2p5In></td>
	<td><#AirLinkPm2p5Out></td>
	<td>pm10 - Now</td>
	<td><#AirLinkPm10In></td>
	<td><#AirLinkPm10Out></td>
  </tr>
<tr class="td_airqual_data">
    <td>pm2.5 - 1 Hour Average</td>
    <td><#AirLinkPm2p5_1hrIn></td>
    <td><#AirLinkPm2p5_1hrOut></td>
    <td>pm10 - 1 Hour Average</td>
    <td><#AirLinkPm10_1hrIn></td>
    <td><#AirLinkPm10_1hrOut></td>
  </tr>
<tr class="td_airqual_data">
    <td>pm2.5 - 3 Hour Average</td>
    <td><#AirLinkPm2p5_3hrIn></td>
    <td><#AirLinkPm2p5_3hrOut></td>
    <td>pm10 - 3 Hour Average</td>
    <td><#AirLinkPm10_3hrIn></td>
    <td><#AirLinkPm10_3hrOut></td>
  </tr>
<tr class="td_airqual_data">
    <td>pm2.5 - 24 Hour Average</td>
    <td><#AirLinkPm2p5_24hrIn></td>
    <td><#AirLinkPm2p5_24hrOut></td>
    <td>pm10 - 24 Hour Average</td>
    <td><#AirLinkPm10_24hrIn></td>
    <td><#AirLinkPm10_24hrOut></td>
  </tr>
In the interface....

The Same.

Now scrub all the above, it seems to go deeper.

My original Airlink is on 192.168.59.236. It's set as that under an outdoor device.

I added the Weatherduino in as indoor under 192.168.59.237, but that IP doesn't seem to stick.
The indoor one reverts to 12.168.59.236.

Just tried removing the API key etc (My AirLink is Standalone), but still no change.
If I save the indoor as @ 237 it reverts to 236 after a restart of MX.
Note also Auto discovery is off as both get their assigned IP's from my servers DHCP.

Dashboard shows the same matching data, but I believe the issue is that both are being assigned to the same IP.

Cheers

Phil.

Re: AirLink In/Out.

Posted: Fri 24 Sep 2021 10:56 am
by Phil23
Note also the two JSON strings from each device.

http://192.168.59.236/v1/current_conditions (Airlink)

Code: Select all

{ "data": { "did": "001D0A1001B0", "name": "Inverell", "ts": 1632480500, "conditions": [{ "lsid": 361501, "data_structure_type": 6, "temp": 51.5, "hum": 64.4, "dew_point": 39.9, "wet_bulb": 44.8, "heat_index": 50.8, "pm_1_last": 4, "pm_2p5_last": 5, "pm_10_last": 6, "pm_1": 3.94, "pm_2p5": 5.36, "pm_2p5_last_1_hour": 10.55, "pm_2p5_last_3_hours": 14.94, "pm_2p5_last_24_hours": 4.83, "pm_2p5_nowcast": 12.54, "pm_10": 5.90, "pm_10_last_1_hour": 11.90, "pm_10_last_3_hours": 17.64, "pm_10_last_24_hours": 5.86, "pm_10_nowcast": 14.60, "last_report_time": 1632480500, "pct_pm_data_last_1_hour": 100, "pct_pm_data_last_3_hours": 100, "pct_pm_data_nowcast": 100, "pct_pm_data_last_24_hours": 100 }] }, "error": null }
http://192.168.59.237/v1/current_conditions (WeatherDuino AQM III)

Code: Select all

{"data":{"did":"001D0A100021","name":"Sps30_AQM","ts":1632480539,"conditions":[{"lsid":0,"data_structure_type":6,"temp":84.884,"hum":26.68066,"dew_point":46.85544,"wet_bulb":62.86787,"heat_index":82.41282,"pm_1_last":25.41156,"pm_2p5_last":29.16811,"pm_10_last":31.39828,"pm_1":25.41156,"pm_2p5":29.16811,"pm_2p5_last_1_hour":45.42776,"pm_2p5_last_3_hours":26.84676,"pm_2p5_last_24_hours":290.8557,"pm_2p5_nowcast":85.4,"pm_10":31.39828,"pm_10_last_1_hour":49.46344,"pm_10_last_3_hours":28.54789,"pm_10_last_24_hours":433.9823,"pm_10_nowcast":115.6,"last_report_time":1632480539,"pct_pm_data_last_1_hour":100,"pct_pm_data_last_3_hours":100,"pct_pm_data_nowcast":100,"pct_pm_data_last_24_hours":100}]},"error":0}
Apart from the different readings, lsid is blank in the Durino & the error field reads 0 Vs null.

Edit:-

The Davis JSON is also a bit more padded with spaces than the Durino.

Re: AirLink In/Out.

Posted: Fri 24 Sep 2021 12:39 pm
by Mapantz
I would have thought that only one Airlink can be used with CMX?

The one Airlink is either set as indoors, or outdoors, not 2 separate Airlinks for each.

Re: AirLink In/Out.

Posted: Fri 24 Sep 2021 1:44 pm
by HansR
@Mapantz: Hope you're not serious :groan:

Re: AirLink In/Out.

Posted: Fri 24 Sep 2021 2:47 pm
by Mapantz
HansR wrote: Fri 24 Sep 2021 1:44 pm @Mapantz: Hope you're not serious :groan:
Well, it was a question rather than a statement.

I only have one running, so I don't know..

Re: AirLink In/Out.

Posted: Fri 24 Sep 2021 3:19 pm
by HansR
@Mapantz: Ok. Afaik it is meant to be two distinct airlinks. Otherwise: why would you need to state a primary airlink?

But maybe Mark should shed a light on whats happening here. Interesting detailed find of Phil. He's probably the first to have two airlinks running ;)

Re: AirLink In/Out.

Posted: Fri 24 Sep 2021 5:23 pm
by mcrossley
You can only have one outdoor AirLink, but you can also have another one designated as indoor at the same time.

Please switch on debug logging, restart Cumulus let it run a bit and then post the log file please.

Re: AirLink In/Out.

Posted: Fri 24 Sep 2021 5:26 pm
by mcrossley
The LSID *is* used by CMX, but only for fetching the health data from WeatherLink.com which will not apply to WeatherDuino AQM.

The error code is not currently used by CMX - it probably should be checked though!

Re: AirLink In/Out.

Posted: Fri 24 Sep 2021 8:36 pm
by Phil23
Debug was on, but a bit late to go into it last night.

Issue seem to have come from the host name for the Outside unit being entered in the field for the inside unit.
This is the ini now I've reset it but it appears to change after a restart.

Code: Select all

[AirLink]
WLv2ApiKey=
WLv2ApiSecret=
AutoUpdateIpAddress=0
In-Enabled=1
In-IPAddress=192.168.59.237
In-IsNode=0
In-WLStationId=0
Out-Enabled=1
Out-IPAddress=192.168.59.236
Out-IsNode=0
Out-WLStationId=0
AQIformula=5
In-Hostname=
Out-Hostname=airlink-1001B0
IsWllNode=0

Diags Attached.

Re: AirLink In/Out.

Posted: Fri 24 Sep 2021 8:46 pm
by Phil23
Just restarted CMX after above & ini now reads like this.

Code: Select all

[AirLink]
WLv2ApiKey=
WLv2ApiSecret=
AutoUpdateIpAddress=0
In-Enabled=1
In-IPAddress=192.168.59.236
In-IsNode=0
In-WLStationId=0
Out-Enabled=1
Out-IPAddress=192.168.59.236
Out-IsNode=0
Out-WLStationId=0
AQIformula=5
In-Hostname=airlink-1001B0
Out-Hostname=airlink-1001B0
IsWllNode=0

Seems to all happen around line 130 of diags after startup.

Code: Select all

2021-09-25 06:39:09.355 Extra Sensor = Davis AirLink (Indoor) - stand-alone=True
2021-09-25 06:39:09.410 ZeroConf Service: Attempting to find AirLink via zero-config...
2021-09-25 06:39:09.674 ZeroConf Service: + 'airlink-1001B0' on Ethernet
2021-09-25 06:39:09.675 	Host: airlink-1001B0 (192.168.59.236)
2021-09-25 06:39:09.675 ZeroConfig Service: AirLink found 'airlink-1001B0', reporting its IP address as: 192.168.59.236
2021-09-25 06:39:09.675 ZeroConfig Service: Adding AirLink airlink-1001B0 to list of discovered devices
2021-09-25 06:39:10.420 ZeroConf Service: Discovered a new IP address for the Indoor AirLink that does not match our current one
2021-09-25 06:39:10.420 ZeroConf Service: Changing previous Indoor IP address: 192.168.59.237 to 192.168.59.236
2021-09-25 06:39:10.432 Writing Cumulus.ini file
2021-09-25 06:39:10.438 Completed writing Cumulus.ini file
2021-09-25 06:39:10.438 ZeroConf Service: Auto-discovered AirLink name airlink-1001B0, on IP address 192.168.59.236
2021-09-25 06:39:10.438 Extra Sensor = Davis AirLink (Outdoor) - stand-alone=True
2021-09-25 06:39:10.489 ZeroConf Service: Attempting to find AirLink via zero-config...
2021-09-25 06:39:10.771 ZeroConf Service: + 'airlink-1001B0' on Ethernet
2021-09-25 06:39:10.771 	Host: airlink-1001B0 (192.168.59.236)
2021-09-25 06:39:10.771 ZeroConfig Service: AirLink found 'airlink-1001B0', reporting its IP address as: 192.168.59.236
2021-09-25 06:39:10.771 ZeroConfig Service: Adding AirLink airlink-1001B0 to list of discovered devices
2021-09-25 06:39:11.503 ZeroConf Service: Auto-discovery found the AirLink, reporting its IP address as: 192.168.59.236
Cheers

Phil.

Re: AirLink In/Out.

Posted: Fri 24 Sep 2021 8:55 pm
by Phil23
Other question that now comes to mind is what to do regards the API key.
I've removed it currently as it seems to only reference one Airlink.

Mine is on WLL as a standalone Outdoor Unit, but obviously the AQM III is not designed to register there.
Assume the only parallel with the Real one is the presence of the Local API.

Re: AirLink In/Out.

Posted: Fri 24 Sep 2021 9:02 pm
by Phil23
Tried removing the outdoor Host Name as a work around, but the IP still gets changed on restart.

So it appears that it's the ZeroConf Service that's tripping up.

Code: Select all

2021-09-25 06:57:36.556 Extra Sensor = Davis AirLink (Indoor) - stand-alone=True
2021-09-25 06:57:36.612 ZeroConf Service: Attempting to find AirLink via zero-config...
2021-09-25 06:57:36.855 ZeroConf Service: + 'airlink-1001B0' on Ethernet
2021-09-25 06:57:36.855 	Host: airlink-1001B0 (192.168.59.236)
2021-09-25 06:57:36.855 ZeroConfig Service: AirLink found 'airlink-1001B0', reporting its IP address as: 192.168.59.236
2021-09-25 06:57:36.855 ZeroConfig Service: Adding AirLink airlink-1001B0 to list of discovered devices
2021-09-25 06:57:37.614 ZeroConf Service: Discovered a new IP address for the Indoor AirLink that does not match our current one
2021-09-25 06:57:37.614 ZeroConf Service: Changing previous Indoor IP address: 192.168.59.237 to 192.168.59.236
2021-09-25 06:57:37.625 Writing Cumulus.ini file
2021-09-25 06:57:37.632 Completed writing Cumulus.ini file
2021-09-25 06:57:37.632 ZeroConf Service: Auto-discovered AirLink name airlink-1001B0, on IP address 192.168.59.236
2021-09-25 06:57:37.632 Extra Sensor = Davis AirLink (Outdoor) - stand-alone=True
2021-09-25 06:57:37.679 ZeroConf Service: Attempting to find AirLink via zero-config...
2021-09-25 06:57:37.851 ZeroConf Service: + 'airlink-1001B0' on Ethernet
2021-09-25 06:57:37.851 	Host: airlink-1001B0 (192.168.59.236)
2021-09-25 06:57:37.851 ZeroConfig Service: AirLink found 'airlink-1001B0', reporting its IP address as: 192.168.59.236
2021-09-25 06:57:37.851 ZeroConfig Service: Adding AirLink airlink-1001B0 to list of discovered devices
2021-09-25 06:57:38.687 ZeroConf Service: Auto-discovery found the AirLink, reporting its IP address as: 192.168.59.236
2021-09-25 06:57:38.687 Writing Cumulus.ini file
2021-09-25 06:57:38.689 Completed writing Cumulus.ini file

Re: AirLink In/Out.

Posted: Sat 25 Sep 2021 7:56 am
by mcrossley
I'm out and about today so no access to the code, but I think I know what is happening.

CMX checks on startup if the AirLink's IP address has changed using its zero config (mDNS) service. It does not look like the AQM has implemented this feature.

The MX code could be improved to fix this, but from memory... if MX only gets a single AirLink device responding to zero config it assumes that is the one to use. If more than one device responds, then it checks further details to pick the correct one.

Upshot, I'm pretty sure MX will work with two genuine AirLinks, but the AQM's partial emulation is throwing a spanner in the works.

Re: AirLink In/Out.

Posted: Sat 25 Sep 2021 8:21 am
by Phil23
mcrossley wrote: Sat 25 Sep 2021 7:56 am I'm out and about today so no access to the code, but I think I know what is happening.
No urgency,
It's known is the main thing.
Upshot, I'm pretty sure MX will work with two genuine AirLinks, but the AQM's partial emulation is throwing a spanner in the works.
Maybe best solution is if Auto Discovery is off, IP set in the ini is it, whether it works or not. We don't bother changing anything.

Other Upside of the AQM is it's affordable @ 25 Euro.
Add another $20 Aud for a Sds011 or as I've done another $70 for a Sensirion SPS30.
It all comes out well more affordable than the circa $300 I paid for my real Airlink.

Thanks

Phil

Re: AirLink In/Out.

Posted: Sat 25 Sep 2021 9:08 am
by HansR
I am interested as well because I use my own fake airlink and am going to use the AQM-III as a second AirLink as well.

If I understand it well, running e.g. Avahi on the RPi is good enough to handle the zeroconfig.
So what about asking for the AQM-III to implement a similar service to complete the emulation?

Afaics is is less an issue for CMX than for AQM-III or is Phils point valid?
Maybe best solution is if Auto Discovery is off, IP set in the ini is it, whether it works or not. We don't bother changing anything.