Browse Source

Update 'README.md'

master
PurpleRose 3 years ago
parent
commit
c9a9725a6a
  1. 294
      README.md

294
README.md

@ -1,203 +1,196 @@
# Εργασία για το εργαστήριο IoT
# Project for IoT
![enter image description here](https://i.ibb.co/TPb5Kqq/IMG-20210119-164759.jpg)
Το συγκεκριμένο project υλοποιεί μία μέθοδο επικοινωνίας publish/subscribe χρησιμοποιώντας τον [**RabbitMQ Broker**](https://www.rabbitmq.com/).
Η υλοποίηση αυτή μεταξύ άλλων προσθέτει λειτουργίες όπως, η εγγραφή των ληφθέντων τιμών σε μια βάση με σκοπό την απεικόνισή τους και την αποστολή των ίδιων τιμών σε έναν απομακρυσμένο server για την περαιτέρω επεξεργασία τους.
## Αρχιτεκτονική
Η αρχιτεκτονική χωρίζεται σε 5 μεγάλα κομμάτια :
This project implement a communication method publish/subscribe using [**RabbitMQ Broker**](https://www.rabbitmq.com/).
This implement adds functions as, write of the values receipt to a database in order to represent and to send these same values to a remote server for further procedure.
## Architecture
This architecture is divided into 5 big parts :
1) Τον producer όπου παράγει και στέλνει τις τιμές του αισθητήρα.
1) The producer who produce and send the values to the broker.
2) Τον [**RabbitMQ broker**](https://www.rabbitmq.com/) όπου αποθηκεύει προσωρινά τις τιμές που στέλνει ο producer.
2) The [**RabbitMQ broker**](https://www.rabbitmq.com/) which stores temporarily the values sent by the producer.
3) Τον consumer που καταναλώνει τις αποθηκευμένες απο τον broker τιμές.
3) The consumer which consumes the stored values from the broker.
4) Την βάση και το monitoring tool , όπου αποθηκεύονται και προβάλλονται οι τιμές.
4) The database and the monitoring tool, into which the values stored and projected.
5) Τον απομακρυσμένο server όπου αποστέλλονται οι τιμές για περαιτέρω επεξεργασία.
5) The remote server where the values sent for further procedure.
Πιο συγκεκριμένα η αρχιτεκτονική είναι η εξής:
In particular this architecture is the following:
![Αρχικτορνική](https://i.ibb.co/GWT976v/My-Archit-Final.png)
## Υλικά
![Architecture](https://i.ibb.co/GWT976v/My-Archit-Final.png)
## Components
- Arduino Uno
- TMP36Gz temp sensor
- Raspberry Pi 3
- Desktop PC with Docker
# Στήσιμο του project
# Project Setup
- Κατεβάζουμε το repo απο το site του swarmlab [link](https://git.swarmlab.io:3000/PurpleRose/RabbitMQ_IoT_Project). Έχουμε στα χέρια μας 5 φακέλους, έναν για κάθε κομμάτι που θα πρέπει να στήσουμε.
- Download the repository from the website of swarmlab [link](https://git.swarmlab.io:3000/PurpleRose/RabbitMQ_IoT_Project). Thus, we have handy 5 folders, one per piece we have to setup.
## Αrduino
Ξεκινώντας με το Arduino, θα πρέπει να το συνδέσουμε με τον υπολογιστή μας και μέσο της πλατφόρμας Arduino IDE(αν δεν υπάρχει την κατεβάζουμε και την εγκαθιστούμε [link](https://www.arduino.cc/en/software)) να περάσουμε τον κώδικα που βρίσκεται στο αρχείο **readTempValuesFromArduino.ino** στο Arduino.
Beginning with Arduino, we have to connect it with our computer and the connecting platform Arduino IDE (if not present download and install it) [link](https://www.arduino.cc/en/software)) in order to insatll the code in the file **readTempValuesFromArduino.ino** of Arduino.
![enter image description here](https://i.ibb.co/nk8Fwd5/arduinofinal.png)
Πιθανό πρόβλημα κατά τη μεταφορά του κώδικα στο Arduino:
Possible issue in the code transfer to Arduino:
[can't open device "/dev/ttyUSB0": Perm. denied (Linux permissions)]
Λύση:
Ανοίγουμε το τερματικό του συστήματός μας και πληκτρολογούμε:
Solution:
Open the terminal of the system and type:
sudo chmod ugo+w /dev/ttyUSB0
> Την ίδια εντολή πρέπει να τρέξουμε και στο raspberry όταν θα το
> συνδέσουμε με το Αrduino.
> The same command must be run to the raspberry upon we
> connect to Αrduino.
#### Σύνδεση του αισθητήρα με το Arduino
Όπως φαίνεται και πιο πάνω στην εικόνα της αρχιτεκτονικής, ο αισθητήρας έχει τρία πόδια **(Vcc, Gnd , values).**
Συνδέουμε λοιπόν το μεσαίο πόδι του αισθητήρα με την αναλογική υποδοχή **Α0 (όπως φαίνεται και στον κώδικα)**
για να μπορούμε να παίρνουμε τις τιμές του, το αριστερό του πόδι στη **τάση (Vcc)** και το δεξί του πόδι στη **γείωση (Gnd)**.
**(1)** Με βάση τον κώδικα για το Arduino μπορούμε να αλλάξουμε το **pin** για τις τιμές του αισθητήρα απο **Α0** σε όποια αναλογική επαφή θέλουμε και αντίστοιχα αλλάζουμε και το **pin** στο κώδικα.
**(2)** Αντίστοιχα μπορούμε να αλλάξουμε τη τιμή στη συνάρτηση **delay** με σκοπό την πιο συχνή ή την πιο αραιή δειγματοληψία.
**(3)** Πατάμε το κουμπί για **compile** και αν δεν υπάρχουν λάθοι στο κώδικα...
**(4)** Πατάμε το κουμπί για **upload** στο Arduino.
#### Sensor's Connection to Arduino
As shown in the architecture's picture above, the sensor includes three (3) connections **(Vcc, Gnd, Values).**
We connect the middle connector to the sensor with the analog input **Α0 (as shown in the code)**
for receiving its values, the left connector to the **Current (Vcc)** and the right connector to the **Ground (Gnd)**.
**(1)** Based on the code of Arduino we are able to use the **pin** for the sensor's values from **Α0** in any analog connection and we change the **pin** in the code also.
**(2)** Also, we are able to change the value to the function **delay** in order of the quicker or slower sample receipt.
**(3)** Click the button for **compile**. In the case which no errors occured...
**(4)** Click the button for **upload** to Arduino.
## Raspberry
### Producer
Υλοποιούμε τα βήματα σχετικά με το Raspberry που βρίσκονται [εδώ](http://docs.swarmlab.io/SwarmLab-HowTos/labs/IoT/SensorNode2Server.adoc.html) προκειμένου να έχουμε πρόσβαση στη συσκευή.
Follow the steps concerning Raspberry here [here](http://docs.swarmlab.io/SwarmLab-HowTos/labs/IoT/SensorNode2Server.adoc.html) in order to gain access.
![enter image description here](https://i.ibb.co/Pm3ggFT/rasfinal.png)
Εφόσον είμαστε μέσα στη συσκευή μεταφέρουμε τα αρχεία που κατεβάσαμε απο το **repo** και βρίσκονται μέσα στο φάκελο **MyProducer** (producer.js, package.json).
Στη συνέχεια τρέχουμε την εντολή:
Upon we are in the system we transfer the downloaded files from the **repository** in the folder **MyProducer** (producer.js, package.json).
Then, run the command:
npm install
Για να μας κατεβάσει στη συσκευή όλα τα dependencies που χρειάζεται το script producer.js για να τρέξει σωστά.
Και τέλος τρέχουμε την εντολή:
To download all the dependencies needed to the script producer.js to run normally.
Finally, run the command:
sudo chmod ugo+w /dev/ttyUSB0
Για να μπορεί να στείλει το Arduino δεδομένα μέσο της σειριακής επαφής.
Αν δεν υπάρχει η **ttyUSB0** επαφή για επικοινωνία στο Raspberry τότε τρέχουμε:
In order Arduino to send the data through the serial connection.
If not present the **ttyUSB0** connection then run:
ls /dev/tty*
Για να δούμε όλες τις επαφές του Raspberry και σε ποιά είναι συνδεδεμένο το Arduino.
Επαναλαμβάνουμε την εντολη αλλαγής δικαιωμάτων με τη κατάλληλη επαφή.
To detect all Raspberry connections and into which Arduino is connected.
Repeat the change mode command (chmod) with the appropriate connection.
## Docker
Για να μπορέσουν οι υπόλοιπες υπηρεσίες να τρέχουν θα χρειαστεί να εγκαταστήσουμε το **Docker** και το **Docker Compose** στον τοπικό μας υπολογιστή [link](https://www.docker.com/).
For working the rest of the services need to install **Docker** and the **Docker Compose** to the local computer. [link](https://www.docker.com/).
### Consumer
Κατευθυνόμαστε στο φάκελο MyConsumer και ανοίγουμε ένα τερματικό.
Στη συνέχεια τρέχουμε την εντολή:
In the folder MyConsumer open a terminal computer.
Then, run the command:
docker build -t myconsumer .
Η συγκεκριμένη εντολή θα δημιουργήσει ένα **docker image** το οποίο περιέχει ότι χρειάζεται το script consumer.js για να τρέξει.
Στη συνέχεια μπορούμε να τρέξουμε την εντολή:
This command will create a **docker image** with the info needed to run the script consumer.js.
Then, run the command:
docker run -it -p 5673:5673 myconsumer
Για να σηκώσουμε έναν **container** απο το συγκεκριμένο **image** για την υπηρεσία του **consumer**.
To compose a **container** from the **image** for the **consumer** service.
> Όπως φαίνεται απο την εντολή **run** κάνουμε **expose** τη πόρτα
> **5673** απο τον υπολογιστή μας στην πόρτα **5673** του **container**.
> As shown in the command **run** we **expose** the port
> **5673** from the computer to the port **5673** of the **container**.
Τέλος ελέγχουμε αν ο container τρέχει με την εντολή:
Finally, we check if the container run using the command:
docker ps
### Server
Την ίδια διαδικασία ακολουθούμε και για την υπηρεσία του **server**.
Κατευθυνόμαστε στο φάκελο MyServer και ανοίγουμε ένα τερματικό.
Στη συνέχεια τρέχουμε την εντολή:
We use the same proceduce for the **server**.
We go to the folder MyServer upon we startup a terminal.
Then, we run the command:
docker build -t atticaregionserver .
Η συγκεκριμένη εντολή θα δημιουργήσει ένα **docker image** το οποίο περιέχει ότι χρειάζεται το script server.js για να τρέξει.
Στη συνέχεια μπορούμε να τρέξουμε την εντολή:
This particular command will create a **docker image** with the info needed to run the script server.js.
Then, we run the command:
docker run -it -p 4000:4000 atticaregionserver
Για να σηκώσουμε έναν **container** απο το συγκεκριμένο **image** για την υπηρεσία του **server**.
> Όπως φαίνεται απο την εντολή **run** κάνουμε **expose** τη πόρτα
> **4000** απο τον υπολογιστή μας στην πόρτα **4000** του **container**.
To compose a **container** from the **image** for the **server** service.
> As shown in the command **run** we **expose** the port
> **4000** from the computer to the port **4000** of the **container**.
Τέλος ελέγχουμε αν ο container τρέχει με την εντολή:
Finally, we check if the container run using the command:
docker ps
### RabbitMQ
Η επόμενη υπηρεσία που θα χρειαστούμε είναι ο **RabbitMQ broker**(AMQP).
Απο όλες τις λειτουργίες του **RabbitMQ** (fanout κτλπ) εμείς θα χρησιμοποιήσουμε την **Direct exchange**.
The next needed service is **RabbitMQ broker**(AMQP).
Of its functions **RabbitMQ** (fanout, token routing, etc) we will use the **Direct exchange**.
![enter image description here](https://i.ibb.co/RYp1v6D/rabbitmq-AMQP1.png)
Ξεκινόντας θα πρέπει να κατεβάσουμε το έτοιμο **RabbitMQ** image απο το **docker hub** και να το τρέξουμε με την εντολή:
At the beginning, we have to download the preset **RabbitMQ** image from the **docker hub** to run the command:
docker run -d -p 15672:15672 -p 5672:5672 --name rabbitmq rabbitmq:3-management
Το docker θα κατεβάσει το **image** και θα το τρέξει κάνοντας **expose** τις πόρτες που του είπαμε (**default ports**).
The docker will download the **image** and will run it to **expose** the ports (**default ports**).
> Η πόρτα **15672** είναι για τον **manager** και η πόρτα **5672** είναι
> για τον **broker**.
> The port **15672** is using from the **manager** and the port **5672** is using
> for the **broker**.
Μπορούμε στη συνέχεια να μεταβούμε στη πόρτα του manager(localhost:15672) για να κάνουμε περαιτέρω ρυθμίσεις αν το επιθυμούμε.
Θα μας ζητήσει κάποια στοιχεία, πληκτρολογούμε για **username** και **password** : **guest**
Και είμαστε πλεον μέσα στον **manager**.
Then, we go to the port of the manager(localhost:15672) for further adjustments.
Upon info requst, we type **guest** as **username** and **password**.
Then we have access of the **manager**.
![enter image description here](https://i.ibb.co/mDythTw/rabmenu2.png)
Μπορούμε απο εδώ να κάνουμε **overview** την διαδικασία του **produce** και **consume** βλέποντας τα γραφήματα, τις ταχύτητες **consume** και **produce** στο **tab Queues** , τα **connection** που έχουμε και τα **channels**.
Επιπλέον μπορούμε αν θέλουμε να φτιάξουμε έναν δικό μας χρήστη στο **tab Admin**.
H διαδικασία είναι η εξής:
1) Μεταβένουμε στο tab Admin.
2) Στο **drop down menu Add a User** βάζουμε τα στοιχεία που επιθυμούμε , στην επιλογή **Tag** επιλέγουμε **Admin** και πατάμε το κουμπί **Add User**.
3) Στη συνέχεια επιλέγουμε τον χρήστη που φτιάξαμε και το **panel Set permission**, στην επιλογή **Virtual Host** επιλέγουμε **"/"** ώστε να γίνει **admin** ο χρήστης και πατάμε το κουμπί **Set permission**.
Now, we are able to **overview** the process of **produce** and **consume** using the graphs, the speed of **consume** and **produce** to the **tab Queues** , the **connection** and the **channels**.
Further, we are able to create a new user to the **tab Admin**.
### Grafana & InfluxDB
Σε αυτό το σημείο εκτός απο τα **images** του **Grafana** και της **InfluxDB** θα χρειαστούμε και ένα **δίκτυο** προκειμένου να μπορεί να δει αυτόματα το **Grafana** τη βάση.
Η δομή που θέλουμε να πετύχουμε είναι η παρακάτω:
At this point, except of the **images** of **Grafana** and of **InfluxDB** we will need a **network** in order **Grafana** to automatically detect the database.
The structure we will use to obtain it is the following:
![enter image description here](https://i.ibb.co/Q6KJJLg/grafarchi.png)
Για να πετύχουμε την παραπάνω δομή δημιουργούμε ένα docker network με την εντολή:
To obtain the structure above we create a docker network with the command:
docker network create influxDB_Grafana_network
Μπορούμε να δούμε τα διαθέσιμα networks με την εντολή:
To detect the available networks we use the command:
docker network ls
Επιπλέον θα χρειαστούμε δύο **volumes** για να μη χάνονται τα δεδομένα της **βάσης** και του **Grafana** κάθε φορά που πέφτουν οι **containers**.
Φτιάχνουμε τα δύο volumes με τις εντολές:
Also, two **volumes** will be needed to avoid data lose of the **database** and of **Grafana** everytime which the **containers** close.
We create those two volumes using the following commands:
docker volume create grafana_volume
docker volume create influxdb_volume
Μπορούμε να δούμε τα διαθέσιμα networks με την εντολή:
To detect the available volumes we use the command:
docker volume ls
Επόμενο βήμα είναι να μεταβούμε στο φάκελο **InfluxDB&Grafana compose** και να τρέξουμε την εντολή:
The next step is to go to the folder **InfluxDB&Grafana compose** to run the command:
docker-compose up -d
Η συγκεκριμένη εντολή θα υλοποιήσει τα περιεχόμενα του docker-compose.yml αρχείου.
This command will create the content of the docker-compose.yml file.
![enter image description here](https://i.ibb.co/zS9x4rf/ymlfinal.png)
Όπως φαίνεται και στο παραπάνω αρχείο με το **yml file** σηκώνονται δυο **containers(InfluxDB,Grafana)** οι οποίοι χρησιμοποιούν το κοινό **bridge network** και τα **volumes.**
As shown to the file above with the **yml file** compose two **containers(InfluxDB,Grafana)** for using the common network **bridge network** and the corresponding **volumes**.
Εφόσον σηκωθούν οι containers με την εντολή:
Upon composing the containers using the command:
docker exec -it influxdb_container sh
Μπορούμε να πάρουμε **shell** μέσα στον container της **InfluxDB**.
Αμέσως μετά πληκτρολογούμε **influx** για να μεταβούμε στο **shell** της **InfluxDB**.
We are able to access the **shell** in the container of the **InfluxDB**.
Then, we type **influx** to go to **shell** of the **InfluxDB**.
![enter image description here](https://i.ibb.co/61xPTQt/influxshell1.png)
Στη συνέχεια φτιάχνουμε τη βάση μας με την εντολή:
The, we create our database with the command:
create database values_from_sensor
Έπειτα μπορούμε να δούμε τη βάση που φτιάξαμε με την εντολή:
Now, we are able to see the database we already create, with the command:
show databases
#### Grafana(set up)
Το επόμενο βήμα είναι να μεταβούμε στο application του **Granafa** που τρέχει στη πόρτα **3000**.
Πληκτρολογούμε στον **browser** μας **localhost:3000**.
Tα αρχικά στοιχεία για username και password είναι **admin**.
#### Grafana (setup)
The next step is to go to the application of **Granafa** which run at the port **3000**.
We type to our **browser** the address **localhost:3000**.
The initial info for username and password are both **admin**.
Τώρα πρέπει να ορίσουμε την **πηγή δεδομένων (data source)** όπου στη περίπτωση μας είναι η **InfluxDB**.
Now, we have to set the **data source**, which in our case is **InfluxDB**.
![enter image description here](https://i.ibb.co/0cmwJzK/grafanadatasource1.png)
@ -205,19 +198,19 @@ Tα αρχικά στοιχεία για username και password είναι **a
![enter image description here](https://i.ibb.co/3M068dC/grafan2.png)
**Συμπληρώνουμε τα στοιχεία της βάσης:**
**Fill the database info:**
![enter image description here](https://i.ibb.co/xfynVnS/grafan4.png)
Τέλος πατάμε **Save and Test**
Then, we click **Save and Test**
**Δημιουργεία Dashboard**
**Dashboard Creation**
![enter image description here](https://i.ibb.co/JRF446y/dashboard.png)
![enter image description here](https://i.ibb.co/tbpJny1/dash2.png)
Επιλέγουμε το **data source** που φτιάξαμε και έπειτα το **measurement** που θέλουμε να προβάλουμε.
Choose the **data source** we already create and then the **measurement** we wish to project.
Επιπλέον ρυθμίσεις για καλύτερη προβολή των τιμών απο το **tab Panel** δεξία της οθόνης.
@ -226,110 +219,7 @@ Tα αρχικά στοιχεία για username και password είναι **a
![enter image description here](https://i.ibb.co/rmPFVDL/sidedash22.png)
![enter image description here](https://i.ibb.co/YhKTNm5/sidedash33.png)
# Kώδικας
Απο τα αρχεία του κώδικα θα παρουσιαστούν **τα πιο σημαντικά σημεία του** με σκοπό την κατανόηση του τρόπου λειτουργίας (όχι δηλώσεις μεταβλητών κτλπ).
## producer.js
![enter image description here](https://i.ibb.co/frkM9BX/prodcode11.png)
1) Εισαγωγή δύο απαραίτητων module για την λειτουργία του producer.
2) Έναρξη επικοινωνίας με το Arduino μέσο της σειριακής πόρτας (σε ρυθμό 9600).
3) Αρχικοποίηση των ρυθμίσεων του RabbitMQ ώστε να ξέρω που θα στείλω τα δεδομένα μου (που να γίνει το send to queue).
![enter image description here](https://i.ibb.co/84g8TDS/prodcode22.png)
1) Ορισμός ονόματος queue
2) Δημιουργία connection, channel και queue για το RabbitMQ
3) Ανάγνωση της σειριακής θύρας
4) Δημιουργεία ενός κενού javascript object με σκοπό να το γεμίσουμε με το όνομα του αισθητήρα και της τιμή που διαβάστηκε απο την σειριακή πόρτα (εφαρμογή της μεθόδου slice για να κόψουμε το "\r" απο τα δεδομένα που διαβάζονται στην σειριακή πόρτα).
5) Μετατροπή του javascript object σε JSON αποστολή του στη queue (JSON γιατί είναι απαιτούμενο του RabbitMQ).
6) Εφαρμογή της συνάρτησης.
## consumer.js
![enter image description here](https://i.ibb.co/FHTLXdL/conscode00.png)
1) Εισαγωγή 4 απαραίτητων module για την λειτουργία του consumer.
2) Aρχικοποίηση των ρυθμίσεων για την υπηρεσία του mail.
3) Αρχικοποίηση των επιλογών για την υπηρεσία του mail.
4) Αρχικοποίηση της σύνδεσης με τον εξωτερικό server που θα σταλούν τα δεδομένα για περαιτέρω επεξεργασία.
Αποστολή του event "join_Temp_room" σε σκοπό την εισαγωγή στο room που επεξεργάζονται οι θερμοκρασίες.
Αν η εισαγωγή στο room ήταν επιτυχής ή αποτυχής γίνεται εκτύπωση του αντίστοιχου μηνύματος.
![enter image description here](https://i.ibb.co/gS6ny7J/conscode11.png)
1) Αρχικοποίηση των ρυθμίσεων της βάσης με σκοπό να μπορώ να γράψω και να διαβάσω απο αυτή.
Οι τιμές που καταγράφονται στη βάση έχουν το measurement temp , είναι τύπου float και περιγράφονται απο το tag sensor (θα μπορούσε το tag να έχει πολλές τιμές π.χ. building1 , floor2 , room55 με σκοπό να προσδιορίσουμε ακριβώς τη θέση της προερχόμενης τιμής).
2) Αρχικοποίηση των ρυθμίσεων του RabbitMQ ώστε να ξέρω απο που θα πάρω τα δεδομένα μου (που να γίνει το consume from queue).
![enter image description here](https://i.ibb.co/RSD7HTP/conscode22.png)
1) Ανάθεση του ονόματος της queue και του ονόματος του αισθητήρα.
2) Δημιουργία connection, channel και queue για το RabbitMQ.
3) Consume και μετατροπή του JSON σε javascript object για την επεξεργασία του.
4) Έλεγχος του ονόματος του αισθητήρα με σκοπό να αποφύγω να πάρω τιμή άλλου μεγέθους (π.χ. υγρασία).
5) Acknowledge του μυνήματος που έκανα consume με σκοπό να σβηστεί απο την queue.
6) Αποστολή της τιμής μαζί με το όνομα του αισθητήρα στη βάση.
7) Μετατροπή του javascript object σε JSON και αποστολή του στον εξωτερικό server για επεξεργασία.
8) Εκτύπωση μηνύματος αν το όνομα του αισθητήρα δεν είναι το ήδη ορισμένο.
![enter image description here](https://i.ibb.co/BjSwDLS/conscode33.png)
1) **(6)** ανά 5 λεπτά γίνεται ένα query στη βάση και επιστρέφει όλες τις τιμές των τελευταίων 5 λεπτών.
2) Αποθήκευση τιμών σε ένα array.
3) Προσπέλαση όλου του array.
4) Έλεγχος των τιμών ανά ζευγάρια των δύο και υπολογισμός αν υπάρχει ποσοστιαία αύξηση ή μείωση αντίστοιχα μεταξύ των τιμών. Αν υπάρχει , τροποποιείται σε αντίστοιχη μορφή το κείμενο του mail.
5) Αποστολή του mail ειδοποίησης.
6) Ορισμός χρονόμετρου.
## server.js
![enter image description here](https://i.ibb.co/TmL135h/servcode11.png)
1) Εισαγωγή 4 απαραίτητων module για την λειτουργία του server.
2) Αρχικοποίηση του server και του socket.
3) Array διαθέσιμων room.
![enter image description here](https://i.ibb.co/zHRzvrZ/servcode22.png)
1) Έναρξη server.
2) Αναμονή για συνδέσεις.
3) Ενεργοποίηση του event "join_Temp_room".
4) Έλεγχος αν το δωμάτιο που έστειλε ο consumer είναι υπαρκτό (αν είναι γινεται η εισαγωγή του consumer στο συγκεκριμένο δωμάτιο).
5) Ενεργοποίηση του event "handleData".
6) Μετατροπή του JSON σε javascript object.
7) Εγγραγή των δεδομένων που έλαβε ο server στο αρχείο tempValues.txt για την περεταίρω επεξεργασία.
### Namespaces & rooms
@ -344,7 +234,7 @@ Tα αρχικά στοιχεία για username και password είναι **a
## Ειδοποίηση χρήστη
![enter image description here](https://i.ibb.co/KztMBC4/139796416-225410489050033-1753819101017820134-n.jpg)
# Πηγές
# Sources
https://git.swarmlab.io:3000/zeus/iot-swarm-example/raw/branch/master/docs/README.adoc#_server_site
http://docs.swarmlab.io/SwarmLab-HowTos/labs/IoT/SensorNode2Server.adoc.html

Loading…
Cancel
Save