Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
naiades-platform-poc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
naiades
naiades-platform-poc
Commits
43842549
Commit
43842549
authored
Nov 19, 2020
by
Federico Sismondi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'weather-station' into 'master'
Weather station See merge request
!16
parents
f84c816a
53abfe01
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
314 additions
and
10 deletions
+314
-10
.env
.env
+1
-0
dca-carouge-watering/app.py
dca-carouge-watering/app.py
+10
-10
dca-carouge-weather-station/Dockerfile
dca-carouge-weather-station/Dockerfile
+9
-0
dca-carouge-weather-station/raw_data/README.md
dca-carouge-weather-station/raw_data/README.md
+0
-0
dca-carouge-weather-station/ydocDataCollector.cfg
dca-carouge-weather-station/ydocDataCollector.cfg
+24
-0
dca-carouge-weather-station/ydocDataCollector.jar
dca-carouge-weather-station/ydocDataCollector.jar
+0
-0
dca-carouge-weather-station/ydocDataCollector.lst
dca-carouge-weather-station/ydocDataCollector.lst
+0
-0
docker-compose.dca.yml
docker-compose.dca.yml
+242
-0
docker-compose.yml
docker-compose.yml
+28
-0
No files found.
.env
View file @
43842549
# Orion variables
ORION_PORT=1026
ORION_VERSION=latest
ORION=5.53.108.182
# MongoDB variables
MONGO_DB_PORT=27017
...
...
dca-carouge-watering/app.py
View file @
43842549
...
...
@@ -374,16 +374,16 @@ def post_dca_carouge_watering_sensed_data_payload():
resp
=
{}
resp
.
update
({
"fs_dump"
:
_dump_raw_data_to_filesystem
()})
resp
.
update
({
"update_flowerbed_entities"
:
_update_flowerbed_entity
(
soil_humidity
,
sensor_eui
)})
resp
.
update
({
"update_device_entities"
:
_update_device_entity
(
deveui
=
request
.
json
[
'deveui'
],
comment
=
None
,
longitude
=
None
,
latitude
=
None
,
last_reception
=
None
,
dataFrame
=
request
.
json
[
'dataFrame'
],
dataFrame_rssi
=
request
.
json
[
'rssi'
],
dataFrame_timestamp
=
request
.
json
[
'timestamp'
]
)})
#
resp.update({"update_device_entities": _update_device_entity(
#
deveui=request.json['deveui'],
#
comment=None,
#
longitude=None,
#
latitude=None,
#
last_reception=None,
#
dataFrame=request.json['dataFrame'],
#
dataFrame_rssi=request.json['rssi'],
#
dataFrame_timestamp=request.json['timestamp']
#
)})
return
resp
...
...
dca-carouge-weather-station/Dockerfile
0 → 100644
View file @
43842549
FROM
openjdk:8-jdk-alpine
# cd /usr/local/runme
WORKDIR
/code
# copy target/find-links.jar /usr/local/runme/app.jar
COPY
* /code/
ENTRYPOINT
["java","-jar","ydocDataCollector.jar"]
dca-carouge-weather-station/raw_data/README.md
0 → 100644
View file @
43842549
dca-carouge-weather-station/ydocDataCollector.cfg
0 → 100644
View file @
43842549
#YDOC-collector configuration properties
#The TCPcollector should listen at port (0=disable):
TCP-port=21
#The UDPcollector should listen at port (0=disable):
UDP-port=0
#Log files & pictures should be stored in output folder:
Output-folder=raw_data
#Folder for configurations files to be synchronized with the corresponding data logger(s):
ConfigTransfer-path=ConfigTransfer
#User name and password of main user:
User=naiades-weather-station
Password=laikmwoadkjh!!{}1d
#ydocTerminal secure tunnel access token (make empty to disable):
TunnelToken=Ta9acjkn2dd
#Additional users can be added with a property starting with the text User-
#User-XYZ=<user name>;<user password>;<optional output path>
User-You=YourName;6562494f;output
dca-carouge-weather-station/ydocDataCollector.jar
0 → 100644
View file @
43842549
File added
dca-carouge-weather-station/ydocDataCollector.lst
0 → 100644
View file @
43842549
docker-compose.dca.yml
0 → 100755
View file @
43842549
# - + - + - + - + - + - + - + - + - + - + - + - + - +
# NAIADES IoT Platform and services #
# - + - + - + - + - + - + - + - + - + - + - + - + - +
# - + - + - + - + - + - + - + - + - + - + - + - + - +
# Notes #
# - + - + - + - + - + - + - + - + - + - + - + - + - +
# ToDoS for PROD
# ==============
# - include let's encrypt in nginx
# - platform's FQDM ?
# - all services requests must pass through nginx
# - change secrets
#
# Authored by UDGA in the context of NAIADES E.U. PROJECT
#
# Received contributions from
# ---------------------------
# - ?
#
# inspired by https://smartsdk.github.io/smartsdk-recipes/
#
# PRODUCTION ToDOs
# ----------------
# - include let's encrypt in nginx
# - platform's FQDM ?
# - all services requests must pass through nginx
#
#
#
# DEPLOYMENT NOTES:
# -----------------
#
# About Docker Volumes:
# ---------------------
#
# A data volume is a specially-designated directory within one or more containers that bypasses the Union File System.
# Data volumes provide several useful features for persistent or shared data:
#
# - Volumes are initialized when a container is created.
# If the container’s base image contains data at the specified mount point,
# that existing data is copied into the new volume upon volume
# initialization.
# (Note that this does not apply when mounting a host
# directory.)
#
# - Data volumes can be shared and reused among containers.
#
# - Changes to a data volume are made directly.
#
# - Changes to a data volume will not be included when you update an image.
# Data volumes persist even if the container itself is deleted.
#
# Into Dockerfile you can specify only destination of volume inside container. e.g. /usr/src/app.
# You may but -not necessary needed- specify mounting point (/opt) in host machine.
# Using the CLI that is `docker run --volume=/opt:/usr/src/app my_image`
# If you not specify --volume argument then mount point will be chosen automatically
#
version
:
"
3.5"
services
:
# - + - + - + - + - + - + - + - + - + - + - + - + - +
# Reverse-proxy #
# - + - + - + - + - + - + - + - + - + - + - + - + - +
# Reverse-proxy (entrypoint)
nginx
:
image
:
nginx:latest
container_name
:
nginx
networks
:
default
:
ipv4_address
:
172.18.2.250
volumes
:
#- ${PWD}/nginx/error.log:/var/log/nginx/error.log:rw
-
${PWD}/nginx/conf.d/:/etc/nginx/conf.d/
-
${PWD}/nginx/cache/:/var/www/nginx/cache/
-
${PWD}/nginx/logs/:/var/log/nginx/:rw
-
${PWD}/nginx/nginx.conf:/etc/nginx/nginx.conf:rw
-
${PWD}/nginx/htpasswd/:/etc/nginx/htpasswd/:rw
#- /etc/letsencrypt/:/etc/letsencrypt/
ports
:
-
80:80
-
443:443
depends_on
:
-
dca-carouge-watering
-
dca-carouge-fountain
-
dca-carouge-weather
-
dca-carouge-weather-station
command
:
[
nginx-debug
,
'
-g'
,
'
daemon
off;'
]
# THIS IS FOR DEBUG ONLY! DO NOT USE IN PROD!
# - + - + - + - + - + - + - + - + - + - + - + - + - +
# DCA services #
# - + - + - + - + - + - + - + - + - + - + - + - + - +
dca-carouge-weather
:
build
:
context
:
./dca-carouge-weather
dockerfile
:
Dockerfile
image
:
dca-carouge-weather:latest
container_name
:
dca-carouge-weather
environment
:
-
LC_ALL=C.UTF-8
-
LANG=C.UTF-8
-
POST_DATA_PERIOD=900
#15mins
-
ORION_HOST=${ORION}
-
COLLECTION_DIR=/code/raw_data
volumes
:
-
./dca-carouge-weather:/code:rw
networks
:
default
:
ipv4_address
:
172.18.2.15
command
:
./weather_00_collect_raw_weather_data_carouge.py
# no sensors, only 3rd party data for the moment
# healthcheck:
# test: curl --fail -s http://dca-carouge-weather:${WMS_MODULE_PORT}/healthcheck || exit 1
# start_period: 40s
# interval: 15m00s
# timeout: 10s
# retries: 3
dca-carouge-watering
:
build
:
context
:
./dca-carouge-watering
dockerfile
:
Dockerfile
image
:
dca-carouge-watering:latest
container_name
:
dca-carouge-watering
environment
:
-
LC_ALL=C.UTF-8
-
LANG=C.UTF-8
-
FLASK_ENV=development
-
FLASK_DEBUG=1
-
FLASK_RUN_PORT=80
-
COLLECTION_DIR=/code/raw_data
-
ORION_HOST=${ORION}
-
LORA_PLATFORM_SECRET_FILE=/run/secrets/lora_platform_auth_header
-
LORA_PLATFORM_URL=https://lora-ns.sig-ge.ch:443
secrets
:
-
lora_platform_auth_header
expose
:
-
80
volumes
:
-
./dca-carouge-watering:/code
networks
:
default
:
ipv4_address
:
172.18.2.14
healthcheck
:
test
:
curl --fail -s http://dca-carouge-watering/healthcheck || exit
1
start_period
:
30s
interval
:
5m00s
timeout
:
10s
retries
:
3
dca-carouge-fountain
:
build
:
context
:
./dca-carouge-fountain
dockerfile
:
Dockerfile
image
:
dca-carouge-fountain:latest
container_name
:
dca-carouge-fountain
environment
:
-
LC_ALL=C.UTF-8
-
LANG=C.UTF-8
-
FLASK_ENV=development
-
FLASK_DEBUG=1
-
FLASK_RUN_PORT=80
-
COLLECTION_DIR=/code/raw_data
-
ORION_HOST=${ORION}
-
LORA_PLATFORM_SECRET_FILE=/run/secrets/lora_platform_auth_header
-
LORA_PLATFORM_URL=https://eu.saas.orbiwise.com:443
secrets
:
-
lora_platform_auth_header
expose
:
-
80
volumes
:
-
./dca-carouge-fountain:/code
networks
:
default
:
ipv4_address
:
172.18.2.16
healthcheck
:
test
:
curl --fail -s http://dca-carouge-fountain/healthcheck || exit
1
start_period
:
30s
interval
:
5m00s
timeout
:
10s
retries
:
3
dca-carouge-weather-station
:
build
:
context
:
./dca-carouge-weather-station
dockerfile
:
Dockerfile
image
:
dca-carouge-weather-station:latest
container_name
:
dca-carouge-weather-station
environment
:
-
LC_ALL=C.UTF-8
-
LANG=C.UTF-8
-
COLLECTION_DIR=/code/raw_data
-
ORION_HOST=${ORION}
expose
:
-
21
ports
:
-
21:21
volumes
:
-
./dca-carouge-weather-station:/code
networks
:
default
:
ipv4_address
:
172.18.2.17
# healthcheck:
# test: curl --fail -s http://dca-carouge-fountain/healthcheck || exit 1
# start_period: 30s
# interval: 5m00s
# timeout: 10s
# retries: 3
# - + - + - + - + - + - + - + - + - + - + - + - + - +
# Docker configs #
# - + - + - + - + - + - + - + - + - + - + - + - + - +
networks
:
default
:
driver
:
bridge
driver_opts
:
com.docker.network.driver.mtu
:
1450
com.docker.network.bridge.name
:
naiades-network
ipam
:
config
:
-
subnet
:
172.18.2.0/24
volumes
:
mysql-db
:
~
mongo-db
:
~
crate-storage
:
~
secrets
:
db_password
:
file
:
secrets
lora_platform_auth_header
:
file
:
secret_carouge_lora
docker-compose.yml
View file @
43842549
...
...
@@ -421,6 +421,34 @@ services:
timeout
:
10s
retries
:
3
dca-carouge-weather-station
:
build
:
context
:
./dca-carouge-weather-station
dockerfile
:
Dockerfile
image
:
dca-carouge-weather-station:latest
container_name
:
dca-carouge-weather-station
environment
:
-
LC_ALL=C.UTF-8
-
LANG=C.UTF-8
-
FLASK_ENV=development
-
FLASK_DEBUG=1
-
FLASK_RUN_PORT=80
-
COLLECTION_DIR=/code/raw_data
-
ORION_HOST=orion
ports
:
-
21:21
volumes
:
-
./dca-carouge-weather-station:/code
networks
:
default
:
ipv4_address
:
172.18.1.17
# healthcheck:
# test: curl --fail -s http://dca-carouge-fountain/healthcheck || exit 1
# start_period: 30s
# interval: 5m00s
# timeout: 10s
# retries: 3
# - + - + - + - + - + - + - + - + - + - + - + - + - +
# Docker configs #
# - + - + - + - + - + - + - + - + - + - + - + - + - +
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment