2024-03-21 12:19:04 +01:00
2 changed files with 29 additions and 11 deletions

View File

@@ -1,5 +1,4 @@
## 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.
@@ -72,11 +71,9 @@ examples, basics, fade
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
@@ -185,7 +182,7 @@ pinMode(buzzertwo, OUTPUT);
void loop() {
//read is there is input on the button pin, if so send output to the other pins., otherwise keep them off.
//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);
@@ -196,7 +193,7 @@ void loop() {
}
```
Here I made the physical design but instead of buzzers i used lights in order to show it working.
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>)
@@ -243,11 +240,26 @@ elif c == 2:
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 their 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.
So after fixing some issues with the primary keys and some tesing with the code, I managed to fix the issues for the time being.
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.

View File

@@ -60,4 +60,10 @@ and im going to continue with working on the connection between the websocket an
Dano, oop arduino
Bram, nodes registereen als er een nieuwe binnenkomt
Sietse, onderdelen bestellen, verder user story 46: nodes beheren op website.
Sam, tft scherm, rest api ombouwen om data in node tabel te douwen
Sam, tft scherm, rest api ombouwen om data in node tabel te douwen
20/03/2024:
Dano: Adding comments for OOP Arduino
Bram: Python send node data to database
Sam: flask rerouten to use put recuest
Sietse: WireFrame