diff --git a/lab02/README.md b/lab02/README.md index 22a8acb2870dc0faa108c20e6a3a6b0963e93ac7..bfb52e865aac0342edd46b35a08f693113544752 100644 --- a/lab02/README.md +++ b/lab02/README.md @@ -31,7 +31,7 @@ with open(path,'r',encoding = 'utf-8') as f: print(f.read()) # read the entire file ``` -## Zadanie (5pkt.): +## Zadanie (6pkt.): DodaÄ obsĹugÄ czujnika BME280 w serwisie MQTT (docker mosquitto z lab.1): - nadawaÄ wiadomoĹci MQTT z ustalonym interwaĹem (np. 5s) w topic 'sensors/bme280/' - aplikacja sensorsBME280.py (1pkt.) @@ -46,7 +46,7 @@ with open(path,'r',encoding = 'utf-8') as f: <img src="lab02/img/ztb_lab2_schem_bme280_button_otherNUC.png" width="240"> -- utwĂłrz aplikacje alarmTemp.py: odczytuj wiadomoĹci z topic 'sensors/bme280', gdy temp>28st to zapal LED wysyĹajÄ c wiadomoĹci na topic 'led/504'),gdy temp.<28st. LED wygaszona, skorzystaj z apliakacji led.py z lab1 (1pkt.) +- utwĂłrz aplikacje alarmTemp.py: odczytuj wiadomoĹci z topic 'sensors/bme280', gdy temp>28st to zapal LED wysyĹajÄ c wiadomoĹci na topic 'led/504'),gdy temp.<28st. LED wygaszona, skorzystaj z apliakacji led.py z lab1 (2pkt.) <img src="lab02/img/ztb_lab2_schem_bme280_alarm.png" width="240"> @@ -79,7 +79,7 @@ docker restart telegraf ```bash docker pull influxdb docker rm influxdb && docker volume rm influxdb -docker create -p 8086:8086 -v influxdb:/var/lib/influxdb --name influxdb:1.7 influxdb +docker create -p 8086:8086 -v influxdb:/var/lib/influxdb --name influxdb influxdb:1.7 docker run --rm \ -e INFLUXDB_DB=sensors -e INFLUXDB_ADMIN_ENABLED=true \ -e INFLUXDB_ADMIN_USER=admin -e INFLUXDB_ADMIN_PASSWORD=ztb123 \ @@ -133,9 +133,9 @@ docker ps  -### Zadania (2pkt.): -- Konfiguracja Grafany w celu wyĹwietlenia danych pomiarowych (1pkt.): +### Zadania (4pkt.): +- Konfiguracja Grafany w celu wyĹwietlenia danych pomiarowych (3pkt.): - Skonfiguruj poĹÄ czenie z bazÄ influx - UtwĂłrz nowy dashboard wyĹwietlajÄ cy temp. -- Skonfiguruj Telegraf w taki sposĂłb, aby pobieraĹ dane pomiarowych MQTT z innych DevNuc - zmodyfikuj (1pkt.) +- Skonfiguruj Telegraf w taki sposĂłb, aby pobieraĹ dane pomiarowe MQTT z innych DevNuc - czÄĹÄ konfiguracji jest zakomentowana w pliku conf (skrĂłt odkomentowania {Ctrl+K}+{Ctrl+C} ) (1pkt.) diff --git a/lab02/telegraf.conf b/lab02/telegraf.conf index 9d50d05d1bd494826b6645e182661aff43567188..0871fe2666b9c6d2f238df022d8846b0cb4aff41 100644 --- a/lab02/telegraf.conf +++ b/lab02/telegraf.conf @@ -102,7 +102,8 @@ # Configuration for sending metrics to InfluxDB -[[outputs.influxdb_v2]] +#[[outputs.influxdb_v2]] +[[outputs.influxdb]] ## The full HTTP or UDP URL for your InfluxDB instance. ## ## Multiple URLs can be specified for a single cluster, only ONE of the @@ -113,11 +114,11 @@ urls = ["http://172.17.0.1:8086"] ## The target database for metrics; will be created as needed. ## For UDP url endpoint database needs to be configured on server side. -#database = "sensors" -organization = "gut" +database = "sensors" +#organization = "gut" ## Destination bucket to write into. -bucket = "sensors" +#bucket = "sensors" ## The value of this tag will be used to determine the database. If this ## tag is not set the 'database' option is used as the default. @@ -129,7 +130,7 @@ bucket = "sensors" ## If true, no CREATE DATABASE queries will be sent. Set to true when using ## Telegraf with a user without permissions to create databases or when the ## database already exists. -#skip_database_creation = true +skip_database_creation = true ## Name of existing retention policy to write to. Empty string writes to ## the default retention policy. Only takes effect when using HTTP. @@ -143,9 +144,9 @@ bucket = "sensors" # timeout = "5s" ## HTTP Basic Auth -#username = "telegraf" -#password = "telegraf" -token= "-Ukwi22XhqPYvXJQibqyOZhT4CDwwg5P3q874lAXTHG7BfOPnomUAFOf66mSTf6r5iaozF2d0SZ6AblTpNK8ZQ==" +username = "telegraf" +password = "telegraf" +#token= "-Ukwi22XhqPYvXJQibqyOZhT4CDwwg5P3q874lAXTHG7BfOPnomUAFOf66mSTf6r5iaozF2d0SZ6AblTpNK8ZQ==" ############################################################################### # INPUT PLUGINS # @@ -179,23 +180,29 @@ token= "-Ukwi22XhqPYvXJQibqyOZhT4CDwwg5P3q874lAXTHG7BfOPnomUAFOf66mSTf6r5iaozF2d # [[inputs.mqtt_consumer]] # # MQTT broker URLs to be used. The format should be scheme://host:port, # # schema can be tcp, ssl, or ws. -# servers = ["tcp://172.17.0.1:1883"] +# #servers = ["tcp://172.17.0.1:1883"] # # Topics that will be subscribed to. # topics = [ # "sensors/#" # ] -# ## The message topic will be stored in a tag specified by this value. If set -# ## to the empty string no topic tag will be created. + +# # The message topic will be stored in a tag specified by this value. If set +# # to the empty string no topic tag will be created. # topic_tag = "topic" -# ## QoS policy for messages -# ## 0 = at most once -# ## 1 = at least once -# ## 2 = exactly once -# ## + +# # QoS policy for messages +# # 0 = at most once +# # 1 = at least once +# # 2 = exactly once +# # +# # When using a QoS of 1 or 2, you should enable persistent_session to allow +# # resuming unacknowledged messages. # qos = 0 -# ## Connection timeout for initial connection in seconds + +# # Connection timeout for initial connection in seconds # connection_timeout = "30s" + # ## Maximum messages to read from the broker that have not been written by an # ## output. For best throughput set based on the number of metrics within # ## each message and the size of the output's metric_batch_size. @@ -205,17 +212,21 @@ token= "-Ukwi22XhqPYvXJQibqyOZhT4CDwwg5P3q874lAXTHG7BfOPnomUAFOf66mSTf6r5iaozF2d # ## full batch is collected and the write is triggered immediately without # ## waiting until the next flush_interval. # max_undelivered_messages = 1000 + # ## Persistent session disables clearing of the client session on connection. # ## In order for this option to work you must also set client_id to identify # ## the client. To receive messages that arrived while the client is offline, # ## also set the qos option to 1 or 2 and don't forget to also set the QoS when # ## publishing. # persistent_session = false + # ## Data format to consume. # ## Each data format has its own unique set of configuration options, read # ## more about them here: # ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md # data_format = "value" -# # Print all metrics that pass through this filter. -# [[processors.printer]] + + +# Print all metrics that pass through this filter. +[[processors.printer]] diff --git a/lab03/README.md b/lab03/README.md index 4916d8b5892f5b2652586c382e812c15b04e5a5c..8ce3d762293bf06d2a0a8a07f09f5b85ee23fa75 100644 --- a/lab03/README.md +++ b/lab03/README.md @@ -69,8 +69,8 @@ while(True): print("Not find any new tag, wait for next 5 sec...") sleep(1) ``` -### Zadania (5pkt.): +### Zadania (10pkt.): - DodaÄ obsĹugÄ czytnika NFC do MQTT - aplikacja nfcReader.py (topic 'sensors/nfc') (2pkt.) - - ZmieÄ diodÄ zielona LED (GPIO504) na ON (na 5s) kiedy odczyta znanÄ kartÄ NFC, zapal czerownÄ LED (GPIO505) w reakcji na inne karty- aplikacja recvNfc.py odbiera wiadomoĹci z topis 'sensors/nfc' i ustawia diode w topicu 'led/504' oraz 'led/505' (1pkt.) + - ZmieniÄ diodÄ zielona LED (GPIO504) na ON (na 5s) kiedy odczyta znanÄ kartÄ NFC, zapal czerownÄ LED (GPIO505) w reakcji na inne karty- aplikacja recvNfc.py odbiera wiadomoĹci z topic 'sensors/nfc' i ustawia diode w topicu 'led/504' oraz 'led/505' (4pkt.) - j.w wĹÄ czyÄ/wyĹÄ czyÄ diodÄ na innym NUCDevKit (1pkt.) - - wyĹwietliÄ tabele z odczytami UUID NFC kart w grafanie (konfiguracja telegraf.conf oraz dashbord grafany panel "table") (1pkt.) \ No newline at end of file + - wyĹwietliÄ tabele z odczytami UUID NFC kart w grafanie (konfiguracja telegraf.conf oraz dashbord grafany panel "table") (3pkt.)