Differences

This shows you the differences between two versions of the page.

Link to this comparison view

iothings:proiecte:2022:magneticauth [2023/06/02 20:00]
carol.bontas [Cum comparam semnaturile ?]
iothings:proiecte:2022:magneticauth [2023/06/02 20:09] (current)
carol.bontas
Line 43: Line 43:
 {{:​iothings:​proiecte:​2022:​sumstable_joined_mapped.jpg?​750|}} {{:​iothings:​proiecte:​2022:​sumstable_joined_mapped.jpg?​750|}}
  
-5. Facem suma fiecarei coloane de patrate si produse (exemplu din poza ar fi un tabel ce contine suma sumelor partiale)+5. Facem suma fiecarei coloane de patrate si produse (exemplu din poza ar fi un tabel ce contine suma patratelor ​sumelor partiale)
  
 {{:​iothings:​proiecte:​2022:​one_join_table.jpg?​750|}} {{:​iothings:​proiecte:​2022:​one_join_table.jpg?​750|}}
Line 56: Line 56:
  
  
-===== Hardware Description ​=====+===== Descriere hardware ​=====
  
 Componente necesare: Componente necesare:
Line 64: Line 64:
  
  
-===== Software Description ​=====+===== Descriere software ​=====
  
 Pentru stocarea, procesarea si afisarea datelor folosim InfluxDB. Pentru stocarea, procesarea si afisarea datelor folosim InfluxDB.
Line 93: Line 93:
 Concret pentru a citi inregistrati de la senzorul Hall se apeleaza astfel <​code>​ doUntilSerialInput(sampleHallSensor,​ NULL) </​code>​ Concret pentru a citi inregistrati de la senzorul Hall se apeleaza astfel <​code>​ doUntilSerialInput(sampleHallSensor,​ NULL) </​code>​
  
 +2. [[https://​github.com/​CSBonLaboratory/​MagneticAuth/​blob/​main/​magnetic_influx.cpp | magnetic_influx.cpp]] este o componenta auxiliara ce se ocupa exolicit cu interactiunea cu InfluxDB.
 +
 +partea centrala este reprezentata de construirea query-ului de Flux care sa verifice daca id-ul dat apare sau nu in bucket-ul "​Signatures"​.
 +
 +Prezinta urmatorea interfata:
 +<​code>​int userExists(int id){
 +  String existQuery = String("​from(bucket:​ \""​) + String(BUCKET_USERS) + String("​\"​)"​);​
 +  existQuery += String("​|>​ range(start:​ 2021-05-22T23:​30:​00Z)"​);​
 +  existQuery += String("​|>​ filter(fn: (r) => r._measurement == \""​) + String(MEASUREMENT) + String("​\"​ and r.id == \""​) + String(id) + String("​\"​)"​); ​
 +  existQuery += String("​|>​ count()"​);​
 +
 +  Serial.println(existQuery);​
 +  int userFound = 0;
 +  FluxQueryResult result = clients[USERS_INDEX].query(existQuery);​
 +
 +  while(result.next()){
 +    if(result.getValueByName("​_value"​).getLong() > 0){
 +      Serial.println("​User was registered in the past"​);​
 +      userFound = 1;
 +    }
 +  }
 +
 +  if(result.getError() != ""​){
 +    Serial.print("​Query result error: ");
 +    Serial.println(result.getError());​
 +    return -1;
 +  }
 +
 +  Serial.print("​User id");
 +  Serial.println(id);​
 +  Serial.println("​ is available."​);​
 +  result.close();​
 +  return userFound;
 +
 +}
 +</​code>​
  
-===== InfluxDB ===== 
-{{:​iothings:​proiecte:​2022sric:​screenshot_5.png?​800|}} 
  
-===== Grafana ===== 
-{{:​iothings:​proiecte:​2022sric:​screenshot_4.png?​800|}} 
  
 ===== Bibliografie ===== ===== Bibliografie =====
-  * https://randomnerdtutorials.com/​esp32-influxdb/​ +  * https://www.wallstreetmojo.com/pearson-correlation-coefficient
-  * https://​randomnerdtutorials.com/esp32-web-server-with-bme280-mini-weather-station+  * https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino
-  * https://megma.ma/wp-content/​uploads/​2021/​08/Wemos-ESP32-Lolin32-Board-BOOK-ENGLISH.pdf +
-  * https://​www.mischianti.org/​wp-content/​uploads/​2020/​11/​ESP32-WeMos-LOLIN32-pinout-mischianti.png+
iothings/proiecte/2022/magneticauth.1685725246.txt.gz · Last modified: 2023/06/02 20:00 by carol.bontas
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0