# How STREAM put the I in IoT John Ronan -
--- ## Agenda (Top down) * Background * Orchestration * Monitoring * Consumers * Aggregation * Storage * Collection * Sensing --- ## Backround * https://www.marinestream.eu * ERDF Funded project until the Ireland Wales Programme 2014-2020 * Total Budget of 5.4 Million with a Duration of 4.5 Years * Partners included: * South East Technological University * The Pharmacuetical and Molecular Biotechnology Research Centre * The Walton Institute * Swansea University * The Welsh Centre for Printing and Coating (WCPC) * Centre for Sustainable Aquatic Research * Munster Technological University * Mass Spectrometry Group * Halpin Centere for Research and Innovation at the National Maritime College of Ireland * Three phases to the project * Phase 1 - Deploy State of the Art Sensors * Phase 2 - Deploy Home made sensors * Phase 3 - Deploy Novel Sensors (MEMS Spectroscopy and Printable Ion Sensor probes) --- ## Orchestration
* Everything is version controlled, 60 code repositories and counting. Note: * Infrastructure as Code * Tool for this is Ansible * Makes system easier to deploy and maintain ---- ## Orchestration - Ansible * Ansible - https://docs.ansible.com/ansible/latest/index.html ``` ansible-playbook -i inventory site.yml -l tramore.marinestream.eu --ask-vault-pass ``` ``` PLAY [all] ********************************************************************************** PLAY [all:!localhost] *********************************************************************** TASK [Gathering Facts] ********************************************************************** ok: [tramore.marinestream.eu] TASK [stream_openvpn : Install openvpn package] ********************************************* ok: [tramore.marinestream.eu] TASK [stream_openvpn : Enable openvpn service] ********************************************** ok: [tramore.marinestream.eu] TASK [stream_openvpn : Install Config file] ************************************************* ok: [tramore.marinestream.eu] TASK [stream_openvpn : Enable Openvpn to start Stream client in /etc/default/openvpn] ******* ok: [tramore.marinestream.eu] TASK [stream_weewx_deploy : Add in weewx signing key] *************************************** ok: [tramore.marinestream.eu] TASK [stream_weewx_deploy : Download MQTT extension] **************************************** changed: [tramore.marinestream.eu] TASK [stream_weewx_deploy : Install Config file] ******************************************** ok: [tramore.marinestream.eu] TASK [stream_weewx_deploy : install about page] ********************************************* ok: [tramore.marinestream.eu] TASK [stream_weewx_deploy : Copy in Stream Logo] ******************************************** ok: [tramore.marinestream.eu] TASK [stream_weewx_deploy : Copy in Custom CSS] ********************************************* ok: [tramore.marinestream.eu] TASK [stream_weewx_deploy : Enable and Start weewx service] ******************************** ok: [tramore.marinestream.eu] TASK [stream_mosquitto_bridge : Install mosquitto, mosquitto-clients and python3-paho-mqtt] * ok: [tramore.marinestream.eu] TASK [stream_mosquitto_bridge : Install CA file] ******************************************** ok: [tramore.marinestream.eu] TASK [stream_mosquitto_bridge : Install mosquitto config file] ****************************** changed: [tramore.marinestream.eu] RUNNING HANDLER [stream_mosquitto_bridge : Restart mosquitto] ******************************* changed: [tramore.marinestream.eu] PLAY RECAP ******************************************************************************************************* tramore.marinestream.eu : ok=71 changed=7 unreachable=0 failed=0 skipped=11 rescued=0 ignored=0 ``` --- ## Monitoring - Hosts
---- ## Monitoring - Applications
---- ## Overall Architecture
Note: Monitor hardware, virtual machines and also data gathering processes --- ## Consumers (Applications) * Manufacturer Specific * Xylem - HydroSphere * In-SitU - HydraVu * STREAM * Grafana * Dashboard * CSV * MQTT * Weather Station Specific (All Push) * WOW, CWOP, PWSWeather, WindGuru etc. Note: * Consumers are stakeholders, the public, and other applications/organisations ---- #### Exo2's Sonde and Hydrosphere
---- ### HydroVu
---- #### CSV
* Sonde Data Ireland -> Archives ---- ### MQTT ``` mosquitto_sub -h data1.marinestream.eu -p 1884 -t RSHydro/# -u USER -P PASSWORD -v ``` ``` sysadmin@data2:~$ mosquitto_sub -h data2.marinestream.eu -p 1884 -t RSHydro/# -u transec -P fA6uQcoMdjT6ud -i testb -v RSHydro/status Running RSHydro/op55219/data {"Datestring": "2023-04-26T12:24:48+00:00", "Battery": NaN, "Cable Power": NaN, "CDOM TempCorr.": NaN, "Chlorophyll-A": NaN, "Counter 1": NaN, "DOC": NaN, "External Volts": NaN, "HDO ": NaN, "mAh Adjusted": NaN, "pH": NaN, "pH m/V": NaN, "Proteus S/N 12215244": NaN, "Proteus S/N 12215244.1": NaN, "Signal": 26, "Spare node": NaN, "Spare node.1": NaN, "SpCond.": NaN, "Temperature": NaN, "TOC": NaN, "Turbidity": NaN, "location": "360_Aquaculture", "latitude": "51.610889", "longitude": "-3.915065"} RSHydro/status Sleeping RSHydro/status/uptime 22 days, 3:46:37.591255 RSHydro/status/loop 8567 ``` ---- #### Others
--- ### Aggregation Layer (Software Components) * Haproxy/Keepalived * High Availability/Redundancy * Apache * Websockets converts to MQTT * External API's * Direct to Influx * Met Eireann * Via MQTT * Hydrosphere * RS-Hydro * HydroVu * MQTT * Raspberry Pi Weather Stations * WeeWX * Arduinos * Nutrient Sensors, Thermistor Strings --- ### Storage Layer * influxdb * Open Source Time Series database * influxdb-relay * Buffers writes to actual influx
#### How much data? ##### As of March 20, 2024, approximately 3 millon rows of data, using about 680MB of HD space per server. --- ## Raspberry Pi (Collection Layer) * Powered over USB, 2.5A @5Volts (approximately 12 Watts) * Fully Functional General Purpose Computer * €88 (including PSU/Case/MicroSD Card) * Has built in Ethernet and Wifi
---- ## Arduino (Collection Layer) * Powered over USB or Dedicated Pins, 190mA @3.3Volts (approximately 1 Watts) * Microcontroller. NOT General purpose * Has to be specifically programmed for each task * STREAM has programmed them for specific purposes * i.e. Temperature/Nitrite/Nitrate/Ammonia/Ph * €80 (including CAT1/NB1 Modem) * Needs PSU, Antenna, Box and SIM Card to operate
--- ## Sensor Layer - Weather Stations
Note: * Arduino's * Radar ---- ## Sensor Layer - STREAM
Note: * Nutrient Sensor for saline and freshwater system * Cloud connected with edge processing * Energy harvested with battery backup ---- ## Sensor Locations (as of March 20th 2024) * Wexford Quay * Weather Station, EXO2 and Opus * Wellington Bridge * EXO2 and Opus, STREAM - Nitrate and CDOM * Dungarvan Harbour * Aquatroll - Weather Station (Faha) * Bannow Bay * Aquatroll * 360 Aquaculture Swansea Bay * RSHydro * Tawe Lock * RSHydro * Waterford Pontoon & Dunmore East Pontoon * Libelium * Tramore * Weather Station * Castletownbere * EXO2 and Weather Station * Kilmore Quay * Weather Station under test (Davis VP Pro) * New Ross * planned EXO2, STREAM - Nitrate and CDOM and Weather Station --- ## Thank you and any Questions?
### Special Thanks * STREAM Team at SETU/SU/MTU, Breda Curran (Project Officer at Southern Regional Assembly), Cristíona Innseadúin (Finance Office SETU), Brendan Cooney (Wexford County Council), Brian O’Loan (BIM), Shane Begley (National Fisheries College). David Millard (BIM), Deidre Lane (DAFM), SBS Shellfish Bannow Bay, Robert Wilkes (EPA), Geoff Robinson (BIM), Dave Clarke (Marine Institute), Jonathan Kelly (Marine Institute), Tramore Coast Guard Unit, Waterford City River Rescue, Eoin Murray (Aquamonitrix), Donal O’Sullivan (Carl-Stuart), Tom Stone (In-Situ), DSF Oysters Dungarvan, Damien Duffy (Thinglabs) --- # Backup Slides ---- ## Weather Stations Hardware (Sensor Layer) ### STREAM Requirements * Temperature accuracy of 0.1C or better (0.3C) * Humidity accuracy to 1% or better * Capable of reading barometric pressure between 900 and 1100hPa * Accuracy to 0.5hPa or better (1hPa) * Resolution to 0.1hPa or better between -20C and +40C * Wind speed resolution better than 1km/h * Wind direction resolution to 1 degree azimuth or better (3deg accuracy) * Rainfall measurment of 0.2mm or better * Operational between -20 and +40C * Capable of measuring wind gusts up to 200kph * Selectable reporting intervals * Low power consumption (<50ma @12Vdc) * Flexible choice of internet connectivity options Note: * Annex 1.E in WMO-No.8 from https://library.wmo.int/doc_num.php?explnum_id=3719 Leroy, Michel, 2013: Sustained Performance Classification for Surface Observing Stations on Land. Draft Version 29.1.2013. CIMO/WMO. * Tipping bucket is WMO Certified * Looked at past records for Ireland * Isobars on map * Why do we care? * Large Rainfall leads to nutrient runoff, crop kills. * Lack of Rainfall leads to high salinity ---- ### Gill Metpak Pro * Temperature - 0.2K @ -35C to +70C - Fully * I had 0.1K in my requirements * Humidity - 1% - Fully * +/- 0.5hPa @ 0-50C - Compliant (0.15hPa) * 0.1hPa or better between -20C and +40C * Wind speed 0.01m/s - Fully (up to 216km/h) * Wind direction - 1 degree - Fully * Rainfall - ARG Rain Gauge 99% Accurate up to 120mm/hr * Operational - betweeen -25 to +70 * Reporting intervals - polled or continuous * Power < 70ma @12Vdc) * Connectivity options (RS232/RS485/SDI-12/Modbus) ---- ### Dungarvan (Faha)
---- ### Wexford
---- ### Testing
Note: * First weather station was 'on the bench for a few months' (Now in Dungarvan) * Tipping cup WMO Certified for 0.198mm per tip * Ultrasonic Anemometer ---- ### Connectivity (Physical) * Weather Stations * Netlabs * Connected via Ethernet to SETU Network * Dungarvan * Connectivity via Ethernet to 4G Modem * Tramore * Connectivity via UHF Radio Link/Ethernet to VDSL Router (Eircom) * Castletownbere * Connectivity via Ethernet to VDSL Router (Eircom) * Arduino/Libelium * All sites via 4G * SIM Cards from Thinglabs.ie ---- ### Connectivity (Data transmission) * Weather Stations * MQTTS to data.marinestream.eu * TCP to cwop * HTTP to WOW * HTTP to PWSWeather * HTTP to WindGuru * HTTP to OpenWeatherMap * Arduino * MQTTS to data.marinestream.eu ---- ## Weather Station Software ### Weewx * Global Weather Observation Website support * Global Citizens Weather Observation Program support * Windguru, PWSWeather and many others * MQTT Support * MQ Telemetry Telegram * Lightweight open messaging protocol for resource-constrained clients
Note: MQTT Plugin sealed the deal.. allows for Quality of Service ---- ## Summary * Each deployment poses unique challenges * MQTT is useful as a common lingua franca * Infrastructure requires ongoing maintenance ---- ### Davis Vantage Pro 2 * Temperature - 0.1K @ -40C to +65C - Fully * I had 0.1K in my requirements * Humidity - 2% * +/- 1hPa @25C * Wind speed 1km/h - Fully (up to 322km/h) * Wind direction - 3 degrees * Rainfall - +/5% up to 250mm/hr (0.1mm/tip) * Operational - betweeen -40 to +70 * Reporting intervals - best case every 3 seconds (Wireless sensor tx rate) * Power < 30mA (+0.7mA per Wireless Sensor) * Connectivity options (RS232 over USB) ---- ## Stream Base
Note: * High Availability Cluster * Investigated MYSQL, Mongo, Timescale and Influxdb * Had issues implementing Timescale * Dual Influx Databases * Two physically discinct machines on Leaf/Spine Architecture * Currently three Weather Stations deployed, 4th to be done shortly ---- ## Grafana & Dashboard
Note: * Not HA themselves, but can be rebuilt ---- ## Exo2 data sondes & Libeliums
Note: Sondes send to Hydrosphere over 4G Hydrosphere exports to 'import' every 15 minutes Separate machine to reduce security risk ---- ## Libeliums - theory vs practice
Note: October 2020 December 2020 ---- ## Libeliums - reality
Note: Feb 2021 Nov 2021 ---- ### Development
Note: Simply it enables weewx to grab the data from the weather station. Gill had plenty documentation and were very helpful when answering our questions ---- ## END