545 Commits
Dev ... main

Author SHA1 Message Date
Dano van den Bosch
d40a93e747 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-05 14:06:41 +02:00
Dano van den Bosch
79865e0852 retro afbeelding 2024-04-05 14:06:38 +02:00
Bas Pijls-van Kooten
958889306e Update infrasturcture.md to make mermaid work 2024-04-05 13:53:50 +02:00
Bram Barbieri
fdebe8ddde spelling mistakes updated 2024-04-05 13:30:46 +02:00
Bram Barbieri
2f230ebfb3 docs update 2024-04-05 13:20:25 +02:00
Bram Barbieri
048d6ff8ea Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-05 13:18:23 +02:00
Bram Barbieri
a0a5501726 small documetnation updating 2024-04-05 13:18:21 +02:00
Dano van den Bosch
2494536b79 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-05 13:09:02 +02:00
Dano van den Bosch
3c62ee4bd2 added data flows 2024-04-05 13:08:59 +02:00
Bram Barbieri
910b555bc1 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-05 11:57:30 +02:00
Bram Barbieri
9844e2d4d4 links to code added. 2024-04-05 11:57:27 +02:00
Dano van den Bosch
1461053c36 infra docu 2024-04-05 11:50:51 +02:00
Bram Barbieri
233038f0a7 buzzerClass docs af 2024-04-05 11:41:27 +02:00
Bram Barbieri
44b16c168d class documentation updated 2024-04-05 00:48:13 +02:00
Bram Barbieri
1d538bd3df Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-04 22:35:29 +02:00
Bram Barbieri
2ae320d230 updated locations and started documenting classes. 2024-04-04 22:35:27 +02:00
Dano van den Bosch
43242f2080 afbeeldong 2024-04-04 22:24:21 +02:00
Dano van den Bosch
beb123c2b9 PAGES 2024-04-04 22:22:40 +02:00
Dano van den Bosch
9ee589da29 Merge branch '44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de' into 'main'
Resolve "Als gebruiker wil ik dat de website automatisch het aantal nodes dat ik heb aangesloten op de website zet, zodat ik minder moeite hoef te doen zodra ik een nieuwe node aansluit."

Closes #44

See merge request propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59!9
2024-04-04 22:20:50 +02:00
Sietse Jonker
9d6b950db5 Merge branch 'main' into '44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de'
# Conflicts:
#   docs/.pages
2024-04-04 22:20:09 +02:00
Dano van den Bosch
e14b653534 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-04 22:19:46 +02:00
Dano van den Bosch
605f425d9d Merge branch '44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de' 2024-04-04 22:19:44 +02:00
Sietse Jonker
5531485385 Update file .pages 2024-04-04 22:09:15 +02:00
Sietse Jonker
0db2e8ab52 Update file .pages 2024-04-04 22:06:30 +02:00
Dano van den Bosch
72ebd92c99 Update infrastructure documentation with functional, technical, and UML diagrams 2024-04-04 21:42:33 +02:00
Bram Barbieri
eac2d891e8 docs updated 2024-04-04 21:38:06 +02:00
Dano van den Bosch
b8c16a13c7 updated pages 2024-04-04 21:22:24 +02:00
Dano van den Bosch
d19a71906a Merge branch '44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 into 44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de 2024-04-04 21:21:34 +02:00
Dano van den Bosch
1410ff7989 Added infrastucture documentation 2024-04-04 21:21:32 +02:00
Bram Barbieri
060b2edc92 database connection documentation update 2024-04-04 19:56:26 +02:00
Bram Barbieri
d4b44e33b3 database documentation update 2024-04-04 19:16:25 +02:00
Bram Barbieri
fa7baccffd database documentation update 2024-04-04 17:18:39 +02:00
Bram Barbieri
6feb27d769 database documentation updating 2024-04-04 17:04:30 +02:00
Bram Barbieri
e0d1a91645 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-04 15:54:23 +02:00
Bram Barbieri
3cd2d62e83 removed i]mage 2024-04-04 15:54:21 +02:00
863b491021 retrosprint3 2024-04-03 23:28:43 +02:00
f7253574d0 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-03 23:09:03 +02:00
7efc4dddef added comment 2024-04-03 23:09:00 +02:00
Bram Barbieri
a006932ff3 questions coulor updated. 2024-04-03 12:29:04 +02:00
Dano van den Bosch
44857fdd65 text css 2024-04-03 12:28:23 +02:00
Bram Barbieri
74cebc0cef Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-03 11:53:33 +02:00
Bram Barbieri
39657b24a3 mermaid web-data connection classes made 2024-04-03 11:53:31 +02:00
Sietse Jonker
e43be1c6b1 Add UML infrastructure diagram 2024-04-03 11:51:48 +02:00
Sietse Jonker
3a825744e7 Update image paths in node documentation 2024-04-03 11:50:14 +02:00
Sietse Jonker
c8ab03c0cd Update brainstorm documentation with new questions 2024-04-03 11:46:10 +02:00
0af4bce035 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-03 11:42:14 +02:00
654f797d9d fixed datatypes 2024-04-03 11:41:56 +02:00
3c87feec76 docs 2024-04-03 11:41:49 +02:00
Sietse Jonker
74b8fa5f1e Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-03 11:41:06 +02:00
Sietse Jonker
2c39cc90ad Add flex display to #editNode 2024-04-03 11:41:05 +02:00
Bram Barbieri
a4600b25e6 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-03 11:35:44 +02:00
Bram Barbieri
a92b6b58d6 documentation python classes updated. 2024-04-03 11:35:42 +02:00
Sietse Jonker
c7059086c2 Add margin-top to gaugeGroup 2024-04-03 11:34:17 +02:00
Sietse Jonker
8c9ccda61a Refactor navigation links in HTML files 2024-04-03 11:28:37 +02:00
Sietse Jonker
6f5f9d4b47 WORKING 2024-04-03 11:19:01 +02:00
Sietse Jonker
f4bd73a77a Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-03 11:12:47 +02:00
Sietse Jonker
c44c9c82b3 Update dashboard styles and API endpoint 2024-04-03 11:09:21 +02:00
Dano van den Bosch
db29d0d4cf Merge branch 'revert-045fbb50' into 'main'
Revert graph problema

See merge request propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59!7
2024-04-03 11:04:50 +02:00
Dano van den Bosch
50dff89761 Revert "Merge branch 'main' of..."
This reverts commit 045fbb50d9
2024-04-03 11:04:17 +02:00
Dano van den Bosch
045fbb50d9 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-03 11:01:17 +02:00
Dano van den Bosch
24ec686fa0 Update navigation and dashboard styles 2024-04-03 10:59:57 +02:00
Sietse Jonker
a2e77e6f3d Fix variable name in main.js 2024-04-03 10:43:32 +02:00
Sietse Jonker
e67764ee42 Fix variable name capitalization in main.js and clean up CSS styles in dashboard-styles.css 2024-04-03 10:42:40 +02:00
Dano van den Bosch
b85eb7faf7 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-03 10:12:29 +02:00
Dano van den Bosch
50906649c2 Website changes 2024-04-03 10:12:25 +02:00
Bram Barbieri
355a2b4f75 documentation general data. 2024-04-02 22:50:28 +02:00
Bram Barbieri
5d8bec404b enquete class documentation + a bit of the others 2024-04-02 21:13:27 +02:00
Bram Barbieri
556f06026e Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 20:22:36 +02:00
Bram Barbieri
5f426df0ed Main data file documentation done. 2024-04-02 20:22:33 +02:00
Sietse Jonker
e949949f42 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 17:13:04 +02:00
Sietse Jonker
86193d3593 Update dashboard styles in CSS file 2024-04-02 17:13:02 +02:00
46f9ca1292 removed thingy 2024-04-02 17:10:33 +02:00
70c95e676e for each loop for data graphs 2024-04-02 17:10:26 +02:00
Bram Barbieri
222abb3ec3 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 17:05:57 +02:00
Bram Barbieri
24aaf29bce beginning with getting data 2024-04-02 17:05:55 +02:00
Sietse Jonker
c74a4e6400 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 16:39:34 +02:00
Sietse Jonker
b69b029628 Add createDiv() method to Graph class and update graph-classes.js, graphs.html, and graph-styles.css 2024-04-02 16:39:32 +02:00
Bram Barbieri
c61cdaad1f Hoofdletters update 2024-04-02 16:07:53 +02:00
Bram Barbieri
badea73c4d Uml added, documetnation added 2024-04-02 15:55:10 +02:00
Bram Barbieri
adab457fd9 sensornode updated docs. 2024-04-02 15:41:45 +02:00
Bram Barbieri
8085060490 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 15:32:47 +02:00
Bram Barbieri
b6c2bdb4a4 More documentation about classes. 2024-04-02 15:32:45 +02:00
Sietse Jonker
5316e2d647 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 14:15:38 +02:00
Sietse Jonker
8724691716 Update graph creation and styling 2024-04-02 14:15:31 +02:00
Bram Barbieri
cf16a2cdc1 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 13:51:40 +02:00
Bram Barbieri
5761e0a028 new documentations made. 2024-04-02 13:51:37 +02:00
Sietse Jonker
4edbe2312a Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 13:47:08 +02:00
Sietse Jonker
8bb1a1c69f Add Questions link to navigation 2024-04-02 13:47:07 +02:00
Sietse Jonker
62206a6ce3 Add fetch request to get node information and populate select dropdown 2024-04-02 13:47:04 +02:00
ecac4e7966 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 13:32:39 +02:00
276ec2ed12 Add UML diagram and classes for infrastructure V2 2024-04-02 13:32:35 +02:00
Bram Barbieri
94ee31f6ac Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 13:25:41 +02:00
Bram Barbieri
93492db324 documentation updated. 2024-04-02 13:25:39 +02:00
Dano van den Bosch
8503300aa0 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 13:09:16 +02:00
Dano van den Bosch
b9455a56a8 change node name functionalitijd 2024-04-02 13:05:31 +02:00
Bram Barbieri
c66bd305bb Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 11:49:54 +02:00
Bram Barbieri
f044891ed8 little update, no changes 2024-04-02 11:49:51 +02:00
Bram Barbieri
6fb54d0b07 websocket, database, file made. 2024-04-02 11:49:29 +02:00
Sietse Jonker
30d8543ff4 Update dashboard styles 2024-04-02 11:45:13 +02:00
Sietse Jonker
b5f0b7cc5a Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-02 11:43:32 +02:00
Sietse Jonker
cac0977035 Add query to select all nodes when MAC is "*" and update background color in dashboard styles 2024-04-02 11:43:29 +02:00
Bram Barbieri
a1ceb2d2c1 copying classes python to document 2024-04-02 11:22:44 +02:00
4173a02200 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-01 16:49:47 +02:00
7b8f98cb3c Fully functioning screen code 2024-04-01 16:49:44 +02:00
sietse jonker
61d67fc1e2 Update node input placeholder and adjust styles 2024-04-01 16:20:36 +02:00
sietse jonker
267bb7db9c Refactor getData and getNodeInfo functions 2024-04-01 16:13:38 +02:00
sietse jonker
5aa494773e Refactor getData function and fix SQL query in queries.py 2024-04-01 16:09:20 +02:00
sietse jonker
a53ecb1c96 yippee het werkt 2024-04-01 16:09:17 +02:00
sietse jonker
44b1f6b33d Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-01 14:41:31 +02:00
sietse jonker
c789aec373 Add dataTypes parameter to generateLink function 2024-04-01 14:41:30 +02:00
sietse jonker
4ab7709c82 Refactor getData function and fix query bug 2024-04-01 14:41:02 +02:00
sietse jonker
650032fced Refactor questions-dashboard.html and questions-dashboard-styles.css 2024-04-01 14:35:30 +02:00
Bram Barbieri
6dd926d782 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-01 14:01:18 +02:00
Bram Barbieri
b0b1ed84c7 code comments added. 2024-04-01 14:01:16 +02:00
sietse jonker
52c615eba3 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-01 13:57:39 +02:00
sietse jonker
fdd4b647ec Update graph styles in CSS file 2024-04-01 13:57:38 +02:00
Bram Barbieri
f79abd05c2 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-01 13:56:51 +02:00
Bram Barbieri
96d10b32fd chart class, shortcuts, for loop update. 2024-04-01 13:56:49 +02:00
sietse jonker
b2d7f7c434 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-01 13:50:50 +02:00
sietse jonker
c539bb2edf Fix graph update bug and optimize data processing 2024-04-01 13:50:49 +02:00
Bram Barbieri
ab8249702e Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-01 13:19:27 +02:00
Bram Barbieri
38722052f3 resizing the pie graphs. 2024-04-01 13:19:25 +02:00
sietse jonker
59377aa2b5 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-01 13:19:01 +02:00
sietse jonker
8ff9a4e9e4 Fix updateGraph() method in DataProcessor class 2024-04-01 13:19:00 +02:00
sietse jonker
9954d66af6 Refactor question creation and chart configuration 2024-04-01 13:18:56 +02:00
2808e2e55f Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-01 13:17:19 +02:00
47a228123e moved files around 2024-04-01 13:17:15 +02:00
sietse jonker
6f56b9d628 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-01 13:06:09 +02:00
sietse jonker
887e84c16c Update graph class and data processor 2024-04-01 13:06:07 +02:00
Bram Barbieri
9ba6a237f3 questionawnsers updated. 2024-04-01 12:53:41 +02:00
Bram Barbieri
5de768c3ab Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-04-01 12:46:10 +02:00
Bram Barbieri
81b81683c9 questions awnsers page updated with variables and dummydata, class now on sepperate file. 2024-04-01 12:46:08 +02:00
sietse jonker
ec756cd387 Update plotly container styles 2024-04-01 12:35:52 +02:00
sietse jonker
a4a73b84cc Refactor fetchData function and add getLink function 2024-04-01 11:58:39 +02:00
sietse jonker
0d86c6bcbd Add node parameter to fetch request 2024-04-01 11:50:52 +02:00
sietse jonker
69ef7013bb Refactor get_query function to handle additional conditions 2024-04-01 11:50:47 +02:00
sietse jonker
5e2daa445a can succesfully make a graph from database data 2024-04-01 11:33:18 +02:00
sietse jonker
76532c538b Refactor graph creation and update methods 2024-03-31 21:24:52 +02:00
sietse jonker
ae082b53a4 Add temperature, humidity, eCO2, and TVOC data to graph and update graph view 2024-03-31 21:19:37 +02:00
sietse jonker
f803ab021c Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-31 21:08:49 +02:00
sietse jonker
912ffc052b Add date range filter to getData function 2024-03-31 21:08:48 +02:00
sietse jonker
e94f12e13c Refactor graph classes and add data processor 2024-03-31 21:08:40 +02:00
sietse jonker
28cc13484f Remove graph1 div and add flex-direction to body 2024-03-31 21:08:35 +02:00
Bram Barbieri
f2050a54a4 class working kindof, kan nog niet gelezen worden vanaf andere js file. 2024-03-31 20:48:50 +02:00
Bram Barbieri
3435bdaaab extra dummy question added. 2024-03-31 20:27:33 +02:00
Bram Barbieri
cf0a6c6565 trying to work with classes, but script works for time being. 2024-03-31 20:22:50 +02:00
Bram Barbieri
64ba63e9ad piegraphs added 2024-03-31 15:58:34 +02:00
Bram Barbieri
074406aec5 kleine update, pagina voor questions beginning template 2024-03-31 14:11:33 +02:00
sietse jonker
eea0828b37 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-30 22:57:45 +01:00
sietse jonker
a381fa1ee1 Update fetch URL in graph-main.js 2024-03-30 22:57:43 +01:00
sietse jonker
034dd2b660 Add Questions Dashboard page 2024-03-30 22:57:40 +01:00
Bram Barbieri
66793a12fc kleine pdates questiondata pulling. 2024-03-30 22:50:24 +01:00
sietse jonker
8416254d6c Refactor code to create filter container and fetch data from server 2024-03-30 22:33:45 +01:00
sietse jonker
97c21f9d31 Add query for retrieving replies 2024-03-30 22:33:42 +01:00
sietse jonker
0a25bbf84f Refactor graph styles and filters 2024-03-30 22:27:16 +01:00
sietse jonker
415a0c456e Remove extra closing div tag in graphs.html 2024-03-30 21:46:32 +01:00
sietse jonker
726d411321 Add dataTypesContainer to container and update styles 2024-03-30 21:25:20 +01:00
sietse jonker
642c4a24ad Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-30 20:43:57 +01:00
sietse jonker
79c3c956fe Update graph styles and input field margins 2024-03-30 20:43:51 +01:00
02b32c33ea made dropdown graph 2024-03-30 17:31:41 +01:00
3e7a89bf8b Added togglegraph function 2024-03-30 17:22:55 +01:00
92b27ab9b7 graph works now 2024-03-30 12:38:20 +01:00
9ac39ff74f removed junk 2024-03-30 12:38:13 +01:00
463b161855 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-29 19:36:14 +01:00
0666b21bc5 styling 2024-03-29 19:36:12 +01:00
09e3d7020e moved navbar into body 2024-03-29 19:36:07 +01:00
sietse jonker
49dc40a2c2 Add data filtering functionality and input elements for user input 2024-03-29 16:25:54 +01:00
26b35036ec Added graph 2024-03-29 16:16:08 +01:00
sietse jonker
0db496fb72 Refactor queries.py to improve query selection logic 2024-03-29 15:39:48 +01:00
sietse jonker
39dd5c62d8 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-29 15:19:20 +01:00
sietse jonker
5bf5a193b9 Add getQuestionData route 2024-03-29 15:18:36 +01:00
sietse jonker
30a739d02b Add graph classes and update HTML files 2024-03-29 15:18:32 +01:00
7a35c54322 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-29 14:59:33 +01:00
7f48f0f3b3 added graph div 2024-03-29 14:59:30 +01:00
c4fa9fbfa5 removed junk 2024-03-29 14:59:23 +01:00
Bram Barbieri
363eaeb922 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-29 14:50:21 +01:00
Bram Barbieri
b79c3ce37d docs new node redesign 2024-03-29 14:50:18 +01:00
Dano van den Bosch
1743b998eb Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-29 14:42:33 +01:00
Dano van den Bosch
207416013a pages 2024-03-29 14:42:31 +01:00
8f5c547336 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-29 14:40:25 +01:00
70a7b4651c css arrowimg 2024-03-29 14:40:22 +01:00
Dano van den Bosch
002818f1b9 DELETE 2024-03-29 14:39:17 +01:00
0b079798cd added script + image 2024-03-29 14:38:01 +01:00
Dano van den Bosch
f4824731dc node documentaion 2024-03-29 13:42:45 +01:00
Dano van den Bosch
b467c1823e Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-29 13:40:38 +01:00
Dano van den Bosch
f02d2d61ce Node documentation 2024-03-29 13:40:36 +01:00
345acda615 removed old website 2024-03-29 12:50:19 +01:00
71826ee76f styling 2024-03-29 12:49:26 +01:00
9b130d009c made indentification by mac adres instead of name 2024-03-29 12:49:19 +01:00
a6da7a1654 ? 2024-03-29 12:49:01 +01:00
85154d1beb Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-29 12:21:33 +01:00
ce996e622e Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-29 12:21:21 +01:00
sietse jonker
61073577e3 Update stylesheets for graphs, dashboard, and settings pages 2024-03-29 12:21:19 +01:00
14511c34fd styles 2024-03-29 12:21:17 +01:00
sietse jonker
dac363339a Update styles and links in HTML files 2024-03-29 11:46:51 +01:00
sietse jonker
f08be2a4aa Add new website files and classes 2024-03-29 11:40:28 +01:00
sietse jonker
e2e00636bc Update navigation links in index.html 2024-03-29 11:40:10 +01:00
sietse jonker
c6a6ba72f0 Add new website files and update navigation links 2024-03-29 11:40:07 +01:00
sietse jonker
c7912022b5 Merge branch '44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 into 44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de 2024-03-29 11:26:39 +01:00
sietse jonker
4ef167c590 Update temperature and humidity display format 2024-03-29 11:26:37 +01:00
d21bae4b19 fixed scaling 2024-03-28 15:07:57 +01:00
899d2bb868 removed original gaugecontainer 2024-03-28 14:15:53 +01:00
64f9ab24e0 Added introduction 2024-03-28 13:40:04 +01:00
1c13d20b49 added location and nodename 2024-03-28 13:32:22 +01:00
c6f3c7c018 fixed screen code + added some documentation on our choices 2024-03-28 13:32:08 +01:00
e7597d8d1f name change 2024-03-28 01:16:15 +01:00
f788580ef4 added answers 2024-03-28 01:14:49 +01:00
e5348f0ffa conclusion 2024-03-28 01:10:44 +01:00
ba96a81d3f Rephrasing 2024-03-28 01:08:09 +01:00
778c47fa68 Added pages 2024-03-28 01:03:42 +01:00
627af72f0f Added websocket script and modified it to work with the class 2024-03-28 00:59:43 +01:00
883460cdaa better scaling + styling 2024-03-28 00:59:30 +01:00
9ddcfe88f5 Added navbar 2024-03-28 00:59:18 +01:00
3ecb87a9e4 fixed it so you can set types as text under the gauges 2024-03-28 00:59:11 +01:00
f3cd6bd011 Added font 2024-03-27 22:38:02 +01:00
cbf6cf1484 background color 2024-03-27 20:52:09 +01:00
d54c020144 redid styling 2024-03-27 20:48:40 +01:00
e920298df8 class file change 2024-03-27 20:48:33 +01:00
f5ebaa676e GaugeGroup class creation 2024-03-27 20:48:24 +01:00
9463063917 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-27 20:05:55 +01:00
28f5153cee Made the box look good 2024-03-27 20:05:52 +01:00
Bram Barbieri
461e3bdfeb Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-27 20:03:10 +01:00
Bram Barbieri
77302d64a5 Feedback updated 2024-03-27 20:03:09 +01:00
900a713468 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-27 18:53:47 +01:00
a36b6746fd created row of gauges 2024-03-27 18:53:42 +01:00
Bram Barbieri
d09df80886 image of covers added. 2024-03-27 16:18:24 +01:00
Bram Barbieri
5c07478997 url added. 2024-03-27 16:14:21 +01:00
Bram Barbieri
912344153e arduino bram node 2024-03-27 16:11:40 +01:00
Bram Barbieri
96a9e6ef63 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-27 14:37:02 +01:00
Bram Barbieri
68c68fa7a6 Feedback, node code, and documentation updated. 2024-03-27 14:36:59 +01:00
7f79b46c01 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-27 14:19:50 +01:00
502ae3c614 starting gauge 2024-03-27 14:19:47 +01:00
Sietse Jonker
570b8b7a67 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-27 14:13:30 +01:00
Sietse Jonker
5dee5d99ab Fix QuestionID range in bullshitSenderENQUETE.py 2024-03-27 14:13:28 +01:00
Sietse Jonker
cf86970605 Added filter code to handle sensor and enquete data from websocket 2024-03-27 14:13:22 +01:00
Dano van den Bosch
b38730e9a1 typo in pages 2024-03-27 12:22:35 +01:00
Dano van den Bosch
b914be9534 Pages updates 2024-03-27 12:20:36 +01:00
Dano van den Bosch
6d548f7738 node class OOP 2024-03-27 12:19:28 +01:00
Dano van den Bosch
1ac6f01331 replact to main 2024-03-27 12:18:55 +01:00
Dano van den Bosch
98e47d39fc Uml node class 2024-03-27 12:18:08 +01:00
Dano van den Bosch
5f31176a7e Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-27 12:17:00 +01:00
Dano van den Bosch
6fd674f4c9 daily stand op 27 maart 2024-03-27 12:16:58 +01:00
Dano van den Bosch
9fc5c5b53b Arduino OOP documentation 2024-03-27 12:13:59 +01:00
Bram Barbieri
e5b44cd85a Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-27 11:27:36 +01:00
Bram Barbieri
675cc23665 feedback updated 2024-03-27 11:27:34 +01:00
sietse jonker
6735a498ca Remove unnecessary whitespace in data.py 2024-03-26 23:20:28 +01:00
sietse jonker
5ce77d54ef remove unesecarry code 2024-03-26 23:20:05 +01:00
sietse jonker
c0afae2688 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-26 23:19:16 +01:00
sietse jonker
75ff84ee70 Refactor database queries and update variable names 2024-03-26 23:19:15 +01:00
Dano van den Bosch
a35bd6b88d Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-26 23:06:38 +01:00
Dano van den Bosch
fb9088e2b1 spell check 2024-03-26 23:06:36 +01:00
sietse jonker
8aca330aad Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-26 23:03:35 +01:00
sietse jonker
379a8b0f84 Add processEnqueteNodeData function to handle enquete node data 2024-03-26 23:03:34 +01:00
Dano van den Bosch
906b5e4304 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-26 23:03:30 +01:00
Dano van den Bosch
d9a603886c geboubeheer gesprec documentation 2024-03-26 23:03:28 +01:00
sietse jonker
17f6ba8376 Add WebSocket data sender scripts 2024-03-26 23:03:26 +01:00
sietse jonker
970b7eaa41 it works yippee (depending on what node sends it data the script will send it to the corresponding table with automatic node numbering) 2024-03-26 22:46:50 +01:00
sietse jonker
44a2d1e5c6 Refactor getNodeInfo function to store node information in separate arrays 2024-03-26 22:25:07 +01:00
sietse jonker
f2a7f32d43 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-26 21:40:35 +01:00
sietse jonker
146e0c2eea Add data processing functions and WebSocket connection handling 2024-03-26 21:40:34 +01:00
Dano van den Bosch
f75eff03a4 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-26 21:03:05 +01:00
Dano van den Bosch
891df42972 daily standup 2024-03-26 21:03:03 +01:00
Dano van den Bosch
56d45b9fe9 gebouw beheer documentatie 2024-03-26 21:02:53 +01:00
sietse jonker
91f24a6f42 Add getNodeInfoIndex route to Flask main.py 2024-03-26 19:42:29 +01:00
Bram Barbieri
93bf3aed37 Feedback updated 2024-03-26 15:20:40 +01:00
Bram Barbieri
c4c36de0f7 Bram documentation updated 2024-03-26 15:16:30 +01:00
Bram Barbieri
2ef003ef39 Bram documentation. 2024-03-26 15:05:53 +01:00
Bram Barbieri
c19d77ce15 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-26 14:42:09 +01:00
Bram Barbieri
9f295d7bb3 Feedback updates 2024-03-26 14:42:07 +01:00
Sietse Jonker
466066d4c7 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-26 13:47:31 +01:00
Sietse Jonker
4eeb80cdb2 Add Brams script for processing and storing data from WebSocket 2024-03-26 13:47:28 +01:00
Bram Barbieri
9598a64f0e Usertest node design 2024-03-26 13:45:26 +01:00
Dano van den Bosch
f800f7fc33 Merge branch '44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 into 44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de 2024-03-26 13:41:17 +01:00
Dano van den Bosch
62124ec402 added kopjes 2024-03-26 13:41:16 +01:00
Bram Barbieri
8d2e2a6931 node design questions. 2024-03-26 12:51:53 +01:00
Dano van den Bosch
4290d5572b Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-26 11:28:35 +01:00
Dano van den Bosch
53b50b6851 daily stand up 36 maard 2024-03-26 11:28:31 +01:00
Bram Barbieri
940304c3b2 Bram documentation updated. 2024-03-26 11:07:52 +01:00
Sietse Jonker
eb53fd5fcd Merge branch '44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 into 44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de 2024-03-26 11:01:18 +01:00
Sietse Jonker
12909d3650 Add Node and Graph classes for website functionality 2024-03-26 11:01:16 +01:00
Bram Barbieri
5dc020a6ce Bram documentation fix 2024-03-25 15:59:48 +01:00
Bram Barbieri
36d46b8c4a Bram expert preperation documentation updated 2024-03-24 16:16:25 +01:00
Bram Barbieri
3d091cec98 fritzing and wireframe documentation updating 2024-03-24 15:01:31 +01:00
Dano van den Bosch
6c0baf626d Merge branch '44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 into 44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de 2024-03-23 11:39:27 +01:00
Dano van den Bosch
1182e89c56 Node documetnation 2024-03-23 11:39:25 +01:00
Sietse Jonker
2221be88bf Refactor class constructors and update graph creation 2024-03-22 14:44:25 +01:00
Sietse Jonker
e5511d1925 Add node and graph classes for data visualization 2024-03-22 12:45:31 +01:00
Sietse Jonker
e5d2f23d59 Add classes and graphs documentation 2024-03-22 12:45:02 +01:00
Sietse Jonker
ca5d92bd86 Refactor graph class constructor and methods 2024-03-22 12:38:39 +01:00
Sietse Jonker
8ae69a6fbe Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-22 12:35:23 +01:00
Sietse Jonker
dcc99c1258 Add graph class and extend liveGraph from graph 2024-03-22 12:35:22 +01:00
Sietse Jonker
07cc13d573 Refactor classes.js to update connection status and add feedbackNode and graph classes 2024-03-22 12:31:53 +01:00
Bram Barbieri
7104331e4c Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-22 12:28:25 +01:00
Bram Barbieri
11f9f53f6b database documentation updated 2024-03-22 12:28:23 +01:00
Dano van den Bosch
4708c9c71e Stand up note 2024-03-22 12:07:50 +01:00
Sietse Jonker
cb1dbe8b11 Fix import statement in node.md and remove extra line in main.py 2024-03-22 11:52:51 +01:00
Sietse Jonker
1982db8c50 Add node class and update liveGraph class 2024-03-22 11:30:04 +01:00
Bram Barbieri
61c8d09760 Bram documentation 2024-03-21 16:48:52 +01:00
sietse jonker
f2907117be Add Node Documentation to navigation 2024-03-21 16:34:34 +01:00
sietse jonker
0ecc2457e7 adds future improvements 2024-03-21 16:33:26 +01:00
sietse jonker
fde715d7ed Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-21 16:32:13 +01:00
sietse jonker
e2ffcc4fa1 Add node documentation and wiring diagram 2024-03-21 16:32:11 +01:00
Bram Barbieri
adce47db3a Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-21 16:23:39 +01:00
Bram Barbieri
3d85220adc added fritzing to BRam documentation 2024-03-21 16:23:36 +01:00
54a2eef7c5 Added so you can change node information 2024-03-21 13:22:09 +01:00
09522218f3 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-21 12:19:04 +01:00
Dano van den Bosch
f94c452a19 added comments 2024-03-21 11:31:03 +01:00
4cf78ddb0b Added reverseproxy script 2024-03-20 16:09:20 +01:00
6ce7ac8c97 Added documenation about put request 2024-03-20 16:09:15 +01:00
Dano van den Bosch
cd56c45c47 Daily stand up for 20/03 2024-03-20 13:18:08 +01:00
Dano van den Bosch
ec336f914a removed unjused code 2024-03-20 12:40:55 +01:00
Bram Barbieri
5bf19a82ff bram documentation 2024-03-20 12:02:22 +01:00
Bram Barbieri
38d34cce91 Bram comment 2024-03-20 11:30:52 +01:00
Bram Barbieri
c0034acf65 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-20 11:16:34 +01:00
Bram Barbieri
d52eabbb61 Bram documentation 2024-03-20 11:16:31 +01:00
Dano van den Bosch
11099a1af9 moved websocket class to work with esp 2024-03-19 22:54:58 +01:00
Dano van den Bosch
cf18d4ab4f OOP made in arduino 👍 2024-03-19 22:28:16 +01:00
Dano van den Bosch
a4b8ae0dca Almost done with the OOP 2024-03-19 16:15:02 +01:00
5b327942be Added comment 2024-03-19 16:01:53 +01:00
89956bc4c8 Added put request 2024-03-19 15:50:00 +01:00
15504eaea6 Daily standup 2024-03-19 12:21:15 +01:00
Dano van den Bosch
a8f6491736 save state for my oop in aduino 2024-03-19 12:17:39 +01:00
Bram Barbieri
a82acc526c BramDocs 2024-03-19 11:59:37 +01:00
Bram Barbieri
5fa07f3a82 foldername change 2024-03-19 11:15:59 +01:00
Dano van den Bosch
ac7d97c890 Merge branch '44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 into 44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de 2024-03-19 11:13:50 +01:00
Dano van den Bosch
b28ae0e4a1 moved file 2024-03-19 11:13:47 +01:00
Sietse Jonker
7d8f820100 Update sprint2Review.md with sprint review details 2024-03-19 10:45:02 +01:00
Sietse Jonker
19034fe7e1 adds sprint2 review documentatie 2024-03-15 12:40:59 +01:00
Bram Barbieri
54fc6f2306 hoofdletter correctie. 2024-03-15 12:40:38 +01:00
Bram Barbieri
a707c4f9bb pages updated 2024-03-15 12:39:27 +01:00
Bram Barbieri
b8fbf0dfaf database documentation presentable 2024-03-15 12:13:51 +01:00
Bram Barbieri
b4dcdf7609 daily standup. 2024-03-15 11:18:58 +01:00
1c7fd2ab68 REST APi 2024-03-14 19:20:01 +01:00
6ea17a63c7 Added a script that sends junk to the websocket to act as a node 2024-03-14 19:19:52 +01:00
Bram Barbieri
a2ff97d7fb database websocket
documentation
2024-03-14 18:46:46 +01:00
Bram Barbieri
6c60a184b8 database websocket connection documentation. 2024-03-14 18:05:38 +01:00
sietse jonker
065cb42ef7 Remove unused code and update graph in updateNodeData function 2024-03-14 17:27:15 +01:00
sietse jonker
b3d80c1194 fixes dynamic node function 2024-03-14 15:21:51 +01:00
sietse jonker
4fd8c3d958 Fix node event handling and live graph creation 2024-03-14 15:05:38 +01:00
sietse jonker
94f118742e Merge branch '44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 into 44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de 2024-03-14 15:01:16 +01:00
sietse jonker
b13824afe5 adds fucntion to dynamically scale according to amount of nodes 2024-03-14 15:01:15 +01:00
Bram Barbieri
28ff778ce8 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-14 14:30:44 +01:00
Bram Barbieri
d20e6db9fe standup 2024-03-14 14:30:41 +01:00
ef8821fe48 Merge branch '44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de' into 'main'
working version to main

See merge request propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59!6
2024-03-14 12:03:16 +01:00
Sietse Jonker
072ff99624 Merge branch 'main' into '44-als-gebruiker-wil-ik-dat-de-website-automatisch-het-aantal-nodes-dat-ik-heb-aangesloten-op-de'
# Conflicts:
#   arduino/node-code/node-code-final/node-code-final.ino
#   arduino/node-code/node-code-final/nodeCodeFinal.ino
#   arduino/node-code/node-code-final/nodeCodeHeader.h
2024-03-14 12:02:13 +01:00
035a7f4c72 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-13 17:56:09 +01:00
23bfbdada5 Removed PK nodeID at measurement 2024-03-13 17:56:05 +01:00
47f1f393da Added parameters 2024-03-13 17:55:50 +01:00
Dano van den Bosch
10eee12189 Arduino oop adding functions from the original aduino code 2024-03-13 16:06:10 +01:00
Dano van den Bosch
c4880ce0e2 Added the header files to for changing the arduino code to OOP 2024-03-13 15:47:42 +01:00
Dano van den Bosch
3801b074f6 Arduino oop 2024-03-13 15:03:11 +01:00
Sietse Jonker
25de52c54b Refactor classes and update documentation 2024-03-13 14:53:40 +01:00
7b6f8463cd Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-13 14:45:33 +01:00
b8f8f5ea7e Added flask script 2024-03-13 14:45:29 +01:00
6efac7b179 New Flask documentation 2024-03-13 14:45:23 +01:00
023a1b0781 Moved files 2024-03-13 14:45:13 +01:00
Sietse Jonker
6c3b523208 Update webSocket message format and add classes for websockets 2024-03-13 14:44:32 +01:00
Bram Barbieri
7f5db74732 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-13 13:08:05 +01:00
Bram Barbieri
ddb7df5679 bram docs + daily standup 2024-03-13 13:08:03 +01:00
Dano van den Bosch
d7a762f30c Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-13 13:08:02 +01:00
Dano van den Bosch
85a49151ac JSON format message 2024-03-13 13:07:49 +01:00
Bram Barbieri
0ab0b433ab Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-13 12:49:49 +01:00
Bram Barbieri
8b0be0d6bd bram documentation 2024-03-13 12:49:48 +01:00
Dano van den Bosch
5d2223e5d7 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-13 11:49:29 +01:00
Dano van den Bosch
dd6b5caa33 Begin aan OOP in arduino 2024-03-13 11:49:25 +01:00
8da5b9f215 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-12 19:48:50 +01:00
4fd0badd3c Added Enquete box 2024-03-12 19:48:46 +01:00
15f897f4d9 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-12 16:24:30 +01:00
d542da7db9 attempt to write text in full 2024-03-12 16:24:26 +01:00
Bram Barbieri
8aeca410fc Bram documentation updated and code explained 2024-03-12 11:28:30 +01:00
Bram Barbieri
57ee918b64 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-12 11:06:56 +01:00
Bram Barbieri
57a556ab6c daily standup, bram documentation 2024-03-12 11:06:54 +01:00
1bafce0015 Added documentation 2024-03-12 11:05:11 +01:00
Bram Barbieri
fd260d9c56 Bram documentation spelling check 2024-03-11 16:17:46 +01:00
Bram Barbieri
f8489bca01 Bram documentation 2024-03-11 15:15:18 +01:00
Bram Barbieri
cc92eff4f8 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-11 14:46:31 +01:00
Bram Barbieri
4d0bd8aa43 Bram assets + docs 2024-03-11 14:46:28 +01:00
dec48091f4 Typo 2024-03-11 14:19:42 +01:00
Sam
3fe74603ca Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-11 13:52:09 +01:00
Sam
c90fda2977 Updated uml tft screen class 2024-03-11 13:52:06 +01:00
Bram Barbieri
b27f9f8ed6 Bram Evidence folder 2024-03-10 16:04:14 +01:00
Bram Barbieri
d21776cfc4 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-10 15:50:58 +01:00
Bram Barbieri
3bdc81b320 Bram Documentation 2024-03-10 15:50:55 +01:00
Sietse Jonker
856775c2a8 Update WiFi password and handle node addresses 2024-03-08 16:46:02 +01:00
sam
649ea5e1a6 Edited database 2024-03-08 14:25:33 +01:00
sam
60d86bc0d5 Added comments and cleanup 2024-03-08 14:25:24 +01:00
sam
77636f2a60 Documentation 2024-03-08 14:24:53 +01:00
Sietse Jonker
9acd2b44a8 Add header file and refactor code 2024-03-08 13:26:23 +01:00
Sietse Jonker
3886292110 Refactor code and update websocket connection 2024-03-08 12:58:33 +01:00
Dano van den Bosch
3a8998c00a Fix typo in software documentation path 2024-03-08 12:52:39 +01:00
Dano van den Bosch
5df0bfa0dc brodcast added 2024-03-08 11:46:46 +01:00
Sietse Jonker
08c9bedb44 adds mac adress code to arduino folder 2024-03-08 11:38:31 +01:00
Sam
28bfd3a300 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-07 19:55:05 +01:00
Sam
56abd5cbde removed libraryies and made delay longer 2024-03-07 19:55:02 +01:00
Sam
3b375266ee Moved libraries over 2024-03-07 19:54:48 +01:00
Sam
2351c515f3 Added function to header 2024-03-07 19:54:41 +01:00
Sam
aa6c35044e Added a function to attempt to diplay the words in full 2024-03-07 19:54:31 +01:00
Dano van den Bosch
67aaaca588 Merge branch '43-als-gebruiker-wil-ik-een-grafiek-hebben-met-live-data-zodat-de-dat-van-de-laatste-paar-minuten' into 'main'
Resolve "Als gebruiker wil ik een grafiek hebben met live data, zodat de dat van de laatste paar minuten live kan terugzien en veranderingen beter zie"

Closes #43

See merge request propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59!5
2024-03-07 14:26:19 +01:00
Dano van den Bosch
54f52bce48 path updated for page 2024-03-07 14:22:30 +01:00
Sietse Jonker
083858f9cf Merge branch 'Website_websocket' into 'main'
Website websocket

See merge request propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59!4
2024-03-07 14:20:52 +01:00
sietse jonker
866af9253e Add graph documentation 2024-03-07 14:20:21 +01:00
Dano van den Bosch
185a972f1b dev page documentation 2024-03-07 14:01:20 +01:00
Bram Barbieri
fb304af3a4 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-07 13:59:03 +01:00
Bram Barbieri
c7ee23afd7 Bram docs, daily standups 2024-03-07 13:59:01 +01:00
sietse jonker
598dd54521 Add new lines for temperature, humidity, eCO2, and TVOC in liveGraph class 2024-03-07 13:18:12 +01:00
Dano van den Bosch
9566148fa6 Merge branch 'Website_websocket' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 into Website_websocket 2024-03-07 13:11:03 +01:00
Dano van den Bosch
878fb9f491 Refactor JSON parsing and data handling functions 2024-03-07 13:11:01 +01:00
sietse jonker
1472c17125 Fix variable name and update amount of nodes 2024-03-07 13:09:28 +01:00
Sam
d1c962f71c added so the answer text is at the bottom 2024-03-07 13:04:14 +01:00
Sam
f2964ebce8 added new function to have text automaticly at the bottom 2024-03-07 13:03:58 +01:00
sietse jonker
0b8ae0ef34 Refactor main.js: Add descriptions, declare variables, and update loop condition 2024-03-07 13:03:28 +01:00
sietse jonker
bc8cc500cb Refactor code to dynamically create node data and live graphs 2024-03-07 13:00:22 +01:00
sietse jonker
2e394f3d45 Update liveGraphs to include temperature, humidity, eCO2, and TVOC data 2024-03-07 12:57:54 +01:00
sietse jonker
6070ba7480 edits css 2024-03-07 11:22:25 +01:00
sietse jonker
656cd83aee Refactor CSS styles and remove unnecessary code 2024-03-06 21:27:19 +01:00
sietse jonker
bd66f21082 Update interval delay and refactor liveGraph creation 2024-03-06 21:16:30 +01:00
Sietse Jonker
36277a7e5d Update file index.html 2024-03-06 20:56:19 +01:00
sietse jonker
2c0b7df0a1 Refactor HTML structure in index.html 2024-03-06 20:55:43 +01:00
Sietse Jonker
55f94387cc Merge branch 'Website_websocket' into 'main'
Website websocket to main

See merge request propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59!3
2024-03-06 20:36:11 +01:00
Sietse Jonker
24164841a9 Merge branch 'main' into 'Website_websocket'
# Conflicts:
#   arduino/node-code/node-code-final/node-code-final.ino
#   web/classes.js
#   web/index.html
#   web/main.js
#   web/styles.css
2024-03-06 20:35:56 +01:00
Sietse Jonker
c14c18deb0 Remove commented out code and update graph in main.js 2024-03-06 17:38:09 +01:00
sam
f4840775ed Added uml 2024-03-06 16:05:31 +01:00
Sietse Jonker
63be84e287 Update graph colors and scale for temperature, eCO2, and TVOC 2024-03-06 15:59:54 +01:00
Sietse Jonker
199283d3e0 Add live graph plots for humidity, eCO2, and TVOC 2024-03-06 15:51:01 +01:00
sam
27742cfa89 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-06 15:46:42 +01:00
sam
5a8e13c0d6 Added class 2024-03-06 15:46:39 +01:00
sam
284071b4ee Class creation 2024-03-06 15:46:32 +01:00
Sietse Jonker
8ed556d856 Refactor liveGraph class and updateNodeData function 2024-03-06 15:38:46 +01:00
Sietse Jonker
951fc64e6d adds graph class 2024-03-06 15:03:47 +01:00
Sietse Jonker
65783ac3b6 Add liveGraph class and update index.html 2024-03-06 15:02:34 +01:00
Sietse Jonker
9b01523f0e makes class for graphs 2024-03-06 15:01:20 +01:00
Dano van den Bosch
b971fe0b54 dev page documentation added to pages 2024-03-06 11:25:58 +01:00
Sietse Jonker
a2219fa03a Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-05 16:37:02 +01:00
Sietse Jonker
67d77d59d1 changes html and css for testing class 2024-03-05 16:36:58 +01:00
Sietse Jonker
db9c984446 adds class for graph 2024-03-05 16:36:42 +01:00
Dano van den Bosch
026bd92d65 I did it 😊 2024-03-05 16:03:15 +01:00
sam
698b3055a4 File creation + text centre + split array 2024-03-05 16:02:34 +01:00
sam
2b31f80655 File creation 2024-03-05 16:02:17 +01:00
sam
d3952306b2 Added reset 2024-03-05 16:02:12 +01:00
Dano van den Bosch
de1ae975a4 added code for muliple nodes 2024-03-05 14:46:43 +01:00
sam
f99d7b5c3d Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-05 14:22:43 +01:00
sam
21ef8604c2 changed asset 2024-03-05 14:22:40 +01:00
sam
e09651a90c Added asset 2024-03-05 14:22:06 +01:00
sam
0886352a1c added script 2024-03-05 14:21:57 +01:00
sam
307257eefc Added writetext function 2024-03-05 14:21:47 +01:00
sam
fba7ada367 Simple button script 2024-03-05 14:21:35 +01:00
Sietse Jonker
1596f0c641 Fix grammatical error from dano 2024-03-05 14:10:52 +01:00
Dano van den Bosch
3ebe661de0 Fix node identification number in webSocket message 2024-03-05 14:03:10 +01:00
Sietse Jonker
fed0adb299 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-05 13:48:56 +01:00
Sietse Jonker
7476f98590 Commented out debug print statements in webSocketEvent function 2024-03-05 13:48:54 +01:00
Dano van den Bosch
db9380816c added node identivication 2024-03-05 13:42:12 +01:00
Dano van den Bosch
d127a6001d Add WebSocket connection error handling and JSON in to array 2024-03-05 13:38:09 +01:00
Sietse Jonker
bcbb8080c2 Add Arduino code for sensor data collection and websocket communication 2024-03-05 11:40:25 +01:00
Sietse Jonker
072752cec8 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-05 11:27:31 +01:00
Sietse Jonker
9193a753ce Refactor survey questions and add conclusion 2024-03-05 11:27:29 +01:00
Dano van den Bosch
902031cfd5 Fixt arduino file location 2024-03-05 10:55:58 +01:00
Dano van den Bosch
d24744823b Set the websocket data to JSON format 2024-03-05 10:48:15 +01:00
Bram Barbieri
5b26d6b844 Bram documentation buzzers pt 2 2024-03-04 15:28:05 +01:00
Bram Barbieri
ce24a782ed Bram Documentation themperature sensors. 2024-03-04 14:15:16 +01:00
Sietse Jonker
5d9d377010 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-03-01 14:14:25 +01:00
Sietse Jonker
a70575d8b8 adds comments 2024-03-01 14:14:24 +01:00
Sietse Jonker
4db11e3035 adds gebruikerstest voor questions enquete 2024-03-01 14:14:11 +01:00
sam
20a5446c8c Added UML 2024-03-01 14:09:23 +01:00
sam
5c59dc033c Updated documentation 2024-03-01 14:00:45 +01:00
sam
ff296eefb0 Updated documenation 2024-03-01 13:56:17 +01:00
sam
2389c068bf Added new script 2024-03-01 13:52:36 +01:00
sam
f533e1a9c1 Added to pages 2024-03-01 13:52:16 +01:00
Bram Barbieri
7b48a4a04e standup 2024-03-01 11:48:30 +01:00
Dano van den Bosch
d1714fabec Added code for handeling websocket data, And made the html code fariable in a js function 2024-02-29 16:59:04 +01:00
Bram Barbieri
eee106a402 name change 2024-02-29 15:36:10 +01:00
Sam
5f88a8f495 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-29 14:50:58 +01:00
Sam
0d1da4503e Added documentation 2024-02-29 14:50:55 +01:00
Bram Barbieri
14b07da103 daily standup updated 2024-02-29 12:37:00 +01:00
Sietse Jonker
9238d9841e test commit 2024-02-28 12:09:34 +01:00
Sietse Jonker
734dca30bc fixes interval and stuff 2024-02-28 12:06:43 +01:00
Dano van den Bosch
503ef68e67 Add dev page and database setup on Raspberry Pi 2024-02-28 11:57:28 +01:00
sietse jonker
1d76c5ff7a fixes sgp30 sensor not displaying data 2024-02-28 09:40:06 +01:00
sietse jonker
3afc7797ab display function now executes every loop instead of 5 seconds 2024-02-28 09:24:16 +01:00
sietse jonker
ddb21adc52 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-27 21:55:48 +01:00
sietse jonker
b0731f739b adds last changes to code that clean it up 2024-02-27 21:55:47 +01:00
Bram Barbieri
982a275aa0 linux and rapsberry documentation bram 2024-02-27 20:45:42 +01:00
Bram Barbieri
3e82990c97 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-27 20:22:35 +01:00
Bram Barbieri
1b594b503a feedback and arduino video documentation bram 2024-02-27 20:22:33 +01:00
sietse jonker
dcb2f37694 finishes up code for node 2024-02-27 19:46:52 +01:00
sietse jonker
5558289ba2 cleans up code and adds comments 2024-02-27 19:17:47 +01:00
sietse jonker
dc3566f5e5 cleans up code and fixes counter 2024-02-27 19:06:27 +01:00
Sietse Jonker
63ad49675b Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-27 16:55:51 +01:00
Sietse Jonker
984e5e748d Add update functionality and counter variables 2024-02-27 16:55:48 +01:00
sam
17588c38b3 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-27 16:12:55 +01:00
sam
3f60a08695 Added definition of done 2024-02-27 16:12:51 +01:00
sam
53af1d5858 Added screen scripts 2024-02-27 16:12:43 +01:00
sam
766d03282b Added library 2024-02-27 16:12:33 +01:00
Sietse Jonker
540d80a545 Add WiFi and WebSockets functionality to node code 2024-02-27 16:11:07 +01:00
Sietse Jonker
a084960f0f Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-27 15:35:08 +01:00
Sietse Jonker
9adbde7e5c adds websocket code for esp32 2024-02-27 15:35:07 +01:00
Bram Barbieri
79ec11a7a2 samenwerkings tijdlijn gepost 2024-02-27 13:43:06 +01:00
sam
cf6aaa2f33 Samenwerkingscontract 2024-02-16 16:56:48 +01:00
Dano van den Bosch
71981d193a Update navigation links and styling*** 2024-02-16 13:15:38 +01:00
Dano van den Bosch
9255b8ab97 Refactor HTML and JavaScript code, update graph data 2024-02-16 12:28:41 +01:00
Sietse Jonker
44b1317e33 save website from rpi 2024-02-16 11:56:11 +01:00
sam
16105122dd Added page 2024-02-16 11:25:10 +01:00
sam
a0f8378cc9 deurMat 2024-02-16 10:57:03 +01:00
sam
270cff0435 Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-16 10:46:45 +01:00
sam
955dab9dd4 Added additional info about feedback 2024-02-16 10:44:43 +01:00
Sam
515792b03f Updated mermaid requirements 2024-02-15 20:10:42 +01:00
Sam
6ddb09112e Update infrastructure UML 2024-02-15 20:06:13 +01:00
Sam
aa31eeaaef Added solution 2024-02-15 20:01:40 +01:00
Sam
26f075ee78 Name change 2024-02-15 19:55:17 +01:00
Sam
22e30063c4 Updated pages 2024-02-15 19:55:12 +01:00
Dano van den Bosch
35117663b1 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-15 16:29:40 +01:00
Dano van den Bosch
613a01924d Mic arduino files 2024-02-15 16:29:36 +01:00
sietse jonker
ea8cbe7c88 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-15 14:15:56 +01:00
sietse jonker
e6b3e07a71 adds assembly documentation of node and changes 2024-02-15 14:15:55 +01:00
Sam
154b10b66c Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-15 14:05:09 +01:00
Sam
885d2978a2 Added reverse proxy documentation 2024-02-15 14:05:05 +01:00
Bram Barbieri
b622902221 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-15 12:07:20 +01:00
Bram Barbieri
ccfa8c75d0 questions updated 2024-02-15 12:04:57 +01:00
sietse jonker
faa49c7a21 adds cad file from node casing 2024-02-15 11:09:20 +01:00
sietse jonker
02c92a9a70 adds criteria to enquete questions 2024-02-15 11:03:17 +01:00
Bram Barbieri
c0af3e3cd4 updated design node 2024-02-15 10:46:50 +01:00
Bram Barbieri
d3f810ecf7 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-15 10:42:39 +01:00
Bram Barbieri
ce88a119c6 feedback updated 2024-02-15 10:42:37 +01:00
sietse jonker
23a2f623a6 adds credit on work 2024-02-14 23:07:59 +01:00
sietse jonker
1ba6b305bb adds node design files to assets 2024-02-14 23:07:51 +01:00
sietse jonker
8ee0774602 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-14 23:00:02 +01:00
sietse jonker
41b678bf9c adds documentation about node design in fusion360 2024-02-14 23:00:00 +01:00
Bram Barbieri
55fbb73a89 feedback verwerkt in node design. 2024-02-14 22:51:09 +01:00
sam
816f25757f Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-14 17:18:37 +01:00
sam
85fc96cb63 Spelling updates 2024-02-14 17:18:33 +01:00
sam
ceb52b70fa Added documentation about issues with websockets 2024-02-14 17:18:25 +01:00
sam
fc0b96ec0a Added feedback 2024-02-14 17:18:09 +01:00
Sietse Jonker
5791b373e9 Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-14 16:58:09 +01:00
Sietse Jonker
bfeb8169eb updates node code 2024-02-14 16:58:07 +01:00
Sietse Jonker
e8ab30fbb1 adds website for rpi 2024-02-14 16:58:00 +01:00
Dano van den Bosch
0d00f4a874 Update studieruimte opdracht en sensoren 2024-02-14 16:06:49 +01:00
Bram Barbieri
b276ef1199 Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-14 15:42:50 +01:00
Bram Barbieri
183f49f8c6 documentation of The sirst sketches and images added 2024-02-14 15:42:48 +01:00
Dano van den Bosch
762dbee696 spelling check 2024-02-14 15:27:00 +01:00
Dano van den Bosch
39250f33d8 Spelling check 2024-02-14 15:26:57 +01:00
Dano van den Bosch
ef90e4000a edited spelling 2024-02-14 15:22:47 +01:00
Dano van den Bosch
8a664f39ae Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59 2024-02-14 15:18:25 +01:00
Dano van den Bosch
26d88ce281 Update formatting and fix typos in raspberryPi.md 2024-02-14 15:18:23 +01:00
Dano van den Bosch
d253fd8394 Add sprint1Revieuw.md file with sprint review content 2024-02-14 15:18:19 +01:00
Sietse Jonker
23a3bc2cb2 Add Arduino code for environmental monitoring 2024-02-14 14:07:53 +01:00
Sietse Jonker
ccd94c260e Add initial version of node-code-final.ino 2024-02-14 11:11:27 +01:00
147 changed files with 7233 additions and 39 deletions

View File

@@ -0,0 +1,40 @@
//connect the 3v3 directly to the button and the other end of the button to a pin.
//this script adds a digital resistor so you dont have to add one yourself
const int buttonPin = 21; // the number of the pushbutton pin
const int buttonPin1 = 1; // the number of the pushbutton pin
const int buttonPin2 = 37; // the number of the pushbutton pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int buttonState1 = 0; // variable for reading the pushbutton status
int buttonState2 = 0; // variable for reading the pushbutton status
void setup() {
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT_PULLDOWN);
Serial.begin(9600);
}
void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == HIGH) {
Serial.println("ik ben high");
}
else if (buttonState1 == HIGH){
Serial.println("ik ben higher");
}
else if (buttonState2 == HIGH){
Serial.println("ik ben highest");
}
else {
// turn LED off:
}
}

41
arduino/Mic/Mic.ino Normal file
View File

@@ -0,0 +1,41 @@
const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz)
int const AMP_PIN = 7; // Preamp output pin connected to A0
unsigned int sample;
void setup()
{
Serial.begin(9600);
}
void loop()
{
unsigned long startMillis = millis(); // Start of sample window
unsigned int peakToPeak = 0; // peak-to-peak level
unsigned int signalMax = 0;
unsigned int signalMin = 1024;
// collect data for 50 mS and then plot data
while (millis() - startMillis < sampleWindow)
{
sample = analogRead(AMP_PIN);
if (sample < 1024) // toss out spurious readings
{
if (sample > signalMax)
{
signalMax = sample; // save just the max levels
}
else if (sample < signalMin)
{
signalMin = sample; // save just the min levels
}
}
}
peakToPeak = signalMax - signalMin; // max - min = peak-peak amplitude
if (peakToPeak == 4294966272){
peakToPeak = 0;
}
Serial.println(peakToPeak);
//double volts = (peakToPeak * 5.0) / 1024; // convert to volts
//Serial.println(volts);
}

View File

@@ -0,0 +1,7 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
"version": "0.2.0",
"configurations": [
]
}

View File

@@ -0,0 +1,115 @@
#include "headerFile.h"
int i = 0;
int questionID = 1;
char* Question[] = {
"How clean are the toilets?",
"How clean is the study area?",
"What do you think of the temperature in the study area?",
"How crowded would you say the study area is?",
"Is there enough help available?"
};
char* Answer[] = {
"clean, normal, disgusting",
"clean, normal, disgusting",
"hot, perfect, cold",
"not at all, its fine, really crowded",
"no, decently, yes"
};
Adafruit_ST7796S_kbv tft = Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, MOSI, SCK, TFT_RST, MISO);
DisplayText displayText(tft);
void setup() {
//buttonpins
pinMode(16, INPUT_PULLDOWN);
pinMode(17, INPUT_PULLDOWN);
pinMode(18, INPUT_PULLDOWN);
Serial.begin(9600);
tft.begin(); // Initialize the display
tft.setRotation(3); // Set the rotation to horizontal
tft.fillScreen(ST7796S_BLACK);
displayText.writeText("Loading...", 3, 0, 200, 0, true, true);
websocketSetup();
}
void loop() {
webSocket.loop();
screenButtonHandler();
}
void websocketSetup(){
WiFiMulti.addAP("iotroam", "BcgrFpX3kl");
WiFiMulti.addAP("ObsidianAmstelveen", "drijversstraatmaastricht");
while(WiFiMulti.run() != WL_CONNECTED) {
delay(100);
}
// server address, port and URL
webSocket.begin("145.92.8.114", 80, "/ws");
// try ever 500 again if connection has failed
webSocket.setReconnectInterval(500);
}
void screenButtonHandler(){
int redButton = digitalRead(16);
int whiteButton = digitalRead(17);
int greenButton = digitalRead(18);
if (initialized) {
initialized = false;
tft.fillScreen(ST7796S_BLACK);
displayText.writeText(Question[i], 3, 0, 0, 0, true, false);
displayText.writeText(Answer[i], 3, 0, 200, 0, true, true);
}
// 0 is best 2 is worst
if (redButton == HIGH){
sendData(questionID, "0");
}
if (whiteButton == HIGH){
sendData(questionID, "1");
}
if (greenButton == HIGH){
sendData(questionID, "2");
}
if (redButton || whiteButton || greenButton) {
i++;
questionID++;
if (questionID == 6){
questionID = 1;
}
if (i == 5) {
i = 0;
}
tft.fillScreen(ST7796S_BLACK);
displayText.writeText(Question[i], 3, 0, 0, 0, true, false);
displayText.writeText(Answer[i], 3, 0, 200, 0, true, true);
}
}
void sendData(int question, String answer){
webSocket.sendTXT("{\"node\": \"" + String(WiFi.macAddress()) + "\", \"Response\":\"" + String(answer) + "\",\"QuestionID\":\"" + String(question) + "\"}");
}
void hexdump(const void *mem, uint32_t len, uint8_t cols = 16) {
const uint8_t* src = (const uint8_t*) mem;
USE_SERIAL.printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len);
for(uint32_t i = 0; i < len; i++) {
if(i % cols == 0) {
USE_SERIAL.printf("\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i);
}
USE_SERIAL.printf("%02X ", *src);
src++;
}
USE_SERIAL.printf("\n");
}

View File

@@ -0,0 +1,106 @@
#include "displayText.h"
#include "Arduino.h"
//constructor
DisplayText::DisplayText(Adafruit_ST7796S_kbv& tftDisplay) : tft(tftDisplay) {
tft.setCursor(0,0);
tft.fillScreen(ST7796S_BLACK);
}
//display text public function
void DisplayText::writeText(char* text, int size, int posX, int posY, int screenTime, bool center, bool bottom) {
if (center) {
posX = centerText(text);
}
// if (bottom) {
// posY = bottomText(text);
// }
tft.setCursor(posX, posY);
tft.setTextSize(size);
printWordsFull(text, bottom);
delay(screenTime);
}
//to center the text when enabled in the public function
int DisplayText::centerText(char* text) {
int16_t x1, y1;
uint16_t w, h;
tft.getTextBounds(text, 0, 0, &x1, &y1, &w, &h);
int x = (tft.width() - w) / 2;
return x;
}
// //to display the text at the bottom when enabled in the public function
// int DisplayText::bottomText(char* text) {
// int16_t x1, y1;
// uint16_t w, h;
// tft.getTextBounds(text, 0, 0, &x1, &y1, &w, &h);
// int y = (tft.height() - h);
// return y;
// }
//attempt to write the text out in full (wip)
void DisplayText::printWordsFull(char* text, bool bottom) {
const int screenWidth = 480; // replace with your TFT display width
const int lineHeight = 30; // replace with your text line height
//the double copy is needed so it doesnt alter the original text
char* newtext1 = strdup(text); // Create a copy of the string for the first strtok_r
char* newtext2 = strdup(text); // Create a second copy for the second strtok_r
char* saveptr1, *saveptr2;
char* word = strtok_r(newtext1, " ", &saveptr1);
char line[100] = "";
int lineCount = 0;
int lineWidth = 0;
// Calculate total number of lines
int totalLines = 0;
char* tempWord = strtok_r(newtext2, " ", &saveptr2);
while (tempWord != NULL) {
int16_t x1, y1;
uint16_t w, h;
tft.getTextBounds(tempWord, 0, 0, &x1, &y1, &w, &h);
if (lineWidth + w > screenWidth && strlen(line) > 0) {
//if the line width is greater than the screen width, then we need to add a new line
totalLines++;
lineWidth = w;
//otherwise we just add the width of the word to the line width
} else {
lineWidth += w;
}
tempWord = strtok_r(NULL, " ", &saveptr2);
}
totalLines++; // Add one for the last line
// Reset variables for actual printing
strcpy(line, "");
lineWidth = 0;
while (word != NULL) {
int16_t x1, y1;
uint16_t w, h;
tft.getTextBounds(word, 0, 0, &x1, &y1, &w, &h);
if (lineWidth + w > screenWidth && strlen(line) > 0) {
int y = bottom ? tft.height() - lineHeight * (totalLines - lineCount) : lineHeight * lineCount;
tft.setCursor(0, y);
tft.println(line);
lineCount++;
strcpy(line, word);
strcat(line, " ");
lineWidth = w;
} else {
strcat(line, word);
strcat(line, " ");
lineWidth += w;
}
word = strtok_r(NULL, " ", &saveptr1);
}
// print the last line
int y = bottom ? tft.height() - lineHeight * (totalLines - lineCount) : lineHeight * lineCount;
tft.setCursor(0, y);
tft.println(line);
free(newtext1); // Free the memory allocated by strdup
free(newtext2); // Free the memory allocated by strdup
}

View File

@@ -0,0 +1,19 @@
#ifndef DISPLAYTEXT_H
#define DISPLAYTEXT_H
#include "Adafruit_GFX.h"
#include "Adafruit_ST7796S_kbv.h"
class DisplayText {
private:
Adafruit_ST7796S_kbv& tft;
int centerText(char* text);
// int bottomText(char* text);
void printWordsFull(char* text, bool bottom);
public:
DisplayText(Adafruit_ST7796S_kbv& tftDisplay);
void writeText(char* text, int size, int posX, int posY, int screenTime, bool center, bool bottom);
};
#endif

View File

@@ -0,0 +1,22 @@
//screen stuff
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ST7796S_kbv.h"
#include "displayText.h"
#define TFT_CS 14
#define TFT_DC 13
#define TFT_RST 12
#define MOSI 11
#define SCK 10
#define MISO 9
//websocket stuff
#include <WiFiMulti.h>
#include <WiFi.h>
#include <WebSocketsClient.h>
#define USE_SERIAL Serial
WiFiMulti WiFiMulti;
WebSocketsClient webSocket;
bool initialized = true;

View File

@@ -0,0 +1,40 @@
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ST7796S_kbv.h"
#define TFT_CS 14
#define TFT_DC 13
#define TFT_RST 12 // RST can be set to -1 if you tie it to Arduino's reset
#define MOSI 11
#define SCK 10
#define MISO 9
//simplify the name of the library
Adafruit_ST7796S_kbv tft = Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, MOSI, SCK, TFT_RST, MISO);
void setup() {
tft.begin(); // Initialize the display
tft.setRotation(3); // Set the rotation
tft.fillScreen(ST7796S_BLACK); // Fill the screen with black color
tft.setTextColor(ST7796S_WHITE); // Set the text color to white
tft.setTextSize(2); // Set the text size to 2
}
void loop() {
tft.setTextSize(5); // Set textsize
tft.setCursor(0, 0); // Set the cursor to the top left corner
//the cursor is where it types the text or shape on the screen, 0,0 is the topleft
tft.println("Hello, world!"); // Print the text
delay(2000); // Wait for 2 seconds
tft.fillScreen(ST7796S_BLACK); // Clear the screen
tft.setCursor(0, 0); // Set the cursor to the top left corner
tft.println("New text!"); // Print the new text
delay(2000); // Wait for 2 seconds
tft.fillScreen(ST7796S_BLACK); // Clear the screen
}

View File

@@ -0,0 +1,327 @@
/***************************************************
This is our library for the Adafruit HX8357D Breakout
----> http://www.adafruit.com/products/2050
Check out the links above for our tutorials and wiring diagrams
These displays use SPI to communicate, 4 or 5 pins are required to
interface (RST is optional)
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution
****************************************************/
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ST7796S_kbv.h"
// These are 'flexible' lines that can be changed
#define TFT_CS 14
#define TFT_DC 13
#define TFT_RST 12 // RST can be set to -1 if you tie it to Arduino's reset
#define MOSI 11
#define SCK 10
#define MISO 9
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
//Adafruit_ST7796S_kbv tft = Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, TFT_RST);
// SoftSPI - note that on some processors this might be *faster* than hardware SPI!
Adafruit_ST7796S_kbv tft = Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, MOSI, SCK, TFT_RST, MISO);
void setup() {
Serial.begin(9600);
Serial.println("ST7796S_kbv Test!");
tft.begin();
// read diagnostics (optional but can help debug problems)
uint8_t x = tft.readcommand8(ST7796S_RDMODE);
Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);
x = tft.readcommand8(ST7796S_RDMADCTL);
Serial.print("MADCTL Mode: 0x"); Serial.println(x, HEX);
x = tft.readcommand8(ST7796S_RDPIXFMT);
Serial.print("Pixel Format: 0x"); Serial.println(x, HEX);
x = tft.readcommand8(ST7796S_RDIMGFMT);
Serial.print("Image Format: 0x"); Serial.println(x, HEX);
x = tft.readcommand8(ST7796S_RDSELFDIAG);
Serial.print("Self Diagnostic: 0x"); Serial.println(x, HEX);
Serial.println(F("Benchmark Time (microseconds)"));
tft.setRotation(1);
Serial.print(F("Text "));
Serial.println(testText());
delay(500);
Serial.print(F("Lines "));
Serial.println(testLines(ST7796S_CYAN));
delay(500);
Serial.print(F("Rectangles (outline) "));
Serial.println(testRects(ST7796S_GREEN));
delay(500);
tft.fillScreen(ST7796S_BLACK);
Serial.print(F("Circles (outline) "));
Serial.println(testCircles(10, ST7796S_RED));
delay(500);
Serial.print(F("Triangles (outline) "));
Serial.println(testTriangles());
delay(500);
Serial.print(F("Triangles (filled) "));
Serial.println(testFilledTriangles());
delay(500);
Serial.print(F("Rounded rects (outline) "));
Serial.println(testRoundRects());
delay(500);
Serial.print(F("Rounded rects (filled) "));
Serial.println(testFilledRoundRects());
delay(500);
Serial.println(F("Done!"));
}
void loop(void) {
for(uint8_t rotation=0; rotation<4; rotation++) {
tft.setRotation(rotation);
testText();
delay(1000);
}
}
unsigned long testFillScreen() {
unsigned long start = micros();
tft.fillScreen(ST7796S_RED);
tft.fillScreen(ST7796S_GREEN);
tft.fillScreen(ST7796S_BLUE);
tft.fillScreen(ST7796S_WHITE);
return micros() - start;
}
unsigned long testText() {
tft.fillScreen(ST7796S_BLACK);
unsigned long start = micros();
tft.setCursor(0, 0);
tft.setTextColor(ST7796S_WHITE); tft.setTextSize(1);
tft.println("Hello World!");
tft.setTextColor(ST7796S_YELLOW); tft.setTextSize(2);
tft.println(1234.56);
tft.setTextColor(ST7796S_RED); tft.setTextSize(3);
tft.println(0xDEADBEEF, HEX);
tft.println();
tft.setTextColor(ST7796S_GREEN);
tft.setTextSize(5);
tft.println("Groop");
tft.setTextSize(2);
tft.println("I implore thee,");
tft.setTextSize(1);
tft.println("my foonting turlingdromes.");
tft.println("And hooptiously drangle me");
tft.println("with crinkly bindlewurdles,");
tft.println("Or I will rend thee");
tft.println("in the gobberwarts");
tft.println("with my blurglecruncheon,");
tft.println("see if I don't!");
tft.setTextColor(ST7796S_WHITE);
tft.println(F("Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, 'and what is the use of a book,' thought Alice 'without pictures or conversations?'"));
tft.println(F("So she was considering in her own mind (as well as she could, for the hot day made her feel very sleepy and stupid), whether the pleasure of making a daisy-chain would be worth the trouble of getting up and picking the daisies, when suddenly a White Rabbit with pink eyes ran close by her."));
tft.println(F("There was nothing so very remarkable in that; nor did Alice think it so very much out of the way to hear the Rabbit say to itself, 'Oh dear! Oh dear! I shall be late!' (when she thought it over afterwards, it occurred to her that she ought to have wondered at this, but at the time it all seemed quite natural); but when the Rabbit actually took a watch out of its waistcoat-pocket, and looked at it, and then hurried on, Alice started to her feet, for it flashed across her mind that she had never before seen a rabbit with either a waistcoat-pocket, or a watch to take out of it, and burning with curiosity, she ran across the field after it, and fortunately was just in time to see it pop down a large rabbit-hole under the hedge."));
tft.println(F("In another moment down went Alice after it, never once considering how in the world she was to get out again."));
tft.println(F("The rabbit-hole went straight on like a tunnel for some way, and then dipped suddenly down, so suddenly that Alice had not a moment to think about stopping herself before she found herself falling down a very deep well."));
tft.println(F("Either the well was very deep, or she fell very slowly, for she had plenty of time as she went down to look about her and to wonder what was going to happen next. First, she tried to look down and make out what she was coming to, but it was too dark to see anything; then she looked at the sides of the well, and noticed that they were filled with cupboards and book-shelves; here and there she saw maps and pictures hung upon pegs. She took down a jar from one of the shelves as she passed; it was labelled 'ORANGE MARMALADE', but to her great disappointment it was empty: she did not like to drop the jar for fear of killing somebody, so managed to put it into one of the cupboards as she fell past it."));
return micros() - start;
}
unsigned long testLines(uint16_t color) {
unsigned long start, t;
int x1, y1, x2, y2,
w = tft.width(),
h = tft.height();
tft.fillScreen(ST7796S_BLACK);
x1 = y1 = 0;
y2 = h - 1;
start = micros();
for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
x2 = w - 1;
for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
t = micros() - start; // fillScreen doesn't count against timing
return micros() - start;
}
unsigned long testFastLines(uint16_t color1, uint16_t color2) {
unsigned long start;
int x, y, w = tft.width(), h = tft.height();
tft.fillScreen(ST7796S_BLACK);
start = micros();
for(y=0; y<h; y+=5) tft.drawFastHLine(0, y, w, color1);
for(x=0; x<w; x+=5) tft.drawFastVLine(x, 0, h, color2);
return micros() - start;
}
unsigned long testRects(uint16_t color) {
unsigned long start;
int n, i, i2,
cx = tft.width() / 2,
cy = tft.height() / 2;
tft.fillScreen(ST7796S_BLACK);
n = min(tft.width(), tft.height());
start = micros();
for(i=2; i<n; i+=6) {
i2 = i / 2;
tft.drawRect(cx-i2, cy-i2, i, i, color);
}
return micros() - start;
}
unsigned long testFilledRects(uint16_t color1, uint16_t color2) {
unsigned long start, t = 0;
int n, i, i2,
cx = tft.width() / 2 - 1,
cy = tft.height() / 2 - 1;
tft.fillScreen(ST7796S_BLACK);
n = min(tft.width(), tft.height());
for(i=n; i>0; i-=6) {
i2 = i / 2;
start = micros();
tft.fillRect(cx-i2, cy-i2, i, i, color1);
t += micros() - start;
// Outlines are not included in timing results
tft.drawRect(cx-i2, cy-i2, i, i, color2);
}
return t;
}
unsigned long testFilledCircles(uint8_t radius, uint16_t color) {
unsigned long start;
int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2;
tft.fillScreen(ST7796S_BLACK);
start = micros();
for(x=radius; x<w; x+=r2) {
for(y=radius; y<h; y+=r2) {
tft.fillCircle(x, y, radius, color);
}
}
return micros() - start;
}
unsigned long testCircles(uint8_t radius, uint16_t color) {
unsigned long start;
int x, y, r2 = radius * 2,
w = tft.width() + radius,
h = tft.height() + radius;
// Screen is not cleared for this one -- this is
// intentional and does not affect the reported time.
start = micros();
for(x=0; x<w; x+=r2) {
for(y=0; y<h; y+=r2) {
tft.drawCircle(x, y, radius, color);
}
}
return micros() - start;
}
unsigned long testTriangles() {
unsigned long start;
int n, i, cx = tft.width() / 2 - 1,
cy = tft.height() / 2 - 1;
tft.fillScreen(ST7796S_BLACK);
n = min(cx, cy);
start = micros();
for(i=0; i<n; i+=5) {
tft.drawTriangle(
cx , cy - i, // peak
cx - i, cy + i, // bottom left
cx + i, cy + i, // bottom right
tft.color565(200, 20, i));
}
return micros() - start;
}
unsigned long testFilledTriangles() {
unsigned long start, t = 0;
int i, cx = tft.width() / 2 - 1,
cy = tft.height() / 2 - 1;
tft.fillScreen(ST7796S_BLACK);
start = micros();
for(i=min(cx,cy); i>10; i-=5) {
start = micros();
tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
tft.color565(0, i, i));
t += micros() - start;
tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
tft.color565(i, i, 0));
}
return t;
}
unsigned long testRoundRects() {
unsigned long start;
int w, i, i2,
cx = tft.width() / 2 ,
cy = tft.height() / 2 ;
tft.fillScreen(ST7796S_BLACK);
w = min(tft.width(), tft.height());
start = micros();
for(i=0; i<w; i+=8) {
i2 = i / 2 - 2;
tft.drawRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(i, 100, 100));
}
return micros() - start;
}
unsigned long testFilledRoundRects() {
unsigned long start;
int i, i2,
cx = tft.width() / 2 + 10,
cy = tft.height() / 2 + 10;
tft.fillScreen(ST7796S_BLACK);
start = micros();
for(i=min(tft.width(), tft.height()) - 20; i>25; i-=6) {
i2 = i / 2;
tft.fillRoundRect(cx-i2, cy-i2, i-20, i-20, i/8, tft.color565(100, i/2, 100));
}
return micros() - start;
}

View File

@@ -0,0 +1,106 @@
#include "displayText.h"
#include "Arduino.h"
//constructor
DisplayText::DisplayText(Adafruit_ST7796S_kbv& tftDisplay) : tft(tftDisplay) {
tft.setCursor(0,0);
tft.fillScreen(ST7796S_BLACK);
}
//display text public function
void DisplayText::writeText(char* text, int size, int posX, int posY, int screenTime, bool center, bool bottom) {
if (center) {
posX = centerText(text);
}
// if (bottom) {
// posY = bottomText(text);
// }
tft.setCursor(posX, posY);
tft.setTextSize(size);
printWordsFull(text, bottom);
delay(screenTime);
}
//to center the text when enabled in the public function
int DisplayText::centerText(char* text) {
int16_t x1, y1;
uint16_t w, h;
tft.getTextBounds(text, 0, 0, &x1, &y1, &w, &h);
int x = (tft.width() - w) / 2;
return x;
}
// //to display the text at the bottom when enabled in the public function
// int DisplayText::bottomText(char* text) {
// int16_t x1, y1;
// uint16_t w, h;
// tft.getTextBounds(text, 0, 0, &x1, &y1, &w, &h);
// int y = (tft.height() - h);
// return y;
// }
//attempt to write the text out in full (wip)
void DisplayText::printWordsFull(char* text, bool bottom) {
const int screenWidth = 480; // replace with your TFT display width
const int lineHeight = 30; // replace with your text line height
//the double copy is needed so it doesnt alter the original text
char* newtext1 = strdup(text); // Create a copy of the string for the first strtok_r
char* newtext2 = strdup(text); // Create a second copy for the second strtok_r
char* saveptr1, *saveptr2;
char* word = strtok_r(newtext1, " ", &saveptr1);
char line[100] = "";
int lineCount = 0;
int lineWidth = 0;
// Calculate total number of lines
int totalLines = 0;
char* tempWord = strtok_r(newtext2, " ", &saveptr2);
while (tempWord != NULL) {
int16_t x1, y1;
uint16_t w, h;
tft.getTextBounds(tempWord, 0, 0, &x1, &y1, &w, &h);
if (lineWidth + w > screenWidth && strlen(line) > 0) {
//if the line width is greater than the screen width, then we need to add a new line
totalLines++;
lineWidth = w;
//otherwise we just add the width of the word to the line width
} else {
lineWidth += w;
}
tempWord = strtok_r(NULL, " ", &saveptr2);
}
totalLines++; // Add one for the last line
// Reset variables for actual printing
strcpy(line, "");
lineWidth = 0;
while (word != NULL) {
int16_t x1, y1;
uint16_t w, h;
tft.getTextBounds(word, 0, 0, &x1, &y1, &w, &h);
if (lineWidth + w > screenWidth && strlen(line) > 0) {
int y = bottom ? tft.height() - lineHeight * (totalLines - lineCount) : lineHeight * lineCount;
tft.setCursor(0, y);
tft.println(line);
lineCount++;
strcpy(line, word);
strcat(line, " ");
lineWidth = w;
} else {
strcat(line, word);
strcat(line, " ");
lineWidth += w;
}
word = strtok_r(NULL, " ", &saveptr1);
}
// print the last line
int y = bottom ? tft.height() - lineHeight * (totalLines - lineCount) : lineHeight * lineCount;
tft.setCursor(0, y);
tft.println(line);
free(newtext1); // Free the memory allocated by strdup
free(newtext2); // Free the memory allocated by strdup
}

View File

@@ -0,0 +1,19 @@
#ifndef DISPLAYTEXT_H
#define DISPLAYTEXT_H
#include "Adafruit_GFX.h"
#include "Adafruit_ST7796S_kbv.h"
class DisplayText {
private:
Adafruit_ST7796S_kbv& tft;
int centerText(char* text);
// int bottomText(char* text);
void printWordsFull(char* text, bool bottom);
public:
DisplayText(Adafruit_ST7796S_kbv& tftDisplay);
void writeText(char* text, int size, int posX, int posY, int screenTime, bool center, bool bottom);
};
#endif

View File

@@ -0,0 +1,43 @@
#include "headerFile.h"
int i = 0;
char* Question[] = {
"How clean are the toilets?",
"How clean is the study area?",
"What do you think of the temperature in the study area?",
"How crowded would you say the study area is?",
"Is there enough help available?"
};
char* Answer[] = {
"clean, normal, disgusting",
"clean, normal, disgusting",
"hot, perfect, cold",
"not at all, its fine, really crowded",
"no, decently, yes"
};
//simplify the name of the library
Adafruit_ST7796S_kbv tft = Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, MOSI, SCK, TFT_RST, MISO);
DisplayText displayText(tft);
void setup() {
tft.begin(); // Initialize the display
tft.setRotation(3); // Set the rotation to horizontal
}
void loop() {
i++;
if (i == 5) {
i = 0;
}
tft.fillScreen(ST7796S_BLACK); // Fill the screen with black color
// writeText(Question[0], 2, 50, 0, 0);
// writeText(Answer[0], 2, 50, 300, 4000);
displayText.writeText(Question[i], 3, 0, 0, 0, true, false);
displayText.writeText(Answer[i], 3, 0, 200, 0, true, true);
delay(2000);
}

View File

@@ -0,0 +1,11 @@
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ST7796S_kbv.h"
#include "displayText.h"
#define TFT_CS 14
#define TFT_DC 13
#define TFT_RST 12
#define MOSI 11
#define SCK 10
#define MISO 9

View File

@@ -0,0 +1,53 @@
//styling still needs to be done.
//this code is to display the questions on the screen.
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ST7796S_kbv.h"
#define TFT_CS 14
#define TFT_DC 13
#define TFT_RST 12
#define MOSI 11
#define SCK 10
#define MISO 9
char* Question[] = {
"How clean are the toilets? (clean, normal, disgusting).",
"How clean is the study area? (clean, normal, disgusting).",
"What do you think of the temperature in the study area? (hot, perfect, cold).",
"How crowded would you say the study area is?(not at all, its fine, really crowded).",
"Is there enough help available? (no, decently, yes)"
};
//simplify the name of the library
Adafruit_ST7796S_kbv tft = Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, MOSI, SCK, TFT_RST, MISO);
void setup() {
tft.begin(); // Initialize the display
tft.setRotation(3); // Set the rotation to horizontal
tft.fillScreen(ST7796S_BLACK); // Fill the screen with black color
tft.setTextColor(ST7796S_WHITE); // Set the text color to white
tft.setTextSize(2); // Set the text size to 2
Serial.begin(9600);
}
void loop() {
tft.setTextSize(2); // Set textsize
tft.setCursor(0, 0); // Set the cursor to the top left corner
//the cursor is where it types the text or shape on the screen, 0,0 is the topleft
tft.println("Hello, world!"); // Print the text
delay(2000); // Wait for 2 seconds
tft.fillScreen(ST7796S_BLACK); // Clear the screen
tft.setCursor(0, 0); // Set the cursor to the top left corner
tft.println("New text!"); // Print the new text
delay(2000); // Wait for 2 seconds
tft.fillScreen(ST7796S_BLACK); // Clear the screen
tft.setCursor(0, 0); // Set the cursor to the top left corner
tft.println(Question[1]);
delay(10000); //delay set a longer delay so the long text can write out
}

View File

@@ -0,0 +1,40 @@
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ST7796S_kbv.h"
#include "headerFile.h"
char* Question[] = {
"How clean are the toilets? (clean, normal, disgusting).",
"How clean is the study area? (clean, normal, disgusting).",
"What do you think of the temperature in the study area? (hot, perfect, cold).",
"How crowded would you say the study area is?(not at all, its fine, really crowded).",
"Is there enough help available? (no, decently, yes)"
};
//simplify the name of the library
Adafruit_ST7796S_kbv tft = Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, MOSI, SCK, TFT_RST, MISO);
void setup() {
tft.begin(); // Initialize the display
tft.setRotation(3); // Set the rotation to horizontal
tft.fillScreen(ST7796S_BLACK);
}
void loop() {
writeText(Question[0], 2, 0, 0, 4000);
writeText(Question[1], 2, 0, 0, 4000);
writeText(Question[2], 2, 0, 0, 4000);
}
void writeText(char* text, int size, int posX, int posY, int screenTime){
tft.fillScreen(ST7796S_BLACK); // Fill the screen with black color
tft.setCursor(posX, posY); // Set the cursor to the top left corner
tft.setTextSize(size); // Set textsize
tft.println(text);
delay(screenTime);
}

13
arduino/mac_adress.ino Normal file
View File

@@ -0,0 +1,13 @@
// Complete Instructions to Get and Change ESP MAC Address: https://RandomNerdTutorials.com/get-change-esp32-esp8266-mac-address-arduino/
#include <WiFi.h>
void setup(){
Serial.begin(115200);
Serial.println();
Serial.print("ESP Board MAC Address: ");
Serial.println(WiFi.macAddress());
}
void loop(){
}

View File

@@ -0,0 +1,54 @@
#ifndef headerFile_h
#define headerFile_h
// include these libraries
#include <Wire.h>
// #include <Adafruit_SH110X.h>
// #include <Adafruit_SGP30.h>
// #include "DHT.h"
#include <WiFiMulti.h>
#include <WiFi.h>
// #include <WebSocketsClient.h>
// #include <nodeCodeHeader.h>
// #include <websockets.h>
// define pins on esp32
#define MICPIN 6
#define DHTPIN 7
#define SCL 9
#define SDA 8
#define DHTTYPE DHT11
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define i2c_adress 0x3c
#define OLED_RESET -1 // QT-PY / XIAO
#define USE_SERIAL Serial
// make new objects
// Adafruit_SH1106G display = Adafruit_SH1106G(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// Adafruit_SH110X display = Adafruit_SH110X(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// Adafruit_SH110X display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// Adafruit_SH1106G display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// DHT dht(DHTPIN, DHTTYPE);
// WiFiMulti WiFiMulti;
// Adafruit_SGP30 sgp;
// WebSocketsClient webSocket;
// define variables
uint16_t TVOC_base, eCO2_base;
uint16_t counter = 0;
uint16_t eCO2 = 0;
uint16_t TVOC = 0;
uint16_t interval = 5000;
float temperature = 0;
float humidity = 0;
unsigned long currentMillis;
unsigned long lastMillis;
bool errorSGP30 = false;
bool errorDHT11 = false;
bool noise = false;
#endif

View File

@@ -1,3 +1,6 @@
// Dano Bosch
// 14/2/2024
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>

View File

@@ -0,0 +1,177 @@
// include header file into code
#include <headerFile.h>
// setup function
void setup() {
// make serial connection at 115200 baud
Serial.begin(115200);
// tell display what settings to use
display.begin(i2c_adress, true);
display.clearDisplay();
// tell sensors to start reading
dht.begin();
sgp.begin();
pinMode(MICPIN, INPUT);
pinMode(DHTPIN, INPUT);
websocketSetup();
resetValues();
}
// loop function
void loop() {
// loop the websocket connection so it stays alive
webSocket.loop();
// update when interval is met
if (currentMillis - lastMillis >= interval){
lastMillis = millis();
update();
}
// update the counter
currentMillis = millis();
}
// hexdump function for websockets binary handler
void hexdump(const void *mem, uint32_t len, uint8_t cols = 16) {
const uint8_t* src = (const uint8_t*) mem;
USE_SERIAL.printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len);
for(uint32_t i = 0; i < len; i++) {
if(i % cols == 0) {
USE_SERIAL.printf("\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i);
}
USE_SERIAL.printf("%02X ", *src);
src++;
}
USE_SERIAL.printf("\n");
}
// handler for websocket events
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
switch(type) {
case WStype_DISCONNECTED:
USE_SERIAL.printf("[WSc] Disconnected!\n");
break;
case WStype_CONNECTED:
USE_SERIAL.printf("[WSc] Connected to url: %s\n", payload);
// send message to server when Connected
webSocket.sendTXT("{\"message\": \"Connected\"}");
break;
case WStype_TEXT:
// USE_SERIAL.printf("[WSc] get text: %s\n", payload);
// send message to server
// webSocket.sendTXT("message here");
break;
case WStype_BIN:
// USE_SERIAL.printf("[WSc] get binary length: %u\n", length);
hexdump(payload, length);
// send data to server
// webSocket.sendBIN(payload, length);
break;
case WStype_ERROR:
case WStype_FRAGMENT_TEXT_START:
case WStype_FRAGMENT_BIN_START:
case WStype_FRAGMENT:
case WStype_FRAGMENT_FIN:
break;
}
}
// special function to setup websocket
void websocketSetup(){
WiFiMulti.addAP("iotroam", "vbK9gbDBIB");
WiFiMulti.addAP("LansanKPN-boven", "19sander71vlieland14");
while(WiFiMulti.run() != WL_CONNECTED) {
delay(100);
}
// server address, port and URL
webSocket.begin("145.92.8.114", 80, "/ws");
// event handler
webSocket.onEvent(webSocketEvent);
// try ever 500 again if connection has failed
webSocket.setReconnectInterval(500);
}
// function to reset the values if needed
void resetValues() {
TVOC_base;
eCO2_base;
counter = 0;
temperature = 0;
humidity = 0;
eCO2 = 0;
TVOC = 0;
noise = false;
lastMillis = 0;
currentMillis = 0;
}
// function to check for errors in sensors
bool checkForError(){
if (!sgp.IAQmeasure()) {
Serial.println("SGP30: BAD");
errorSGP30 = true;
} else {
Serial.println("SGP30: OK");
errorSGP30 = false;
}
if (isnan(temperature) || isnan(humidity)){
Serial.println("DHT11: BAD");
errorDHT11 = true;
} else {
Serial.println("DHT11: OK");
errorDHT11 = false;
}
return false;
}
// function to update when interval is met (see intervalCounter variable)
void update(){
// display sensordata on oled screen
displayData();
// webSocket.sendTXT("{\"Temp\":\"" + String(temperature) + "\",\"Humi\":\"" + String(humidity) + "\",\"eCO2\":\"" + String(sgp.eCO2) + "\",\"TVOC\":\"" + String(sgp.TVOC) + "\"}");
webSocket.sendTXT("{\"node\": \"" + String(WiFi.macAddress()) + "\", \"Temp\":\"" + String(temperature) + "\",\"Humi\":\"" + String(humidity) + "\",\"eCO2\":\"" + String(sgp.eCO2) + "\",\"TVOC\":\"" + String(sgp.TVOC) + "\"}");
sgp.getIAQBaseline(&eCO2_base, &TVOC_base);
// read dht11 sensor
temperature = float(dht.readTemperature());
humidity = float(dht.readHumidity());
// check if any errors occured when reading sensors
checkForError();
}
// function to display data on oled screen
void displayData() {
// clear display for new info
display.clearDisplay();
// set custom text properties
display.setTextSize(2);
display.setTextColor(SH110X_WHITE);
display.setCursor(0, 0);
// display info on oled screen
display.println((String) "Temp: " + int(temperature) + "C" + '\n'
+ "Humi: " + int(humidity) + "%" + '\n'
+ "eCO2: " + int(sgp.eCO2) + '\n'
+ "TVOC: " + int(sgp.TVOC));
// display the screen
display.display();
}

View File

@@ -0,0 +1,18 @@
#include "arduino.h"
#include "nodeCodeHeader.h"
nodeReadings::nodeReadings() {
}
void nodeReadings::resetValues() {
counter = 0;
eCO2 = 0;
TVOC = 0;
temperature = 0;
humidity = 0;
currentMillis = 0;
lastMillis = 0;
errorSGP30 = false;
errorDHT11 = false;
noise = false;
}

View File

@@ -0,0 +1,13 @@
#include <nodeCodeHeader.h>
#include "websockets.h"
nodeReadings esp32Node;
void setup() {
esp32Node.setup();
esp32Node.resetValues();
}
void loop() {
esp32Node.loop();
}

View File

@@ -0,0 +1,115 @@
#include "nodeCodeHeader.h"
nodeReadings::nodeReadings() {
//Making all the new object as defined in the .h file
dht = new DHT(DHTPIN, DHTTYPE);
display = new Adafruit_SH1106G(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
webSocket = new websockets();
sgp = new Adafruit_SGP30();
//setting the reding for every 5 sec
interval = 5000;
resetValues();
}
//Script for simpley reseting every value to 0
void nodeReadings::resetValues() {
counter = 0;
eCO2 = 0;
TVOC = 0;
temperature = 0;
humidity = 0;
currentMillis = 0;
lastMillis = 0;
errorSGP30 = false;
errorDHT11 = false;
noise = false;
}
//Setup for initilising the dht and sgp sensors. Also the display is set up.
void nodeReadings::setup(){
// make serial connection at 115200 baud
Serial.begin(115200);
// tell display what settings to use
display->begin(i2c_adress, true);
display->clearDisplay();
// tell sensors to start reading
dht->begin();
sgp->begin();
pinMode(MICPIN, INPUT);
pinMode(DHTPIN, INPUT);
webSocket->websocketSetup();
}
void nodeReadings::loop() {
// update when interval is met
if (currentMillis - lastMillis >= interval){
lastMillis = millis();
update();
}
// update the counter
currentMillis = millis();
// loop the websocket connection so it stays alive
webSocket->loop();
}
void nodeReadings::update(){
// display sensordata on oled screen
displayData();
//send the data to the websockets
webSocket->sendMyText("{\"node\": \"" + String(WiFi.macAddress()) + "\", \"Temp\":\"" + String(temperature) + "\",\"Humi\":\"" + String(humidity) + "\",\"eCO2\":\"" + String(sgp->eCO2) + "\",\"TVOC\":\"" + String(sgp->TVOC) + "\"}");
sgp->getIAQBaseline(&eCO2_base, &TVOC_base);
// read dht11 sensor
temperature = float(dht->readTemperature());
humidity = float(dht->readHumidity());
// check if any errors occured when reading sensors
checkForError();
}
void nodeReadings::displayData() {
// clear display for new info
display->clearDisplay();
// display the data on the oled screen
display->setTextSize(2);
display->setTextColor(SH110X_WHITE);
display->setCursor(0,0);
display->println("Temp: " + String(int(temperature)) + "C");
display->println("Humi: " + String(int(humidity)) + "%");
display->println("eCO2: " + String(sgp->eCO2));// + " ppm");
display->println("TVOC: " + String(sgp->TVOC));// + " ppb");
display->display();
}
//function
void nodeReadings::checkForError(){
if (!sgp->IAQmeasure()) {
Serial.println("SGP30: BAD");
errorSGP30 = true;
} else {
Serial.println("SGP30: OK");
errorSGP30 = false;
}
if (isnan(temperature) || isnan(humidity)){
Serial.println("DHT11: BAD");
errorDHT11 = true;
} else {
Serial.println("DHT11: OK");
errorDHT11 = false;
}
}

View File

@@ -0,0 +1,55 @@
#ifndef nodeReading_h
#define nodeReading_h
#include <Wire.h>
#include <Adafruit_SH110X.h>
#include <DHT.h>
#include <Adafruit_SGP30.h>
#include "websockets.h"
// define pins on esp32
#define MICPIN 6
#define DHTPIN 7
#define SCL 9
#define SDA 8
#define DHTTYPE DHT22
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define i2c_adress 0x3c
#define OLED_RESET -1 // QT-PY / XIAO
#define USE_SERIAL Serial
class nodeReadings
{
public:
nodeReadings();
void setup();
void loop();
void resetValues();
void update();
void checkForError();
void displayData();
private:
DHT *dht;
Adafruit_SH1106G *display;
websockets *webSocket;
Adafruit_SGP30 *sgp;
uint16_t TVOC_base, eCO2_base;
uint16_t counter;
uint16_t eCO2;
uint16_t TVOC;
uint16_t interval;
float temperature;
float humidity;
unsigned long currentMillis;
unsigned long lastMillis;
bool errorSGP30;
bool errorDHT11;
bool noise;
};
#endif

View File

@@ -0,0 +1,81 @@
#include "websockets.h"
websockets::websockets(){
webSocket = new WebSocketsClient();
_WiFiMulti = new WiFiMulti();
}
// hexdump function for websockets binary handler
void websockets::hexdump(const void *mem, uint32_t len, uint8_t cols) {
const uint8_t* src = (const uint8_t*) mem;
USE_SERIAL.printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len);
for(uint32_t i = 0; i < len; i++) {
if(i % cols == 0) {
USE_SERIAL.printf("\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i);
}
USE_SERIAL.printf("%02X ", *src);
src++;
}
USE_SERIAL.printf("\n");
}
// special function to setup websocket
void websockets::websocketSetup(){
_WiFiMulti->addAP("iotroam", "vbK9gbDBIB");
_WiFiMulti->addAP("LansanKPN-boven", "19sander71vlieland14");
while(_WiFiMulti->run() != WL_CONNECTED) {
delay(100);
}
// server address, port and URL
webSocket->begin("145.92.8.114", 80, "/ws");
// try ever 500 again if connection has failed
webSocket->setReconnectInterval(500);
}
void websockets::loop(){
webSocket->loop();
}
// handler for websocket events
void websockets::webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
switch(type) {
case WStype_DISCONNECTED:
USE_SERIAL.printf("[WSc] Disconnected!\n");
break;
case WStype_CONNECTED:
USE_SERIAL.printf("[WSc] Connected to url: %s\n", payload);
// send message to server when Connected
webSocket->sendTXT("{\"message\": \"Connected\"}");
break;
case WStype_TEXT:
// send message to server
// webSocket->sendTXT("message here");
break;
case WStype_BIN:
// USE_SERIAL.printf("[WSc] get binary length: %u\n", length);
hexdump(payload, length);
// send data to server
// webSocket->sendBIN(payload, length);
break;
case WStype_ERROR:
case WStype_FRAGMENT_TEXT_START:
case WStype_FRAGMENT_BIN_START:
case WStype_FRAGMENT:
case WStype_FRAGMENT_FIN:
break;
}
}
void websockets::sendMyText(String message) {
webSocket->sendTXT(message);
}

View File

@@ -0,0 +1,25 @@
#ifndef websockets_h
#define websockets_h
#include <WiFiMulti.h>
#include <WiFi.h>
#include <WebSocketsClient.h>
#include <Arduino.h>
#define USE_SERIAL Serial
class websockets {
public:
websockets();
void hexdump(const void *mem, uint32_t len, uint8_t cols = 16);
void websocketSetup();
void loop();
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length);
void sendMyText(String message);
private:
WebSocketsClient *webSocket;
WiFiMulti *_WiFiMulti;
};
#endif

View File

@@ -0,0 +1,112 @@
/*
* WebSocketClient.ino
*
* Created on: 24.05.2015
*
*/
#include <Arduino.h>
#include <WiFi.h>
#include <WiFiMulti.h>
#include <WiFiClientSecure.h>
#include <WebSocketsClient.h>
WiFiMulti WiFiMulti;
WebSocketsClient webSocket;
#define USE_SERIAL Serial1
void hexdump(const void *mem, uint32_t len, uint8_t cols = 16) {
const uint8_t* src = (const uint8_t*) mem;
USE_SERIAL.printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len);
for(uint32_t i = 0; i < len; i++) {
if(i % cols == 0) {
USE_SERIAL.printf("\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i);
}
USE_SERIAL.printf("%02X ", *src);
src++;
}
USE_SERIAL.printf("\n");
}
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
switch(type) {
case WStype_DISCONNECTED:
USE_SERIAL.printf("[WSc] Disconnected!\n");
break;
case WStype_CONNECTED:
USE_SERIAL.printf("[WSc] Connected to url: %s\n", payload);
// send message to server when Connected
webSocket.sendTXT("Connected");
break;
case WStype_TEXT:
USE_SERIAL.printf("[WSc] get text: %s\n", payload);
// send message to server
// webSocket.sendTXT("message here");
break;
case WStype_BIN:
USE_SERIAL.printf("[WSc] get binary length: %u\n", length);
hexdump(payload, length);
// send data to server
// webSocket.sendBIN(payload, length);
break;
case WStype_ERROR:
case WStype_FRAGMENT_TEXT_START:
case WStype_FRAGMENT_BIN_START:
case WStype_FRAGMENT:
case WStype_FRAGMENT_FIN:
break;
}
}
void setup() {
// USE_SERIAL.begin(921600);
USE_SERIAL.begin(115200);
//Serial.setDebugOutput(true);
USE_SERIAL.setDebugOutput(true);
USE_SERIAL.println();
USE_SERIAL.println();
USE_SERIAL.println();
for(uint8_t t = 4; t > 0; t--) {
USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t);
USE_SERIAL.flush();
delay(1000);
}
WiFiMulti.addAP("iotroam", "vbK9gbDBIB");
//WiFi.disconnect();
while(WiFiMulti.run() != WL_CONNECTED) {
delay(100);
}
// server address, port and URL
webSocket.begin("145.92.8.114", 80, "/ws");
// event handler
webSocket.onEvent(webSocketEvent);
// use HTTP Basic Authorization this is optional remove if not needed
// try ever 5000 again if connection has failed
webSocket.setReconnectInterval(5000);
}
void loop() {
webSocket.loop();
webSocket.sendTXT("test websocket 45050");
}

View File

@@ -8,11 +8,31 @@ nav:
- Links: opdracht/links
- 🎮 Arduino documentation:
- I2C: arduino-documentation/i2c-ESP32
- TFT screen : node-documentation/TFT-screen
- Classes : arduino-documentation/classes
- Node Documentation: node-documentation/node
- Node Class: node-documentation/NodeClassDocumentation
- Node Uml Diagram: node-documentation/NodeClassUml
- 🍓 RPi Documentation:
- Raspberry pi: Sp1SchetsProject/InfrastructuurDocumentatie/raspberryPi
- MariaDB: rpi-documentation/mariadb-installation
- phpMyAdmin: rpi-documentation/phpmyadmin-installation
- Websockets: rpi-documentation/websockets
- Reverse Proxy: rpi-documentation/Reverse-Proxy
- Db - Ws connection: rpi-documentation/Databaseconnection
- Put-request: rpi-documentation/Put-Request
- 🧠 Brainstorm:
- Ideeën: brainstorm/ideeën
- Database design: brainstorm/Database
- Feedback: brainstorm/Feedback
- Problem: brainstorm/Problem
- InfrastructureUml: brainstorm/UML-infrastructure
- Infrascructure: brainstorm/infrasturcture
- Taskflow: brainstorm/Taskflow
- Design: Sp1SchetsProject/FirstDesign
- Interview facility manager: brainstorm/gebouwBeheer
- Questions enquete: brainstorm/QuestionsEnquete
- 🖨️ Software:
- Dev page: brainstorm/SoftwareDocumentatie/Dev_page
- Graph classes: brainstorm/SoftwareDocumentatie/classes

View File

@@ -0,0 +1,86 @@
#include "DHT.h"
#include <WiFi.h>
#include <WiFiMulti.h>
#include <WebSocketsClient.h>
#define DHTPIN 4
#define DHTTYPE DHT11
uint8_t h;
uint8_t t;
uint16_t interval = 5000;
unsigned long currentMillis;
unsigned long lastMillis;
WiFiMulti wifiMulti;
WebSocketsClient webSocket;
DHT dht(DHTPIN, DHTTYPE);
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
// Handle WebSocket events here if needed
}
void setup() {
Serial.begin(9600);
Serial.println(F("DHTxx test!"));
dht.begin();
wifiMulti.addAP("iotroam", "sGMINiJDcU");
wifiMulti.addAP("Ziggo6565749", "Ziggobroek1@");
Serial.println("Connecting Wifi...");
if (wifiMulti.run() == WL_CONNECTED) {
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
// Connect to WebSocket server
webSocket.begin("145.92.8.114", 80, "/ws"); // Replace with your Raspberry Pi's IP address and port
webSocket.onEvent(webSocketEvent);
webSocket.setReconnectInterval(500);
}
}
void loop() {
// update when interval is met
if (currentMillis - lastMillis >= interval){
lastMillis = millis();
update();
}
// update the counter
currentMillis = millis();
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
if (isnan(h) || isnan(t)) {
Serial.println(F("Failed to read from DHT sensor!"));
return;
}
// Compute heat index in Celsius (isFahrenheit = false)
float hic = dht.computeHeatIndex(t, h, false);
Serial.print(F("Humidity: "));
Serial.print(h);
Serial.print(F("% Temperature: "));
Serial.print(t);
Serial.print(F("°C "));
Serial.print(hic);
Serial.print(F("°C "));
// Ensure WebSocket communication
webSocket.loop();
}
void update(){
webSocket.sendTXT("{\"node\": \"" + String(WiFi.macAddress()) + "\", \"Temp\":\"" + String(t) + "\",\"Humi\":\"" + String(h) + "\"}");
}

View File

@@ -0,0 +1,53 @@
### Connecting With The websocket.
#### The reason.
During our project we needed more esp's to connect to the websocket, so i was given the task to make a connection to wifi, connect to the websocket, and then send information to it.
#### Before the setup.
I used library's for: connecting to multiple wifi's, connecting to the websocket and being able to read infromation form a DHT11.
These were called uppon in the first few lines.
Together with this a few variables are named to be used later in the code.
#### The Setup
Firstoff, start with identifying which serial port will be used and work from there.
It Then tells the DHT to send a test message and start it up.
Then the several wifi connections get told here and it looks for the one that connects.
(This is made bij giving the wifi name and pasword)
In this sequence a print is made, showing that there is an atempt to connect to a wifi.
*This was used because the node should be able to connect to several wifi's and not be stuck t one in perticulair.
After the wifi is connected it sends a print to indicate a connection and pings the ip adress of the used wifi.
The websocket connection which was then made is made using the uri, port, and type of connection.
In case of websocket events it gets sent.
In case of connection failiure, try this.
#### The loop
We start with setting a timer because a "delay" function would break the connection with the websocket resulting in an error.
This relates back to some some variables that were made in the beginning.
We make variables for the different results we are gathering, so these can be used later.
Then the variables get printed for overview.
To ensure the websocket connection , the process gets looped.
#### Update File.
Here the text thathas te be sent to the websocket gets sent.
### The fysical product.
it is shown here:
![fysical1](<../documentatie/assets/DHT11 state 1.jpg>)
It also turns on:
![fysical2](<../documentatie/assets/DHT11 state 2.jpg>)
Here are my fritzing and wireframe, the components used are shown but The DHT11 is replaced by a DHT22.
![alt text](../documentatie/assets/DHT11_by_button_fritzing.png)
![alt text](../documentatie/assets/DHT11_by_button_wireframe.png)
### The code.
Here the c++ code is shown:
https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59/-/blob/main/docs/LearningProcessBram/ArduinoExperience/NodeWithWebConnection.ino?ref_type=heads

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 KiB

View File

@@ -0,0 +1,58 @@
### Buzzer class
To provide a demonstration of how classes work in C++/Arduino, I decided to code something simple and repeatable.
This class is intended to assign an input and output source for a button to activate a buzzer, and for a buzzer to be activated by a button. This is achieved by using private variables and public functions that access these variables.
This class code allows the user to easily add new buzzers by simply creating an object and calling the appropriate function.
##### Constructor
Inside the class, a constructor is defined. In C++, this constructor shares the same name as the class itself. Every time the class is called, the constructor is activated with the given data.
##### Class functions
Within a class, functions can be defined. These functions can interact with the variables made inside the class. These functions can then be called outside the class to execute their action.
In this case, the "activation" function is defined within the class and is used in the loop function. This function contains the if-statement that determines if the button is pressed and activates the buzzer pin accordingly.
##### Object Creation
After defining the class, an object needs to be made. This object will immediately trigger the constructor and ask for input variables. These given data points will be inserted into the private variables.
In this instance, the buzzer pin is set to 12 and the button pin to 20.
##### Using the class
In the loop function, the new object is placed along with the function defined in the class to activate it. This function executes with the variable data provided in the constructor. Here, it checks if the specified pin is receiving a signal and then only outputs a signal to the buzzer when there is one.
##### Link to code
(https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59/-/blob/main/docs/LearningProcessBram/ArduinoExperience/classesArduino/buzzerclasses.ino?ref_type=heads)
### The board
The fysical board should look something like this:
![Fritzing of board](<Schermafbeelding 2024-04-05 110142.png>)
The board is simple and easy to recreate and has lots of space left for other functions.
By making this class, the addition of more buzzers is very easy. As long as there are pins, there can be a buzzer.
For this example, I have only used one, but adding more would be no problem. Just make a object, give the pin numbers and call the function.
The wireframe for this board would looke something like this:
![wireframe](<Schermafbeelding 2024-04-05 110219.png>)
I tried making it as clear as possible by moving some parts around and clearing some intertwining wires.
###### My Fysical Recreation.
To properly demonstrate this code in action, I recreated the board. In the image, you can see that I plugged in three different LEDs.
![fysical board](buttonClassOff.jpg)
In the image, you can see that I plugged in three different LEDs.
This was done to show off that the board/code works, as it's not possible to see if a buzzer is working on camera.
For the time being, pretend that the LED and resistor combinations are separate buzzers.
To make this board turn all the buzzers/LEDs on, I needed to create three different objects. These objects looked like this:
![threeObjects](threeObjects.png)
The first variable is where I want the buzzer to connect, and the second variable is where I want the button to be connected.
After this, I simply placed the objects in the loop and called the function we made in the class:
![function calling](threeObjectsAndFunctions.png)
Now, we simply push the code to The Esp and try it out.
![The classes work](buttonClassOn.jpg)
Now, we have effectively made the LEDs/buzzers turn on with the push of a single button.

View File

@@ -0,0 +1,30 @@
class BuzzerPin{
private:
int buzzerPin;
int button;
public:
BuzzerPin(int bp, int but){
buzzerPin = bp;
button = but;
pinMode(button, INPUT);
pinMode(buzzerPin, OUTPUT);
}
void activate(){
if(digitalRead(button) == HIGH){
digitalWrite(buzzerPin, HIGH);
}else{
digitalWrite(buzzerPin, LOW);
}
}
};
BuzzerPin buzzerOne(12, 20);
void setup(){
}
void loop() {
buzzerOne.activate();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -1,9 +0,0 @@
## Bram's Learning Curve
Here i post my progress on learning and mastering arduino. I originally did the Gamedevelopment study but decided to switch to "Technische Informatica". That is why i need to learn everything from scratch, and everything is new to me.
This is the reason that i made these documents, in order to track my progression in this new study.
### Buzzer
For one of my first projects I wanted to learn how to use a buzzer with different notes.
To achieve this, i went on a search accross sites to see how i can use frequenties to make different sounds.
Then i came accross a teaching site (https://www.codingkids.nl/arduino-buzzer.html) that taught me the language to communicate to the buzzer what frequenties to use. This way i can make any sound come out of this simple buzzer.

View File

@@ -0,0 +1,3 @@
## Personal Learning
Keep documenting my personal progression, but ad my personal way of learning, like video's and such.
Do update the Team document, because the current version has a bit too much generic points.

View File

@@ -0,0 +1,290 @@
## Bram's Learning Curve
Here I post my progress on learning and mastering Arduino. I originally did the Game development study but decided to switch to "Technische Informatica". That is why I need to learn everything from scratch, and everything is new to me.
This is the reason that I made these documents, in order to track my progression in this new study.
### Buzzer
For one of my first projects, I wanted to learn how to use a buzzer with different notes.
To achieve this, I went on a search across sites to see how I can use frequencies to make different sounds.
Then I came across a teaching site (https://www.codingkids.nl/arduino-buzzer.html) that taught me the language to communicate to the buzzer what frequencies to use. This way I can make any sound come out of this simple buzzer.
### Arduino Video
I watched a video about using Arduino and took a lot of op notes along the way.
The link is: (https://www.youtube.com/watch?v=BLrHTHUjPuw).
```
// $Arduino information:
//pinnumber(locatie, in-/output)
//digitalwrite(locatie, high/low)
//delay(time in millisec)
//int... <- variable
//with a decimal its a double -> 1,2
//a character is a char -> "a"
// $serial communications:
setup:
Serial.begin(9600) -> the text speed
Serial.sprintLn(text)
Loop:
Serial.print("text")
Serial.printLn(....) -> variable because no "
//Ctrl + shift + M = serial monitor.
The text speed needs to be the same as given.
// $If Statements:
if(condition){
action
}else{
action
}
// && = "and"
// || = "or"
\/\/For loops:
For(int*i; i <= 10 ; i++){
serial.print(i)
}
// The fading of led's:
examples, basics, fade
// servo's
examples, servo, sweep
```
### Linux and raspberry PI.
To gain more knowledge about Linux, I first asked my classmates if they could get me started.
They showed me how to gain access to a server and told me how to navigate through files.
By doing this I got taught the following commands:
```
~ $ 'ls -la' = show file / folders
~ $ 'top' = see currently running programs
~ $ 'cd ' = change directory
~ $ 'mkdir name' = make directory
~ $ 'touch name' = make file
~ $ 'ping ip addres'
~ $ 'ssh username@ip address' = open ssh connection.
```
### Air, temperature, and all sort of stuff.
After the Linux coding I decided to take a step back and began gaining experience with sensors.
I began trying to make our group project's "node" for myself.
I did this by using one of the main sensors and tried programing it myself.
I used this website for the information and for the right library:(https://randomnerdtutorials.com/esp32-dht11-dht22-temperature-humidity-sensor-arduino-ide/).
Aside from the website I used my teammates for help where it was needed.
I wanted to make my own spin on the original design by including a button to activate the sensor and an LED to show if its on.
The rest of the tutorial was clear and worked like a charm.
the code used looks like this:
Begin by including a specific library for the DHT11.
```
#include "DHT.h"
#define DHTPIN 4
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
```
using This perticulair serial port, means that you do have to switch to it when you want to see results coming in.
The dht.begin command starts the process.
```
void setup() {
//the serial port:
Serial.begin(9600);
//the initial test if the code works
Serial.println(F("DHTxx test!"));
//the library start
dht.begin();
}
```
It starts by making float variables, to give over the information.
It also includes a error message in case of no feedback.
```
void loop() {
delay(2000);
//a float has decimal numbers and the library reads the measurements.
float h = dht.readHumidity();
float t = dht.readTemperature();
float f = dht.readTemperature(true);
//isnan = there is no reading , the || is "or"
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println(F("Failed to read from DHT sensor!"));
return;
}
float hif = dht.computeHeatIndex(f, h);
float hic = dht.computeHeatIndex(t, h, false);
//all serial.print's send stuff to the serial board to showcase.
Serial.print(F("Humidity: "));
Serial.print(h);
Serial.print(F("% Temperature: "));
Serial.print(t);
Serial.print(F("°C "));
Serial.print(f);
Serial.print(F("°F Heat index: "));
Serial.print(hic);
Serial.print(F("°C "));
Serial.print(hif);
Serial.println(F("°F"));
}
```
And the physical board looks like this:
![Physical DHT11 board off](<assets/DHT11 state 1.jpg>)
And here it looks in action:
![physical DHT11 board on](<assets/DHT11 state 2.jpg>)
Later on, I could expand this code and the physical product to include the rest of the sensors.
The wiring is shown here:
![my fritzing diagram](assets/DHT11_by_button_fritzing.png)
The red cables are 3v, the black cables are the ground and the green cable is the echo for data.
This version is using a DHT22, this is a updated version of a DHT11 but still provides the same information and still uses the same pins. So i decided to compromise for it, using it in my fritzing diagram.
The wire-frame is shown below:
![wireframe DHT11](assets/DHT11_by_button_wireframe.png)
This helps visualise all connections and shows what parts were used for reproductional .
### Buzzers .pt 2
I found out how to make multiple buzzers go off with the press of one button and increase as Mutch as there are pins.
I tried to not look up anything for this one but did ask questions from time to time.
I designed it to work with scanning if there is any input and then output this signal to activate the buzzers.
This output signal can activate over multiple pins so this one button can set off all sorts of stuff.
The code is short and simple:
```
//set up some variables
int button = 20;
int buzzerone = 12;
int buzzertwo = 11;
```
Now we set the pins up to either input or output a signal.
```
void setup() {
//put down some pins that will output , and some that input.
pinMode(button, INPUT);
pinMode(buzzerone, OUTPUT);
pinMode(buzzertwo, OUTPUT);
}
```
Here the button pin will seek a signal, when it is given it will send signals to the other given pins in the if-statement.
```
void loop() {
//read is there is input on the button pin, if so send output to the other pins, otherwise keep them off.
if(digitalRead(button) == HIGH){
digitalWrite(buzzerone, HIGH);
digitalWrite(buzzertwo, HIGH);
}else{
digitalWrite(buzzerone, LOW);
digitalWrite(buzzertwo, LOW);
}
}
```
Here I made the physical design but instead of buzzers I used lights in order to show it working.
![board turned off.](<assets/Buzzer board off.jpg>)
And here is the the board working:
![board working and turned on.](<assets/Buzzer board on.jpg>)
To Show my wiring more clearly, here is my fritzing board:
![fritzing_buttons pt2](assets/Buzzer_board_fritzing.png)
the red wires are 3v, the black wires are the ground connections.
Here the wireframe is shown for parts specification and possible reproduction:
![wireframe _ buzzers pt2](assets/Buzzer_board_wireframe.png)
### Python For Dummies.
My job was to make a connection between the WebSocket and the database we had set up, and to do this we wanted to use python.
To give an easy picture, here is where i would come:
![my datqa-websocket connection](assets/myconnection.png)
It looks easy, but for someone who never worked wit hpython and linux, this will prove to be a challenge.
Because I was totally new to all of python I began asking friends for advice and started asking chatgpt for some examples.
and worked in reverse in order to understand python fully.
I went and looked up fitting tutorials on W3SChools.
The following were used:
(https://www.w3schools.com/python/python_mysql_getstarted.asp)
(https://websockets.readthedocs.io/en/stable/)
(https://www.w3schools.com/python/python_mysql_insert.asp)
(https://www.w3schools.com/python/python_json.asp)
After still not getting it very well i asked Dano (a teammate of mine) if he could teach me some basics, and so we did.
He taught me how to make a simple calculator and told me why my code worked the way it did.
(This was the code:
// this prints a cheatsheet to know if the user wants plus or minus.
print("1 = + 2 = -")
c = int(input())
// a input is given for the first number.
print("first number")
a = input()
//a input is given for the second number.
print("second number")
b= input()
//a if-statement to see if it is plus or minus.
if c == 1:
print(int(a) + int(b))
elif c == 2:
print(int(a) - int(b))
)
Even if it looked simple, this was the ignition I needed to understand python better and continue my own research.
### Python for dummmies pt2
After some intense trail and error, I managed to connect to the websocket.
After wich I also managed to send infromation to the database by including details like pasword and such.
I began investigating deeper and asked for other people's vision on my code.
It wasa hard to notice what problems there were, but eventualy me and a classmate found out that the problem was inside of the database itself instead of the code. So after fixing some issues with the primary keys and some tesing with the code, I managed to fix the issues that popped up.
Now the code is able to send websocket data to the database under the name of node "1".
This will have to be updated so all names could be sent to the database without causing issues.
But the current code does what we expect from sprint two but I will surely continue working on making it perfect.
### python for dummies pt3
After the sprint review for sprint two, we as a team decided that it was time to make progress with connecting more nodes, and so I did.
I began searching for leads on how to grab information from a database, and used this website to teach me:
https://www.w3schools.com/python/python_mysql_select.asp
Once I figured out how to grab information, I wanted to put it in an array and look if the connected node(wich I put in a varriable) was already known in the array. The webpage for this was: https://stackabuse.com/python-check-if-array-or-list-contains-element-or-value/
This originaly didn't work, and by printing all my variables and the array I initially didn't see anything that would prevent it from working.
But for some reason the given node wouldn't compare itself to the nodes in the array.
That is when I found out the data from the array was in a tuple. So when I changed the variable to turn into a tuple, it worked like a charm.
Then after all of this trouble, I finished by putting the new node MAC (in string format) into the correct collum in the database so this will MAC will be saved in the future.

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -0,0 +1,41 @@
## The First Designs(led By Bram)
The first designs are made using a pencil and paper, because we want a clear view of the direction we want to go in. The design of the nodes that are being put around school, wil have a compact and simple look.
![The First Node Sketch(Bram)](../assets/ImagesSp1/sp1NodeSketch.jpg)
On the top of this, page the front of the node is visable.
This front shows a screen , a bar with led's ( wich is used to show how much sound is picked up on the node.), and a hexagon grid where the sensors are located behind.
This way we can have enough airflow and more sensor pickups.
On top of the node there are two lights. These indicate if the air is too warm for comfort, so the cleaners are aware of the the current studying climate.
The nodes will be powerd by batteries and wil be mounted on walls around eye height. They will latch on a mount that is stuck using dubble sidded tape. this way we can mount and dismount the nodes when the batteries need to be replaced.
(The mount and the sode profile are shown on the bottom of the page.)
Next up is the central node that has a questionaire built into it.
![The First Questionaire Node Sketch(Bram)](../assets/ImagesSp1/Sp1questionBoxNode.jpg)
On the top Of the page The front of the node is drawn. The node has two screens to show both the statistics and the questionaire. On the node, three Buttons are show wich the user can press in order to take the questionaire.
This node still has all the sensors like all of the others, except this one has a built in questionaire.
The locations for the nodes are still unsure but what is certain is that the questionaire node will be placed besides the water fountain and cofemachines.
This location is frequently visited and is a wel known spot.
The people going for a cup of coffee often have to wait for it to be finished, so we can take advantage of that time by giving them a short questionaire that they can comforably fil in while their cofee is being made.
### Feedback
As for feedback, we got a lot of positives, but also a few critic points.
`the LED's could be seen as distracting.
That is why we decided to remove them intirely. THis wat the lights can't be distracting and the focus can remain on the statistics.
`The whole ventilation look is a bit too crowded and messy.
That is why we will shrink down the size of the hexagons and make them less obvious.
We also redesignd the shell shape. it now curves inward in order to lock the statistics screen in place.
Here is an updated version ready to be printed.
![3D design by Sietse](../assets/ImagesSp1/Sp13DDesignUpdated.png)

View File

@@ -1,6 +1,6 @@
#Rasberry Pi
# Rasberry Pi
##Table of contents
## Table of contents
1. [Introduction](##introduction)
2. [Rasberry Pi](##Rasberry-Pi)
3. [Dev-Page](###Dev-Page)
@@ -8,20 +8,24 @@
5. [Database software](###Database-software)
6. [Esp to database](###Esp-to-database)
##Introduction
## Introduction
The backend of this project there is a raspberry pi 3 for handeling the dev page (more on this later) and the database. The Esp nodes are going to send a api request to the dev page wich is going to make a POST request to the database.
In the backend of this project, there is a Raspberry Pi 3 for handling the dev page (more on this later) and the database. The ESP nodes are going to send an API request to the dev page, which is going to make a POST request to the database.
##Rasberry Pi
## Rasberry Pi
The Raspberry 3 can be descriped as a "little" computer running a quad-code 64-bit prossesor, the previus Raspberry witch is 50% slower than this one
The Raspberry 3 can be descriped as a "little" computer running a quad-code 64-bit prossesor, the previus Raspberry witch is the pi 2 and is 50% slower. The operaiting system is linux, it is a open source os system, we are using it for database and website hosting purposes, but it can do a wide range of things. The GPIO pins make it usefull for even more things, like home automation with sensors.
The Raspberry Pi 3 is equipped with a quad-core 64-bit Broadcom BCM2837 ARM Cortex-A53 SoC processor running at 1.2 GHz, making it about 50% more powerful than the Pi 2.
### Dev Page
###Dev Page
For monitoring porpoises we are going to implement a dev page, this means that there basicey is a debug page. On this page we will be displaying the current readings that are comming in in to graphs and also the data form the last 10 redings from all the nodes, the readings are sorted in there respective graphs like temp, humidity and noice redings for example. This is handy for quick access to the data ouwr nodes are sending out. So it will be easy to see if one is malvuntion and monetoring the state off the battery to check if its nessesery to replace it.
##Database
### Database
###Database software
## Database
###Esp to database
The database is set up on the raspberry so that we dont always have to have a computewr
### Database software
### Esp to database

View File

@@ -0,0 +1,34 @@
### Begin met een introductie van het team (jullie namen + teamnaam)
Welkom bij de sprint review, wij zijn *insert namen*.
### Leg uit wat jullie van plan zijn om op te leveren; wat is de opdracht, wat gaat er waarschijnlijk uitkomen.
Wij hebben de opdracht gekregen om de studieruimte te optimaliseren. Hiervoor moeten we data verzamelen over de studieomgeving en de meningen van onze medeleerlingen. We hebben feedback gevraagd bij studenten en daar is uit gebleken dat mensen moeite hebben met een rustige omgeving te vinden. Daarom gaan we een systeem bouwen waardoor je makkelijk rustige studieplekken kan vinden.
Dit gaan we doen door het plaatsen van een centrale hub node en een aantal losse hub nodes. Deze nodes zullen verschillende datapunten verzamelen met behulp van sensoren, namelijk: temperatuur, luchtvochtigheid, ppm van koolstof en TVOC. Daarnaast hebben we een display waarop de huidige metingen worden getoond. In de centrale hub is ook een meetstation en een tweede scherm met enkele enquêteachtige vragen, waarbij gebruikers hun mening kunnen geven met behulp van 3 knoppen. We moeten nog testen of dit toegankelijk genoeg is. We hebben ook al een basisidee van hoe het design van de nodes eruit zal zien. *insert bram funny pic*
### Bespreek welke User Stories jullie hebben gemaakt voor de Product Backlog.
*laat belangrijke user stories zien*
*leg uit waarom*
### Bespreek welke User Stories jullie hebben opgepakt in de Sprint Backlog.
- [Luchtmeten](https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59/-/issues/36)
- [Temperatuur meten](https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59/-/issues/18)
- [Schermpje op node](https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59/-/issues/39)
In de eerste sprint werken we vooral aan het algehele plan en de basis van het project, met name de Raspberry Pi die tot onze beschikking is gesteld voor de backend. Deze moeten we zelf ontwerpen. Daarnaast moeten we zaken zoals de wireflows, de infrastructuur: ![de infrastructuur](../assets/ImagesSp1/digitaleInfrastructuur.png), en het [uml diagram](../brainstorm/UML%20infrastructure.md) regelen.
### Geef een demonstratie van het product.
*show node*
### Geef een overzicht van jullie portfoliowebsite (highlights).
We hebben op onze portfoliopagina verschillende documentaties geplaatst, met name:
- [Het algehele idee](https://opti.smikkelbakje.nl/brainstorm/idee%C3%ABn/)
- [Databaseontwerp](https://opti.smikkelbakje.nl/brainstorm/Database/)
- [I2C-communicatie](https://opti.smikkelbakje.nl/arduino-documentation/i2c-ESP32/)

View File

@@ -0,0 +1,8 @@
## Wie doet wat:
dano laat website zien, ik laat het dynamisch toevoegen van nodes zien, en een kleine uitleg waarom dit zo belangrijk is. Bram laat dan zien dat alle data in de database komt door een python script. Sam laat dan het fysieke model zien van het feedback scherm. Sietse laat de userstories zien. Dan laat dano de volgende documentatie zien:
- OOP - class grafiek
- Infrastructuur - UML
- Gebruikerstest - feedback scherm vragen
- embedded ontwerpen en maken - tft screen van sam

View File

@@ -0,0 +1,73 @@
# Arduino classes
## How do I make a class?
First you need to start out with a header file. This file will contain the class definition. And which functions of the class are public and which are private.
```cpp
#ifndef DISPLAYTEXT_H
#define DISPLAYTEXT_H
#include "Adafruit_GFX.h"
#include "Adafruit_ST7796S_kbv.h"
class DisplayText {
private:
Adafruit_ST7796S_kbv& tft;
int centerText(char* text);
int bottomText(char* text);
void printWordsFull(char* text);
public:
DisplayText(Adafruit_ST7796S_kbv& tftDisplay);
void writeText(char* text, int size, int posX, int posY, int screenTime, bool center, bool bottom);
};
#endif
```
```#ifndef``` DISPLAYTEXT_H is a preprocessor directive that checks if DISPLAYTEXT_H is defined. If it is not defined, the code between #ifndef and #endif will be included in the compilation. If it is defined, the code will be excluded from the compilation. This is to prevent the same code from being included multiple times in the same file.
To start out with a class you need a constructor. This is a function that is called when the class is created. This function is used to initialize the class.
```cpp
DisplayText::DisplayText(Adafruit_ST7796S_kbv& tftDisplay) : tft(tftDisplay) {
tft.fillScreen(0x0000);
}
```
The library gets passed to tftdisplay. And the tft gets initialized with the tftdisplay.
## How do I create a function in a class?
```cpp
void DisplayText::centerText() {
//insert code here
}
```
This is a example of a function in a class. The function is called centerText and it is a private function. This means that it can only be called from within the class.
When creating a class you also need to reference it in the header file like this
```cpp
#include "DisplayText.h"
class DisplayText {
private:
int centerText();
//other functions
public:
//other functions
};
```
# Sources
* https://www.circuitbasics.com/programming-with-classes-and-objects-on-the-arduino/

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 KiB

BIN
docs/assets/Node.fzz Normal file

Binary file not shown.

BIN
docs/assets/Node.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -0,0 +1,94 @@
# Feedback
### Studieomgeving(Led by Sam)
* "Betere zitplekken"
* "Mensen minder praten"
* "Geluidsgehalte lager in studieomgeving"
* "Zachtere lachten"
* "Minder domme mensen"
### What are we going to do to improve the study area?
We are going to build multiple sensor nodes and hang them around study areas to measure the sound level. These nodes are going to send the data to a server, which is going to process the data and send it to the main node that is located at the coffee machine. This node is going to show the data so the student can quickly find a quiet spot to work.
### Feedback about physical node design(Led By Sam)
* "Cool"
* "Goed"
* "Prima"
* "Is wel Nice"
* "Vet idee"
* "Duidelijker maken wat lampjes rechts doen"
* "Beetje te druk"
* "Display in midden"
* "Ventilatie niet in het midden focus niet op scherm"
* "Lampjes mischien afleidend"
### Conclusion(led by Bram and Sam)
We got a lot of positive feedback like "Cool" and "Vet idee". But we also got some feedback about the design of the node.
We Wil use this Feedback and see what we can do to change the design in a way that is more accepted by our target audience.
The design will be updated to include:
`smaller holes for less distraction.
`ventilation at the bottom for better airflow.
`Remove the lamps on top of the node for less distraction.
### Design questions led by bram
For the nodes we designed to be placed around the 5th floor we were stuck between two designs:
The wooden design: takes less time to create,is more fragile, and more eco-friendly.
The Plastic: less eco-friendly, takes a longer time, looks objectively better.
since we can't decide on what we should use, I (Bram) went out to asks the public for their opinion.
To do this i took the front of the plastic design, and the front of the wooden design.
They looked like this:
![2Covers](../LearningProcessBram/documentatie/assets/2Covers.jpg)
1. which design is more likable
/Sebas : plastic looks better and goes straight to the point.
/Skip : plastic looks more clean.
/Dano : plastic is more smooth.
/Sietse : plastic is better.
/Ishak : Wood is more ecofriendly.
/Nailah : PLastic looks cooler
2. which design is more distracting.
/Sebas : wood is more distracting and more obvious.
/Skip : wood, because the school walls are more darker themed.
/Dano : wood looks off.
/Sietse : wood would be out of place.
/Ishak : Wood, but in a good way.
/Nailah : plastic looks more interesting.
3. Any further comments about the design?
/Sebas : Don't do wood, plastic is more sleek.
/Skip : plastic looks more professional.
/Dano : no.
/Sietse: no.
/Ishak : in the wood you can burn in your logo.
/Nailah : The wood can look better inside the school.
In conclusion, Even though the wood would atract more attention, the plastic looks better according to the students.
So from this information we will continue to make plastic cases for the nodes.

View File

@@ -1,5 +0,0 @@
# Questions
How clean are the toilets (clean, normal, disgusting)
How clean is the study area (clean, normal, disgusting)
What do you think of the temparature in the study area (hot, perfect, cold)

View File

@@ -0,0 +1,31 @@
# Questions
## Criteria
Questions shouldn't be able to measure using sensors. 3 possible answers.
## Questions
- How clean are the toilets? (clean, normal, disgusting).
- How clean is the study area? (clean, normal, disgusting).
- What do you think of the temperature in the study area? (hot, perfect, cold).
- How crowded would you say the study area is?(not at all, its fine, really crowded).
- Is there enough help available on the 5th floor? (no, decently, yes).
### Feedback questions
- Zijn de vragen duidelijk en snel te beantwoorden hierboven?
- Hebben jullie nog andere feedback voor gebouwbeheer, die niet gemeten kan worden door sensoren?
## Feedback
1. vraag 5 is onduidelijk. Wat bedoel je met genoeg hulp? Docenten, schoonmakers? Andere manier formuleren over welke hulp. Andere vragen zijn duidelijk. Er kan een vraag worden toegevoegd over of het goed gaat met de studie of over de dag. Dit is niet heel hulpvol voor gebouwbeheer maar voor de studenten zelf wel.
2. andere variant van antwoord geven op de vragen. Bijvoorbeeld een schaal van 1 tot 5. Of een schaal van 1 tot 10. Dit is makkelijker te verwerken en te analyseren. Voor de rest zijn de vragen duidelijk. Deze persoon heeft geen andere feedback voor gebouwbeheer want deze vragen zijn genoeg
3. De vragen zijn duidelijk en snel te beantwoorden. behalve vraag 5 die onduidleijk is. geen andere vragen vragen als feedback.
## Conclusion
The questions are clear and easy to answer, except for question 5 which is unclear.

View File

@@ -0,0 +1,76 @@
### parsing JSON
The data that is send by the nodes is send in json data. We chose this becouse we can easily use the data within javascript, this is called parsing. We use the parced data and send that in to the next function to make the data more acceseble to use in further instences.
```js
const jsonData = JSON.parse(event.data);
// Use the parsed JSON data as needed
handleIncomingData(jsonData);
```
Here is the function that receves the parced JSON data and set it into variables. So that it can be more easlily used in the next function with is the processNodeData, witch is setting the data in to the right array.
```js
function handleIncomingData(data) {
nodeNumber = data.node;
temperature = data.Temp;
humidity = data.Humi;
CO2 = data.eCO2;
TVOC = data.TVOC;
processNodeData(nodeNumber, temperature, humidity, CO2, TVOC);
}
```
In the function processNodeData we first check if there is a array for the node that is sending the data, this is done becouse if we want to seperate the data in to show witch node is sending what data. So if the nodeNumber plus sensorData (the name of the array) not already there the array is made.
```js
// Initialize the array for this node if it doesn't exist yet
if (!sensorData[nodeNumber]) {
sensorData[nodeNumber] = [];
}
```
For the actual data put in to array function is there a simple array.push for the data that is send allong from when the function is called.
```js
// Push the new data onto the array for this node
sensorData[nodeNumber].push({
'node': nodeNumber,
'temp': temperature,
'humi': humidity,
'CO2': CO2,
'TVOC': TVOC,
});
```
We want only use the last 10 readings from the nodes so there is a check for if the array is longer than 10 the first (or the oldest reading), if that is so there is a .shift executed. This is done to be later used in the graph function. Than there is a call for the next function, that is the updateNodeData and that will acctually find the right html id coresponding with the right reading to update that.
```js
// If the array for this node has more than 10 elements, remove the oldest one
if (sensorData[nodeNumber].length >= 10) {
sensorData[nodeNumber].shift();
}
updateNodeData(nodeNumber, temperature, humidity, CO2, TVOC);
```
In the last function there are 2 updates the first is to actually update the text to the right value that we are getting from the node, and the connection checker.
```js
function updateNodeData(node, temperature, humidity, eCO2, TVOC) {
// Update the temperature, humidity and light intensity values
document.getElementById("temperature" + node).textContent = temperature;
document.getElementById("humidity" + node).textContent = humidity;
document.getElementById("CO2" + node).textContent = eCO2;
document.getElementById("TVOC" + node).textContent = TVOC;
// Update the status text
document.getElementById("tempStatus").textContent = "Connected";
document.getElementById("humidStatus").textContent = "Connected";
document.getElementById("CO2Status").textContent = "Connected";
document.getElementById("TVOCStatus").textContent = "Connected";
}
```

View File

@@ -0,0 +1,120 @@
# Nodes
## Introduction
The nodes are the devices that are placed in the rooms. The nodes are used to collect the data from the sensors. Every node is connected to the websocket, and sends their data with their mac address in json format. The websocket broadcasts the node data back to all clients, and since our website functions as a client it also receives the data. Every node will, depending on what node, be made into a class.
## Requirements
### Sensornode
- Every node has to have a unique nodeID
- Every node has to have their corresponding sensorsvalues in form of arrays
### Feedbacknodes
- Every node has to have a unique nodeID
- Every node has to have their corresponding feedback in form of a 2D array
## Class diagrams
### Node
```mermaid
classDiagram
Node <-- SensorNode : extends
Node <-- FeedbackNode : extends
class Node {
+nodeID
+processNodeData()
+updateNodeData()
}
class SensorNode {
+tempArray
+humiArray
+eco2Array
+tvocArray
}
class FeedbackNode {
+feedbackArray
}
```
# Graphs
## Introduction
The graphs are used to display the data from the sensors. The data is collected by the raspberry pi and then displayed on the graphs. The graphs are made using the [plotly library](https://plotly.com/javascript/) .
## Requirements
### Live graphs
- Every node has to have a live graph
- The graphs has to be updated every 5 seconds
- All the data from one node has to fit in one graph
## Class diagrams
### Graphs
```mermaid
classDiagram
liveGraph --> graph: extends
class graph {
+nodeId
makeGraph()
}
class liveGraph {
+cnt
+timeArray
+tempArray
+humiArray
+eco2Array
+tvocArray
makeGraph()
updateGraph()
updateData()
}
```
## Order of operations
### Live graphs
```mermaid
sequenceDiagram
participant Node
participant Raspberry pi
participant Website
Node->>Raspberry pi: sensordata via websocket every 5 seconds
Raspberry pi->>Website: Node data via websocket if new data is received from the node
Website->>Website: updateGraph()
Website->>Website: updateData()
```
1. Every node sends its data to the raspberry pi via websocket every 5 seconds
2. The raspberry pi sends the data to the website via websocket if new data is received from the node
3. The website updates the data coming from the raspberry pi on its own variables and arrays
4. The website updates the live graphs every time new data is received from the websocket
### Node
```mermaid
sequenceDiagram
participant Node
participant Raspberry pi
participant Website
Node->>Raspberry pi: node data via websocket every 5 seconds
Raspberry pi->>Website: Make a new object depending on what node it is
Website->>Website: updateNodeData()
Website->>Website: processNodeData()
```

View File

@@ -0,0 +1,117 @@
# Nodes
## Introduction
The nodes are the devices that are placed in the rooms. The nodes are used to collect the data from the sensors. Every node is connected to the websocket, and sends their data with their mac address in json format. The websocket broadcasts the node data back to all clients, and since our website functions as a client it also receives the data. Every node will, depending on what node, be made into a class.
## Requirements
### Sensornode
- Every node has to have a unique nodeID
- Every node has to have their corresponding sensorsvalues in form of arrays
### Feedbacknodes
- Every node has to have a unique nodeID
- Every node has to have their corresponding feedback in form of a 2D array
## Class diagrams
### Node
```mermaid
classDiagram
class Node {
+nodeID
+processNodeData()
+updateNodeData()
}
```
#### Sensornode
```mermaid
classDiagram
class SensorNode extends Node {
+tempArray
+humiArray
+eco2Array
+tvocArray
}
```
#### Feedbacknode
```mermaid
classDiagram
class FeedbackNode extends Node {
+feedbackArray
}
```
# Graphs
## Introduction
The graphs are used to display the data from the sensors. The data is collected by the raspberry pi and then displayed on the graphs. The graphs are made using the [plotly library](https://plotly.com/javascript/) .
## Requirements
### Live graphs
- Every node has to have a live graph
- The graphs has to be updated every 5 seconds
- All the data from one node has to fit in one graph
## Class diagrams
### Graphs
```mermaid
classDiagram
class graph {
+nodeId
makeGraph()
}
```
### Live graphs
```mermaid
classDiagram
class liveGraph extends graph {
+cnt
+timeArray
+tempArray
+humiArray
+eco2Array
+tvocArray
makeGraph()
updateGraph()
updateData()
}
```
## Order of operations
### Live graphs
```mermaid
sequenceDiagram
participant Node
participant Raspberry pi
participant Website
Node->>Raspberry pi: sensordata via websocket every 5 seconds
Raspberry pi->>Website: Node data via websocket if new data is received from the node
Website->>Website: updateGraph()
Website->>Website: updateData()
```
1. Every node sends its data to the raspberry pi via websocket every 5 seconds
2. The raspberry pi sends the data to the website via websocket if new data is received from the node
3. The website updates the data coming from the raspberry pi on its own variables and arrays
4. The website updates the live graphs every time new data is received from the websocket

View File

@@ -11,6 +11,9 @@ Raspberry pi <--> EnqueteNode : Websocket
namespace Server {
class Raspberry pi {
+MariaDB
+Apache2
+Python
Database()
Webserver()
Websocket()
@@ -27,7 +30,6 @@ namespace Server {
}
}
namespace User {
class Website {
+Co2

View File

@@ -0,0 +1,77 @@
```mermaid
classDiagram
setup --> websocketSetup
loop --> screenButtonHandler
screenButtonHandler --> DisplayText
screenButtonHandler --> sendData
sendData --> Server : Websocket
setup --> loop
python --> Server
Server --> website : Websocket
namespace ESP32Questionbox {
class setup {
+int questionID
+char*[] Question
+char*[] Answer
+DisplayText displayText
+void websocketSetup()
}
class loop {
+void screenButtonHandler()
+void sendData(int question, String answer)
+void hexdump(const void* mem, uint32_t len, uint8_t cols)
}
class websocketClient {
+loop()
+begin()
+sendTXT()
}
class websocketSetup {
+connectWifi()
+websocketConnect()
}
class screenButtonHandler {
-bool redButton
-bool greenButton
-bool whiteButton
+displayText.writeText()
+sendData()
}
class DisplayText {
+void writeText(char* text, int size, int posX, int posY, int screenTime, bool center, bool bottom)
-int centerText(char* text)
-void printWordsFull(char* text, bool bottom)
}
class sendData{
+webSocket.sendTXT
}
}
namespace server {
class python {
+databaseScript()
+websocketScript()
+flaskScript()
}
class Server {
+websocket()
+flask()
+mariaDB()
}
}
namespace user {
class website {
+ getLiveData()
+ getHistoricalData()
+ showData()
}
}
```

View File

@@ -0,0 +1,24 @@
# Talk with building management
## Introduction
We interviewed building management so we can clarify what they expect from the project and what they think of the state the project is in right now and if there need to be some adjustments. We also asked them some questions about the website and the node itself and the website. We primaly wanted clarity on what they thought on the website design because they are the ones that are going to use it the most.
## Questions for building management
1. Design of page? (current page, new design or own idea)
2. What do they expect of a page made for building management?
3. Do they think they can work with the incomming feedback from the enquete?
4. Design of the node? (plastic or wood)
## Answers
1. The current page is a bit too techincal and a bit unorganized. you couldnt tell that there is a new node added to the page. They also said that we needed to point out that there is another node connected for example start with half the ui of that specific node at the bottom of the screen.
2. They expect a page that is easy to use and dummy proof.
3. They think they can work with the incomming feedback from the enquete. And they thought it was a good idea to measure things that sensors cant measure for example peoples opinions.
4. plastic is better because it is easier to clean and it is more durable. It also looks nicer on the wall, it blends in better.
## Feedback:
Building management had some good feedback points about the page itself, about the idea and some good pointers for the execution. They would also look into making the data they are already measuring accessible for us so we can compare it to our own sensors. The things they had to say about the website are: they found the first design a bit unorganized and said that they would rather see the second design we had in figma where you can select the node you want to see, maybe also a search function to specify the node that is displayed. What also was said was to try to make it idiot-proof because not all of the building management people are very technical. They had some things to say about the node design, like maybe make the color white to make it better with blending into the white walls of the total area. They also asked the question of does it matter at what height the node is placed. One other thing they said was to write something onto the node to make it clear to the people in the area what it was doing, something like ReaderNode™. And the last thing they said was if we thought about how to make sure it doesnt get vandalized.
## Conclusion
Building management thought it was a good and interesting project. They wanna actively help us with the data they are already measuring and they had some good feedback points about the website and the node itself. They also had some good questions about the node itself that we need to look into. For example how are we are going to make sure it doesnt get vandalized. Furthermore they had good feedback on the website and they preffered our figma design over our current design and we needed to make the website dummy proof so everyone can use it even without technical knowledge.

View File

@@ -0,0 +1,83 @@
# The infrastructure
###
## Three layers
###
### functional
In the top layer of the infrastructure documentation, we are showing the functional flows of the information trafic between the user and the sensor/enquete that are located in the same room. The traffic consists of enviromental sensor values like temperature, humidity etc. Also it is showing the user input at the enquete device to the database that is hosted at the brain of the operation.
![functional Infra](../assets/funcionalInfra.png)
### Technical
In the middel layer we are showing the data flow and processing of the data at component level. It consists of 2 area's with 3 parts, namelie the server room and the building as in the common area. Here we send the data in JSON form that is collected at the enquete node (this is the feedback data) and the sensor node (this is the environmental data). This is sent to the database through the websocket that is running on the raspberry pi and than via a rest api sent to the database. If one of the operational manager would log in to the website. They would see the incomming sensor node data that is comming through, but also the data that is already collected and stored in the database.
![technical Infra](../assets/technicalInfra.png)
### UML diagram of software
At the lowest level of our system we are showing how the software is designed. This is shown as a UML diagram. The diagram is made with mermaid. This shows the work flow of the different parts of the software which is running on the main server, for which we are using a Raspberry pi. The pi is located on the 6th floor of the school building in a locked server room.
``` mermaid
classDiagram
Node --> Raspberry pi : Websocket
Raspberry pi --> Website : getData
Raspberry pi <--> EnqueteNode : Websocket
namespace Server {
class Raspberry pi {
+MariaDB
+Apache2
+Python
Database()
Webserver()
Websocket()
}
class Node {
+Co2
+Temperature
+Humidity
+Tfok
+Sound
collectData()
}
}
namespace User {
class Website {
+Co2
+Temperature
+Humidity
+Tfok
+Sound
+Graph
+Map
+Settings
GetData()
}
class EnqueteNode {
+Co2
+Temperature
+Humidity
+Tfok
+Sound
+Graph
+Map
+QuestionResponse
EnqueteDisplay()
EnqueteButtons()
GetData()
}
}
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -1,8 +1,10 @@
# TI Portfolio Website
## Team deurMat
Welkom op jullie portfolio website! Hier kunnen jullie documentatie kwijt
die jullie gaan schrijven voor jullie project.
Maak je pagina's vooral leuk door [plaatjes](https://knowledgebase.hbo-ict-hva.nl/1_beroepstaken/software/realiseren/talen/declaratief/markdown/1_markdown_basics/#afbeeldingen), [video's](https://knowledgebase.hbo-ict-hva.nl/1_beroepstaken/software/realiseren/talen/declaratief/markdown/videos/) en [diagrammen](https://knowledgebase.hbo-ict-hva.nl/1_beroepstaken/software/realiseren/talen/declaratief/markdown/mermaid_diagrammen/) toe te voegen; dit kan allemaal in [markdown](https://knowledgebase.hbo-ict-hva.nl/1_beroepstaken/software/realiseren/talen/declaratief/markdown/0_markdown/)!
{{ mdocotion_header('https://images.unsplash.com/photo-1498050108023-c5249f4df085?q=80&w=2072&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D') }}

View File

@@ -0,0 +1,20 @@
# OOP within Arduino
Object-Oriented Programming (OOP) is a way of programing that provides a means of structuring your code so the code is modular and can be used more often without making huge changes or having to copy past the same code.
## Abstraction
Abstraction in OOP is the process of exposing only the required essential variables and functions. This means hiding the complexity and only showing the essential features of the object. In Arduino, this could mean creating a class like `Sensor node` with methods such as `setUp()`, `displayData()`, and `checkForError()`.
## Encapsulation
Encapsulation is the technique used to hide the data and methods within an object and prevent outside access. In Arduino, this could mean having private variables and methods in a class that can only be accessed and modified through public methods.
## Which classes did we use
In this Arduino project, we used several classes to organize our code and manage the complexity of the project. Some of these classes include:
- `websockets`: This class is responsible for managing the WebSocket connections.
- `nodeReadings`: This class is responsible for managing the sensor readings.
Each of these classes encapsulates the data and methods related to a specific part of the project, making the code easier to understand and maintain.

View File

@@ -0,0 +1,43 @@
### Uml diagram:
``` mermaid
classDiagram
namespace Esp {
class Websockets{
+webSocket
+_WiFiMulti
hexdump()
websocketSetup()
loop()
webSocketEvent()
sendMyText()
}
class NodeReadings{
+TVOC_base, eCO2_base
+counter
+eCO2
+TVOC
+interval
+temperature
+humidity
+currentMillis
+lastMillis
+errorSGP30
+errorDHT11
+noise
setup()
loop()
resetValues()
update()
checkForError()
displayData()
}
}
```

View File

@@ -0,0 +1,111 @@
# TFT screen
## Prequesites
To use the TFT screen, you need to install the following libraries:
``` SPI.h , Adafruit_GFX.h, Adafruit_ST7796S_kbv.h ```
## Programming the screen
To program the screen we need to first declare all the pins and give it to the Adafruit_ST7796S_kbv.h library. Then we need to initialize the screen and we can start using it.
```cpp
#define TFT_CS 14
#define TFT_DC 13
#define TFT_RST 12
#define MOSI 11
#define SCK 10
#define MISO 9
//simplify the name of the library and feed all the correct pins to it
Adafruit_ST7796S_kbv tft = Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, MOSI, SCK, TFT_RST, MISO);
```
## Drawing on the screen
To draw on the screen we can use the following functions:
```cpp
tft.fillScreen(0x0000); //clear the screen
tft.fillRect(0, 0, 240, 240, 0xFFFF); //draw a white rectangle
tft.fillCircle(120, 120, 50, 0xF800); //draw a red circle
tft.fillTriangle(0, 0, 240, 240, 0, 240, 0x1F); //draw a blue triangle
tft.fillRoundRect(0, 0, 240, 240, 10, 0xF81F); //draw a pink rounded rectangle
tft.drawChar(120, 120, 'A', 0xFFFF, 0x0000, 2); //draw a character
tft.setTextSize(2); //set the text size
tft.setTextColor(0xFFFF); //set the text color
tft.setCursor(0, 0); //set the cursor
tft.println("Hello World!"); //print a string
```
To write Hello world on the screen we can use the following code:
```cpp
tft.fillScreen(0x0000); //clear the screen
tft.setTextSize(2); //set the text size
tft.setTextColor(0xFFFF); //set the text color
tft.setCursor(0, 0); //set the cursor so it starts at the top right, you can also make this other numbers to change the position
tft.println("Hello World!"); //print a string
```
To clear the screen for new text you can use the following code:
```cpp
tft.fillScreen(0x0000); //clear the screen
```
## Wiring
You can connect the wires to any pin except the vcc and the ground. The vcc and ground need to be connected to the 3.3v and ground of the esp32. The other pins can be connected to any pin of the esp32.
![TFT screen diagram](../assets/imagesSp2/fritzingscreen.png)
We aren't using the cs2 and the pen pin because we arent utilizing the touch function of the screen.
```mermaid
classDiagram
displayText <|-- Adafruit_ST7796S_kbv
class displayText{
+text
+color
+size
+posx
+posy
+void writeText()
-int bottomText(char* text)
-void printWordsFull(char* text)
-int centerText(char* text)
}
class Adafruit_ST7796S_kbv{
+fillScreen()
+fillRect()
+fillCircle()
+fillTriangle()
+fillRoundRect()
+drawChar()
+setTextSize()
+setTextColor()
+setCursor()
+println()
}
```
## Why did we choose for this screen?
We chose the screen too fast without going over all the functions and researching what we actually needed. For example we aren't using the touchscreen function of the screen so we could've gotten a different screen without touchscreen. We've attempted to use a screen for the raspberry pi with some pin headers on it but we couldn't get it to work with the esp32. We wanted to have a bigger screen than the small oled screens we already have because it isn't nice to read from and you need to get up close to see what it displays. With a bigger screen thats less of a issue. After the purchase we did some more research for screens but the bottomline was this was the best one we could get because there aren't screens that are this big without touchscreen.
## Sources
* https://www.tinytronics.nl/en/displays/tft/4-inch-tft-display-320*480-pixels-with-touchscreen-spi-st7796s Source for Driver
* https://github.com/prenticedavid/Adafruit_ST7796S_kbv Download link for the library

View File

@@ -0,0 +1,89 @@
# Node Design
## Design Process (led by sietse)
### Thoughts
Before making the design i was thinking about the following things:
- The node should be compact and simple
- The node should have a screen
- The node should have a bar with led's to show how much sound is picked up on the node
- The node should have a hexagon grid where the sensors are located behind
- The node should have two lights on top
- The nodes should be powered by batteries
I also thought about the following things on how to make the design. I have decided to make the design using fusion360, because i have some experience with it and i think it is a good tool to make the design. I wanted it to be really easy to assemble so i split the design in two parts. The top and the bottom. The top part will be the part with the screen and the sensors, and the bottom part will be the part with the whole circuitboard.
### Bottom design
I made the final design of sprint 1 using fusion360. I used the original drawing from Bram and modified it using the feedback we've got from the usertest. I begun making the bottom side of the node, because this could serve me as a template to make the rest. The bottom side was pretty easy to make because i only had to sketch and measure a few things. It eventually looked like this:
![The Bottom Side of the Node](../assets/ImagesSp1/Sp1NodeBottomSide.png)
### Top design
When i went to work on the upper side it took some more time than the bottom one. since i had to make cutouts for the screen and led bar and the hexagon grid. The hexagon grid was the hardest because i used the geometric pattern fucntion on my hexagon object and i had to make sure that there would still be room between the hexagons. I made it so the screens have like a indent on the top part. Otherwise the battery, sensors and esp32 wouldnt be able to fit underneath the grid. The final product looks like this:
![The Upper Side of the Node](../assets/ImagesSp1/Sp1NodeUpperSide.png)
### Assembly
#### First assembly
The part was finished on 15/2 at 11am. I first screwed the pcb in the bottom part which was really easy to do. When trying to put the top part on the bottom part i noticed that the holes were not aligned, and the batteryholder was fatter than i thought. I tried to cut some material away from the top part but it was still not fitting.
It looked like this from the top:
![The Assembly of the Node Topview](../assets/ImagesSp1/assemblyOfNodeTopview.jpg)
You can see that the oled screen cutouts and the led bar cutouts are not aligned with the components on the pcb.
---
And like this from the side view:
![The Assembly of the Node Sideview](../assets/ImagesSp1/assemblyOfNodeSideview.jpg)
Here you can see that the wifi antenna of the esp32 is not fitting in the top part, because the fillet is too small.
#### Second assembly
In fusion360 i made the cutouts for the screen and the led bar lower on the part. I also made the fillet on the top part a bit bigger, and adjusted the fillet on top too. We also decided we'd take this oppurtunitty to make vent holes in the bottom aswell. This is because hot air rises and with this there would be a little bit of air coming through the node for more accurate readings. I then printed the new design and it took around 7 hours. The new design looks like this:
![The New Upper Side of the Node](../assets/ImagesSp1/Sp1NodeUpperSideNew.png)
The new design fits perfectly and looks like this:
...
### Conclusion
```mermaid
graph LR
A[Design Sketch] -->|Usertest| B(Fusion360 design)
B -->|Not fitting| C[New fusion360 design]
C -->|assembly| D[Finished product]
```
## The evolved design of the nodes.
During the last sprint we had a lot of feeback about the node and mostly about tis design. hence why we had decided to remake it in several different ways.
We had made a prototype for a wooden version, but that never made it past an first sketch, seeing as almost all fedback came back telling About how the plastic design looked better and was less distreacting.
The user-test document is here:( https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59/-/blob/main/docs/brainstorm/Feedback.md?ref_type=heads#design-questions-led-by-bram )
After the results came back, we decided to make progress with further designing the cover of the node.
The main body shape was certain, because all of the components needed to fit inside of the node and needed some space.
Aswell as the simple shape to save on printing costs and keep the design simple to look at.
The only thing that was able to change was the cover.
The cover was originally made of solid plastic and was molded to fit the shape of the board and the sensors/ screen inside.
From here we decided to brainstorm on an easyer way of covering the circurty.
That is when it hit us, We could use acrylic as a cover!
Acrylic can come in many different colors, is easyer to cut out ( takes less time) and gives a bit of an isight into the wiring.
This this in mind we made a node with this new design and remade one with the old design, this again could be further used for user-tests.
For the time being we are able to show off both of the designs and are able to read data from both, the only difference being the outer shell.
The images:

View File

@@ -0,0 +1,80 @@
# Node
Since the node is what gathers all the data from the sensors, it is the most important part of the system. The node is responsible for reading the data from the sensors, processing it, and sending it to the server.
## Hardware
The node is composed of the following hardware components:
- [ESP32 S3 DevkitC](https://www.espressif.com/en/products/socs/esp32-s3)
- [SGP30](https://www.sensirion.com/en/environmental-sensors/gas-sensors/sgp30/)
- [DHT11](https://www.sparkfun.com/datasheets/Sensors/Temperature/DHT11.pdf)
- [OLED Display](https://www.tinytronics.nl/nl/displays/oled/1.3-inch-oled-display-128*64-pixels-wit-i2c)
## Software
The node is programmed using the Arduino IDE. The code is written in C++ and is responsible for reading the data from the sensors, processing it, and sending it to the server. The first couple versions of the code were written by Sietse, and because we all had to use Object Oriented Programming, Dano rewrote the code to be object-oriented. Which is now final version
### Libraries
The following libraries are used in the node code:
- Wire.h
- Adafruit_SH110X.h
- Adafruit_SGP30.h
- DHT.h
- WiFiMulti.h
- WiFi.h
- WebSocketsClient.h
- nodeCodeHeader.h
### Code
The code is divided into the following classes:
- Node readings
- Websockets
The two classes that are used are split into the 2 becouse the node readings handels everything about reading information from the sensors and displaying them on the screen, all the local stuff is handeled here so to speak. And into Websockets this handels every thing from connecting to the wifi to sending the data that is recorded from the sensors into json format and sending that data to the websockets so that the data can be prossed over there.
### Communication
The node communicates with the server using WebSockets. The node sends the data to our website which uses a reverse proxy to route it to the websocket. The server then processes the data and stores it in the database / puts it on the website. We use the WebSocketsClient library to communicate with the server. Because [websocket connections](docs\rpi-documentation\websockets.md) are stateful, we need to keep the connection alive. So we do not use any delays in the code, but instead use the millis() function to keep track of time.
Flow of the data:
```mermaid
flowchart LR
A(Sensors)
B(Node)
D(Websocket)
E(Website)
F(DB-Client)
G(Database)
A-->|sensordata| B
B -->|JSONData| D
D -->|JSONData| E
D -->|JSONData| F
F -->|Data| G
```
### Wiring Diagram
The wiring diagram for the node is as follows:
![Wiring diagram of node](..\assets\imagesSp3\wiringDiagramNode.png)
### Fritsing Diagram
![fritsing diagram of node](..\assets\Node.png)
## Future Improvements
The node is currently working as intended, but there are some improvements that could be made:
- The node could be made more energy efficient by putting the ESP32 in deep sleep mode when it is not sending data.
- The node could be made more robust by adding error handling to the code.
- The node could be made more secure by adding encryption to the data that is sent to the server.

View File

@@ -0,0 +1,298 @@
# Original Database - Websocket connection(by bram)
For our project, we needed to establish an efficient and functional connection between a live data collector and a database where this data would be stored.
The data we collected originated from live "nodes" which were small boxes equipped with various types of sensors to gather specific data from their surroundings.
This collected data needed to be transmitted to a database to facilitate its presentation on a website we were developing. The website would retrieve the data from the database and display it in various formats.
This is what the connection would be inserted.
![my connection](MyConnection.png)
Given the high demand of this data connection for our project, it was imprtant that it was reliably. Bram was given the task to designing a connection in Python between the WebSocket (live server) and the database (data storage).
Since we had the WebSocket data on a Raspberry Pi, it made sense to make the connection on the Pi itself. This became an opportunity for Bram to gain knowledge about Python, considering he originaly didn't have experience with this programming language.
## Python code + explaination
In the given Raspberry Pi, a file named "data.py" was created, from which this script could be called when needed.
At the beginning of the file, the code starts with importing the different required libraries.
```py
#this library makes functions run simultaneously
import asyncio
#This library makes the connection to the websocket possible.
import websockets
#This library makes a connection with the database
import mysql.connector
#This library makes json data readable.
import json
```
Afterward, a function would be called related to the "mysql.connector" library, where you would provide the login credentials of the database you have set up to establish a solid connection. This connection will be utilized multiple times later in the code.
```py
#async is making use of the asyncio library.
async def process_data(data):
try:
mydb = mysql.connector.connect(
host="localhost",
user="root",
# pasword hidden for privacy
password="********",
database="NodeData"
)
cursor = mydb.cursor()
```
This next part has a lot of different functions, so it will be split up for clarity.
It begins with creating a variable to retrieve information from a specific part of the database. This information is then stored in an array later on. In this case, it is selecting the existing MAC addresses from the database.
Afterward, a query is made for a different part of the code and acts as a "mold" for the data to be sent to the database. The values are not inserted yet because these will be the data collected from the nodes.
```py
#variable to connect to the DB
MACDataReading = mydb.cursor()
#get data from DB
MACDataReading.execute("SELECT MAC FROM Node")
#make a mold for the data to get to the DB
query = "INSERT INTO `Measurement` (NodeID, Type, Value) VALUES (%s, %s, %s)"
```
In the next part of the code, the data collected from the node (which is done later on) is processed here and made readable for the Python code.
This processed data is then split up into five different types: the temperature, the humidity, the eCO2 and TVOC values, and the MAC address from which this information was sent.
The MAC address is then taken and turned into a tuple. This is done because the database expects a tuple to be inserted instead of a string.
(for more information on tuples I suggest visiting https://www.w3schools.com/python/python_tuples.asp)
```py
#load the json data and make it readable.
processedData = json.loads(data)
#divide the data into types
processedTemp = (processedData['Temp'])
processedHumi = (processedData['Humi'])
processedeCO2 = (processedData['eCO2'])
processedTvoc = (processedData['TVOC'])
processedMAC = (processedData['node'])
#make a tuple of the MAC by placing a comma.
MACTuple = (processedMAC,)
```
Coming back to the previous lines of code, the data which was first asked for is now gathered and put into an array.
This array is then examined, and all the data is compared to the newly obtained MAC address.
If it is not found, then the new MAC address is added to the database. This makes automation much easier and makes the process of adding a new node easy.
```py
#fetching data and adding to an array.
MACDataFetching = MACDataReading.fetchall()
MACArray = list(MACDataFetching)
#see if the given MAC is not in the array.
if MACTuple not in MACArray:
#a query to insert the new MAC in the DB
addingNode = "INSERT INTO `Node` (MAC) VALUES (%s)"
#combine the query and the data and push it.
cursor.execute(addingNode, MACTuple)
mydb.commit()
```
From here the data which was collected from the websocket gets placed in an array together with a few guidlines to propperly place it in the correct files on the database.
After going along all instances of the array, the data gets pushed together with the query to propperly enter the database.
Sadly this version of the code is only able to push the data from the one node because of some errors within the datase.
(This is later fixed in the updated version my teammate made.)
```py
#making an array with the data to sort it and be able to be pushed to the database.
pushingDataArray = [(1, "Temp", processedTemp), (1, "Humi", processedHumi), (1, "eCO2", processedeCO2), (1, "TVOC", processedTvoc)]
#go along all instances in the array, and combine this with the query.
for i in pushingDataArray:
print(query ,i)
cursor.execute(query, i)
mydb.commit()
#in the case of an error, show what and where, and after, close the database connection.
except mysql.connector.Error as err:
print("MySQL Error:", err)
finally:
cursor.close()
mydb.close()
```
In the next function, the connection is established with the WebSocket and collects the data sent by the nodes. This data is then stored in a variable named "data". (This data is the same data that was being processed to make it readable for Python and was split up in differnt types.)
This function also verifies if the WebSocket connection can be established and provides an error message when this is not the case.
```py
async def receive_data():
uri = "ws://145.92.8.114/ws"
try:
async with websockets.connect(uri) as websocket:
while True:
data = await websocket.recv()
print(f"Received data: {data}")
await process_data(data)
except websockets.ConnectionClosedError as e:
print("WebSocket connection closed:", e)
```
This is one of the last functions where the file is instructed to wait for a WebSocket connection before executing the code. This is done to prevent false data from entering the database.
```py
async def main():
await receive_data()
asyncio.run(main())
```
As a summary, this code is meant to establish connections both to the database and the WebSocket to enable a data connection between them. When new data arrives, it will be pushed to the database, and if a new MAC address is encountered, it will be added to the list of addresses.
(The link to the code https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59/-/blob/main/server/web-data-connection/data.py?ref_type=heads)
# New Version (by sietse)
## Changes made
The original code was a good start, but it had some issues. The code could only handle the data from the sensorNodes and didn't include the nodeID for measurements.
Since we have 2 kind of nodes (sensorNodes and enqueteNodes) we needed to make another function to commit the enqueteData in the database. I have also made a filter to know which data is from the sensorNodes and which data is from the enqueteNodes. This way we can commit the data to the right table in the database.
I have also added a function to get the nodeID from the MAC address. This way we can commit the data to the right node in the database.
## The new "filter" code
### Function to get a list with macAdresses from the sensorNodes and enqueteNodes
To filter i have made 2 lists, one with all the mac adresses of the sensorNodes and the other with the mac adresses of the enqueteNodes.
The function that handles that and updates the list is the following:
```python
async def getNodeInfo(type):
global sensorNodeArray
global enqueteNodeArray
nodeInfoArray = []
id = (type,)
mydb = dbLogin()
cursor = mydb.cursor()
cursor.execute("""SELECT MAC FROM Node WHERE Type = %s""", id)
nodeInfo = cursor.fetchall()
for tuples in nodeInfo:
for item in tuples:
nodeInfoArray.append(item)
print(nodeInfoArray)
cursor.close()
mydb.close()
if type == 'sensor':
sensorNodeArray = nodeInfoArray
print(sensorNodeArray)
return sensorNodeArray
elif type == 'enquete':
enqueteNodeArray = nodeInfoArray
return enqueteNodeArray
```
As you can it works like this:
1. It gets the MAC adresses from the database with the type of node you want to get the data from. (sensor or enquete)
2. It executes the command and puts the data in a list.
3. It uses a nested for loop to get the data out of the tuples and puts it in the nodeInfoArray.
4. It updates, depending on what type, the sensorNodeArray or the enqueteNodeArray with the new data (NodeInfoArray).
5. It returns the array with the data.
### The filter code
Now that we have the data we can filter the data from the websocket.
```python
data = await websocket.recv()
processedData = json.loads(data)
macAdress = processedData['node']
if "Temp" in processedData:
type = 'sensor'
else:
type = 'enquete'
await getNodeInfo('sensor')
await getNodeInfo('enquete')
if macAdress in sensorNodeArray:
nodeID = await getNodeID(macAdress)
await processSensorNodeData(data, nodeID)
elif macAdress in enqueteNodeArray:
nodeID = await getNodeID(macAdress)
await processEnqueteNodeData(data, nodeID)
else:
await newNode(macAdress, type)
```
As you can see its alot of code to explain. So to make it easier i made a mermaid diagram to show how the code works / what it does.
```mermaid
graph TD
A[Get data from websocket] --> B{Is it sensor data or enquete data?}
B -->|sensor| C[Get sensorNodeArray]
B -->|enquete| D[Get enqueteNodeArray]
B -->|New node| E[Add new node to database]
C -->|data| G[Process sensorNodeData]
D -->|data| H[Process enqueteNodeData]
```
## The function to get the nodeID
This function is used to get the nodeID from the MAC adress. This way we can commit the data with the right id in the database.
The function to get the nodeID from the MAC adress is the following:
```python
async def getNodeID(macAdress):
id = (macAdress,)
mydb = dbLogin()
cursor = mydb.cursor()
cursor.execute("""SELECT nodeID FROM Node WHERE MAC = %s""", id)
data = cursor.fetchall()
for tuples in data:
for item in tuples:
nodeID = item
return nodeID
```
1. It gets the nodeID from the database with the MAC adress.
2. It executes the command and puts the data in a list.
3. It uses a nested for loop to get the data out of the tuples and puts it in the nodeID.
4. It returns the nodeID.
## The function to commit the data from the sensorNodes
This function is alot like the original one, with the only 2 changes being that it now also commits the nodeID and that the code to make a new node is now in a different function.
[link to code](../../server/web-data-connection/data.py)
## The function to commit the data from the enqueteNodes
This function is alot like the sensorNode function. It just commits the data to the enqueteData table in the database. And it has another data.
[Link to code](server\data.py)
## The function to add a new node to the database
This function is used to add a new node to the database. This is used when a new node is connected to the websocket, but not yet in the database.
The function to add a new node to the database is the following:
```python
async def newNode(mac, type):
id = (mac, type)
mydb = dbLogin()
cursor = mydb.cursor()
cursor.execute("INSERT INTO `Node` (MAC, Type) VALUES (%s, %s)", id)
print("new node assigned")
mydb.commit()
```
1. It gets the MAC adress and the type of node from the arguments.
2. It executes the command to add the new node to the database.
3. It prints that a new node is assigned.
4. It commits the data to the database.

View File

@@ -0,0 +1,16 @@
# Flask
## Introduction
Flask is a micro web framework written in Python. It is easy to use and has a lot of documentation. We are going to use Flask to serve our REST api.
## Cheatsheet
```python
print(f"Hello world have a nice {args}!")
```
This way you can put variables in a string. This is called f-strings.
## Rules for python
* You can only use one return statement in a function.

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Some files were not shown because too many files have changed in this diff Show More