Airlink
Moderator: Mattk
Re: Airlink
Sensor mapping is as follows:
- particle size 1.0 microns is airX!0pm
- particle size 2.5 microns is airX!1pm
- particle size 10 microns is airX!2pm
where X is the station number: 0 for primary, 1 for 1st additional, etc.
- particle size 1.0 microns is airX!0pm
- particle size 2.5 microns is airX!1pm
- particle size 10 microns is airX!2pm
where X is the station number: 0 for primary, 1 for 1st additional, etc.
- jasonmfarrow
- Gold Boarder
- Posts: 249
- Joined: Mon May 25, 2020 4:21 pm
- Contact:
Re: Airlink
I've modified my script [scripts/aqijmf.plugin] thus (as /bin/sh deals with arrays differently to /bin/bash):
10.10.10.202 is the webserver on the same network as the NanoSD. Files aqi25.data and aqi10.data have just a single txt string: 2.7 or 6.9.
Running the above code as a single command line on the NanoSD terminal (ssh into the Nano as meteobridge@<ip_address>) results in this:
Which is what I would have expected from the script. However this is not working. In the NanoSD logging I see this:
Eventually this stops and also stops the vantage (station 0) logger as well, which is not good. Then the whole collection process restarts.
What am I doing wrong? [NanoSD Mac: B8:D8:12:60:58:FC using defaults].
I've had to remove the User-Defined station so that the connections from the primary station continues.
Code: Select all
#!/bin/sh
#
while true;
do
aqi25=$(wget -qO- http://10.10.10.202/aqi25.data)
echo "air1!1pm $aqi25"
aqi10=$(wget -qO- http://10.10.10.202/aqi10.data)
echo "air1!2pm $aqi10"
sleep 300
done
Running the above code as a single command line on the NanoSD terminal (ssh into the Nano as meteobridge@<ip_address>) results in this:
Code: Select all
root@MeteoBridge:~# aqi25=$(wget -qO- http://10.10.10.202/aqi25.data) && echo "air1!1pm $aqi25"
air1!1pm 2.7
Code: Select all
logger (19.09.2020 18:46:32): connect station 1 (User-defined via Plug-in).
logger (19.09.2020 18:46:32): station 1 (User-defined), unexpected 0 bytes.
logger (19.09.2020 18:46:32): disconnect station 1 (User-defined): response without data
Code: Select all
logger (19.09.2020 18:54:02): connect station 1 (User-defined via Plug-in).
logger (19.09.2020 18:54:02): station 1 (User-defined), no valid signal for 600 seconds, data logger will be restarted.
logger (19.09.2020 18:54:02): disconnect station 0 (Vantage): exit
logger (19.09.2020 18:54:02): disconnect station 1 (User-defined): exit
I've had to remove the User-Defined station so that the connections from the primary station continues.
Re: Airlink
There were some bugs (which I resolved by just released update) and a misunderstanding about how to use the generic sensors.
1) The plugin itself does not know if it is triggered by Meteobridge as station 1, station 2, etc. Therefore, any station information like "2!1" is not making sense here. just the sensor number has to be used.
2) Generic sensors are organized as sensor groups. For example "th" sensors come with temperature and humidity. Therefore, a correct feed for th sensors is "th0 213 34", which means: th sensor with ID 0 reports temperature of 21.3 degrees celsius and relative humidity of 34%.
your feed should look like "air1 100", which tells 10,0 ug/m^3.
sample script:
1) The plugin itself does not know if it is triggered by Meteobridge as station 1, station 2, etc. Therefore, any station information like "2!1" is not making sense here. just the sensor number has to be used.
2) Generic sensors are organized as sensor groups. For example "th" sensors come with temperature and humidity. Therefore, a correct feed for th sensors is "th0 213 34", which means: th sensor with ID 0 reports temperature of 21.3 degrees celsius and relative humidity of 34%.
your feed should look like "air1 100", which tells 10,0 ug/m^3.
sample script:
Code: Select all
#!/bin/sh
#
while true;
do
aqi25=100
echo "air1 $aqi25"
aqi10=50
echo "air2 $aqi10"
sleep 300
done
- jasonmfarrow
- Gold Boarder
- Posts: 249
- Joined: Mon May 25, 2020 4:21 pm
- Contact:
Re: Airlink
I updated the firmware (now on:Meteobridge 4.4 (Sep 20 2020, build 3349), FW 1.4) and the script but it still returns the same - 0 data error message. I even tried hard-coding the values as per your example:
I still see the following error:
What am I missing?
Code: Select all
#!/bin/sh
#
while true;
do
# aqi25=$(wget -qO- http://10.10.10.202/aqi25.data)
aqi25=220
echo "air1 $aqi25"
# aqi10=$(wget -qO- http://10.10.10.202/aqi10.data)
aqi10=660
echo "air2 $aqi10"
sleep 300
done
Code: Select all
logger (20.09.2020 08:54:43): connect station 1 (User-defined via Plug-in).
logger (20.09.2020 08:54:43): station 1 (User-defined), unexpected 0 bytes.
logger (20.09.2020 08:54:43): disconnect station 1 (User-defined): response without data
Re: Airlink
What HW platform are you on?
- jasonmfarrow
- Gold Boarder
- Posts: 249
- Joined: Mon May 25, 2020 4:21 pm
- Contact:
Re: Airlink
Hm, I am a bit out of ideas, what goes wrong here. Could you give me a remote login? THis might speed up the identification of root cause a lot. FAQ in this forum explains how to. I would need URL and password. Please send to info(at)meteobridge.com.
Re: Airlink
Problem with the script was, that it's line ends were terminated with CR+LF. This inhibits execution of the plugin. I change Meteobridge's handling of the plugins, that it removes disturbing CRs first and executing the script then.
- jasonmfarrow
- Gold Boarder
- Posts: 249
- Joined: Mon May 25, 2020 4:21 pm
- Contact:
Re: Airlink
The script did indeed originate on Windows but was subsequently copied to the NanoSd and then edited by a Mac.
For all those that come hereafter the stripping of CRLF will be most efficacious. I now have good data using my preferred script. What I now need to do is go back to Brian and see why the Air1 and Air2 values are not being used by the AirQualityDavisMod.php
For all those that come hereafter the stripping of CRLF will be most efficacious. I now have good data using my preferred script. What I now need to do is go back to Brian and see why the Air1 and Air2 values are not being used by the AirQualityDavisMod.php
Re: Airlink
Much better would be, if you have a look at Brians php scripts, understand how they work and make the changes you need and provide this update to other users. I don't think Brian is keen on adapting his great templates on individual needs from here and there.jasonmfarrow wrote: Sun Sep 20, 2020 5:19 pmWhat I now need to do is go back to Brian and see why the Air1 and Air2 values are not being used by the AirQualityDavisMod.php
- jasonmfarrow
- Gold Boarder
- Posts: 249
- Joined: Mon May 25, 2020 4:21 pm
- Contact:
Re: Airlink
It's alway my intention to integrate with what Brian has already made. He had, with your support, created additional API slots for the Davis Airlink (API_180 for PM1.0, API_181 for PM2.5 and API_182 for PM10).
I was hoping that the variables I used in my used-defined plugin (Air0, Air1, and Air2) were the variables that were exported as Davis Airlink variables. Evidence shows that they are not. Brian has already said that the API is basically full and only these latest API variables, for the Davis Airlink, would be added. Ecowitt and other nice to haves just won't fit in the Weather34 template API.
Not everyone has the spare cash to buy an Airlink. For people who have their own AirQuality metrics (say from a Nova SDS011 sensor) and can present them such that the user-defined plugin can read them, then they should be able to be used in place of the David Airlink variables.
If you can provide the right variable names for input in the plugin that are then exported into Brians API_181 & API_182, then this will immediately integrate without causing further work for Brian.
I was hoping that the variables I used in my used-defined plugin (Air0, Air1, and Air2) were the variables that were exported as Davis Airlink variables. Evidence shows that they are not. Brian has already said that the API is basically full and only these latest API variables, for the Davis Airlink, would be added. Ecowitt and other nice to haves just won't fit in the Weather34 template API.
Not everyone has the spare cash to buy an Airlink. For people who have their own AirQuality metrics (say from a Nova SDS011 sensor) and can present them such that the user-defined plugin can read them, then they should be able to be used in place of the David Airlink variables.
If you can provide the right variable names for input in the plugin that are then exported into Brians API_181 & API_182, then this will immediately integrate without causing further work for Brian.
Re: Airlink
I will have a look into this next week. I think this weekend was enough work on the Meteobridge endeavor and I deserve a free evening with a glass of wine 

- jasonmfarrow
- Gold Boarder
- Posts: 249
- Joined: Mon May 25, 2020 4:21 pm
- Contact:
Re: Airlink
Boris,
Brian told me that to use the additional (user-defined) sensor, as opposed to the official Airlink sensor, I had to change the meteobridge.conf file to use the user-defined air1!1pm and air1!2pm sensor fields in place of air1pm and air2pm default fields.
This is, of course, a temporary fix until my Airlink arrives. It has been very useful to help clarify how the user-defined plugin works and I hope it will be of use to others who may be collecting AQI data and want to integrate as much as possible without causing yourself or Brian additional work.
Cheers.
Brian told me that to use the additional (user-defined) sensor, as opposed to the official Airlink sensor, I had to change the meteobridge.conf file to use the user-defined air1!1pm and air1!2pm sensor fields in place of air1pm and air2pm default fields.
This is, of course, a temporary fix until my Airlink arrives. It has been very useful to help clarify how the user-defined plugin works and I hope it will be of use to others who may be collecting AQI data and want to integrate as much as possible without causing yourself or Brian additional work.
Cheers.