LBTO Particle Monitor Software
LASAIR III
This is a portable particle monitor - uses a hose and pumps air inside to measure
samples into 6 buckets -
> 25µm
> 10µm
> 5µm
> 1µm
> 0.5µm
> 0.3µm
On the mountain, unit has a fixed IP of 192.168.18.44 (or
dust-monitor.mountain.lbto.org
)
Running the collection service.
The process taking care of connecting to the LASAIR unit and collecting telemetry data (hdf5) runs as the
lbto_pms systemd service on
linuxapps.
The service is automatically started when the linuxapps server boots up, and can be managed and monitored using standard systemd commands (systemctl):
# systemctl status lbto_pms
● lbto_pms.service - LBTO Lasair Particle Monitoring System startup
Loaded: loaded (/usr/lib/systemd/system/lbto_pms.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2020-07-09 15:33:10 UTC; 13min ago
Main PID: 5504 (partmonitor)
CGroup: /system.slice/lbto_pms.service
└─5504 /home/pms/pms-lasair/partmonitor 192.168.18.44
Jul 09 15:44:03 linuxapps.mountain.lbto.org partmonitor[5504]: read 361 bytes; 1 messages in packet
Jul 09 15:44:03 linuxapps.mountain.lbto.org partmonitor[5504]: processing MSG_DATA ... with 5 sample points
Jul 09 15:44:33 linuxapps.mountain.lbto.org partmonitor[5504]: socket timeout...
Jul 09 15:45:03 linuxapps.mountain.lbto.org partmonitor[5504]: socket timeout...
Jul 09 15:45:33 linuxapps.mountain.lbto.org partmonitor[5504]: socket timeout...
Jul 09 15:46:03 linuxapps.mountain.lbto.org partmonitor[5504]: socket timeout...
Jul 09 15:46:03 linuxapps.mountain.lbto.org partmonitor[5504]: read 361 bytes; 1 messages in packet
Jul 09 15:46:03 linuxapps.mountain.lbto.org partmonitor[5504]: processing MSG_DATA ... with 5 sample points
Jul 09 15:46:33 linuxapps.mountain.lbto.org partmonitor[5504]: socket timeout...
Jul 09 15:47:03 linuxapps.mountain.lbto.org partmonitor[5504]: socket timeout...
The service is provided by the
lbto-pms-lasair-startup RPM:
# rpm -ql lbto-pms-lasair-startup
/usr/lib/systemd/system/lbto_pms.service
Use by Telescope Operators
See Operators/ParticleMonitor
We have a simple, standalone programmatic interface to the Lasair III portable particle monitor that runs on the
linuxapps VM on the mountain. It requires a name or IP address for the monitor, and an optional socket timeout period (defaults to 30 seconds). If 10 timeout periods expire when trying to read data, the program will close the socket down and exit. This takes care of the problem that you cannot control the measuring (on/off) from the web interface or from the instrument itself if the ethernet program is attached to the socket. If you want to shut down the measuring, while the program is running, shutdown the program first (control-C) and then you can stop measuring from the web interface or the instrument console.
Before running the program during instrument measuring, run the
getPMSConfig
program to write the current configuration parameters to a file (
LASAIR.cfg
):
> getPMSConfig dust-monitor
connecting to dust-monitor
Get Instrument Config... Sending PMS_PAKT_MSG_GET_CONFIG_INFO, sized 1024 on socket
read 748 bytes; 1 messages in packet
processing CONFIG_INFO ...
closing socket
The telemetry program should be started
after the instrument has been started measuring. Option 4 will read the measurements from the socket and write the data to the telemetry stream called
pms.lasair
When the measurements stop, the program will eventually time out and shut down. Or the program can be killed with a cntl-C.
> partmonitor dust-monitor 1
using socket timeout of 1 seconds
-------------------------------------------------------------------------
Particle Monitor test program --- connect to particle monitor [y/n] ? y
-------------------------------------------------------------------------
LASAIR Particle Monitor dust-monitor, select option or X to exit :
1) get config info
2) get instrument status
3) reset
4) collect data (after measuring has been started)
5) stop data collection
6) reconnect
7) disconnect
x) Exit
Choice: 4
It reads a local file called
LASAIR.cfg
. This file should be written by the standalone application
getPMSConfig
. During testing, the system would hang if you tried to get configuration data and then listen for message data on the socket. Since the configuration doesn't change often, we decided a separate, standalone app that gets configuration and writes it to a file would be sufficient.
GENERAL config info:
sample pts: 5
family: LasairIII
name: LasairIII_310C
vers: 1.4.002
SN: (null)
cal: (null)
adapter addr: 0 96 166 0 189 250
used flag: 1
addr: 35.245.135.150
SAMPLE 0 config info:
sample pt plus: 0
sample pt type: 0
sw thresh[0]: 0
sizes: 300 500 1000 5000 10000 25000
samp int: 600
max samp int(curr): 8640000
min samp int: 600
max samp int: 8640000
vol units: cf
vol type: 2
volume: 0
vol factor: 100000
flow rate: 1000
disabled: 1
trigger mode: 0
The programs were written from sample programs in the Ethernet Protocol User's Guide. Many options were coded up for testing. But, really all that's needed from the menu is the
4) collect data
option.
From the front panel of the machine, you must go into Comm/Port Setup and in the Network tab, verify that Enable TCP/IP is checked. This starts the machine listening on TCP port 1561 which can be used by the telemetry collection process to retrieve data.
Telemetry
The 6 channels of measuring are not changeable. The sizes are preconfigured in the instrument.
The telemetry stream includes the following fields.
locations_selected_loc |
Only the following locations are recognized: Level 5 Level 6 Level 10 balcony office Room 116 cleanroom flow bench tent |
laser_ok |
Hex number (from pms_flds.h ) : 0x01 - Indicates laser is OK 0x02 - Indicates flow is OK 0x04 - Indicates laser status bit is used 0x08 - Indicates flow status bit is used 0x10 - Indicates that reported DC Light value is DC light, not laser reference 0x20 - Indicates that coincidence problem exists |
sample_interval |
Seconds for this measurement |
volunits_selected_units |
cf for cubic feet cm for cubic meters l for liters or other |
sample_volume |
|
pt_3um_counts |
Number detected particles of 0.3 microns or larger (cumulative) |
pt_5um_count |
Number detected particles of 0.5 microns or larger (cumulative) |
1um_count |
Number detected particles of 1 micron or larger (cumulative) |
5um_count |
Number detected particles of 5 microns or larger (cumulative) |
10um_count |
Number detected particles of 10 microns or larger (cumulative) |
25um_count |
Number detected particles of 25 microns or larger (cumulative) |
Build Details
The source code is in github:
https://github.com/LBTO/pms-lasair
This section needs to be reviewed/revisited
The code needs access to the telemetry library (and therefore Boost) and include files.
The
Makefile
is set up to build in Tucson on
tuc-shell64
and to run on the mountain on
linuxapps
as user
pms
.
Notes
- there's no error checking on arguments to the programs
- haven't seen the units change in configuration, even when I think I'm changing them in the interface
- should add a signal handler to close the socket, but the control-C does not seem to hang the device
- hard-coded paths to tmp and telemetry HDF5 path - these are set up to use the paths on
linuxapps.mountain.lbto.org
Troubleshooting
This sections details the errors and corrective actions taken to write telemetry data. The unit experienced the following issues that prevented writing telemetry data.
- socket timeout
- telemetry exception: Unable to load leap table
- initTelemetry() exception: This singleton has not been initialized
The software supplied by PMS is 32-bit and they do not have 64-bit libaries. Forcing the application to compile on a 64-bit computer and on a 32-bit VM resolved the socket timeout issue. The remaining issues relate to the LBTO telemetry library. Issue 2 was resolved by updating the leap table. The directory structure to the telemtry did not exist so it was created which resolved issue 3.
References
APMON
The APMON takes a snapshot of what lands on a 25 sq cm surface. It can support up to 6 separated wireless sensors. It measures 15 to 1000 µm.
On the mountain, the base unit has a fixed IP of 192.168.18.43 (or
apmon.mountain.lbto.org
)
We have a simple, standalone programmatic interface to the APMON particle monitor. It requires a name or IP address for the monitor, and an optional socket timeout period (defaults to 60 seconds). A simple cntl-C exits the telemetry measuring program.
$ ./partmonitor 150.135.245.89
using default timeout on socket of 60 seconds
-------------------------------------------------------------------------
APMON Particle Monitor telemetry program --- connect to particle monitor [y/n] ? y
-------------------------------------------------------------------------
APMON Particle Monitor 150.135.245.89, select option or X to exit :
1) collect data (after base unit is on and measuring)
2) disconnect
x) Exit
Choice: 1
=== COLLECT DATA
socket timeout...
socket timeout...
socket timeout...
socket timeout...
socket timeout...
read 125 bytes; SO Room 566;00-1A-21-B0-00-00-00-A7;Active;2016-04-26 11:30:05;2;0;1;0;0;0;0;0;0;0;1;0;0;0;0;0;0;0;0;39;3.6;0.1647;1647;OK;
room name: SO Room 566, total particles this measurement: 2
...
Telemetry
The telemetry stream is written as
pms.apmon
and includes the following fields.
15_30_um_counts |
counts measured 15 to 30 microns |
30_40_um_counts |
counts measured 30 to 40 microns |
40_50_um_counts |
counts measured 40 to 50 microns |
50_60_um_counts |
counts measured 50 to 60 microns |
60_70_um_counts |
counts measured 60 to 70 microns |
70_80_um_counts |
counts measured 70 to 80 microns |
80_90_um_counts |
counts measured 80 to 90 microns |
90_100_um_counts |
counts measured 90 to 100 microns |
100_200_um_counts |
counts measured 100 to 200 microns |
200_300_um_counts |
counts measured 200 to 300 microns |
300_400_um_counts |
counts measured 300 to 400 microns |
400_500_um_counts |
counts measured 400 to 500 microns |
500_600_um_counts |
counts measured 500 to 600 microns |
600_700_um_counts |
counts measured 600 to 700 microns |
700_800_um_counts |
counts measured 700 to 800 microns |
800_900_um_counts |
counts measured 800 to 900 microns |
900_1000_um_counts |
counts measured 900 to 1000 microns |
over_1000_um_counts |
counts measured over 1000 microns |
pdr |
particle deposition rate |
pdc |
particle deposition classes |
pac |
percentage area coverage |
ppm |
particle parts per million |
Build Details
The source code is in SVN:
https://svn.lbto.org/view/tools/trunk/pms-apmon/
The code needs access to the telemetry library (and therefore Boost) and include files.
The
Makefile
is set up to build in Tucson on
tuc-shell64
and to run on the mountain on
linuxapps
as user
pms
.
Notes
- hard-coded paths to tmp and telemetry HDF5 path - these are set up to use the paths on
linuxapps.mountain.lbto.org
- there's no error checking on arguments to the programs
References
- www.technologyofsense.com