Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
265fd56
testing code ready for deploying
abalakrishnan1 Nov 20, 2022
90041c8
made mistake with escape, fixed now
abalakrishnan1 Nov 21, 2022
160fbfd
added lcd support
abalakrishnan1 Nov 21, 2022
07ebd14
fixes
abalakrishnan1 Nov 21, 2022
c02876a
Improved security
akhil-datla Nov 25, 2022
7dcd6bf
Check for admin pass
akhil-datla Nov 25, 2022
0da4b42
Switch from flags to env variables
akhil-datla Nov 25, 2022
2258b90
fixup! Switch from flags to env variables
akhil-datla Nov 25, 2022
dd44528
Update .goreleaser.yml
akhil-datla Nov 25, 2022
69edf2a
Remove password from search API
akhil-datla Nov 25, 2022
bc85282
Merge branch 'main' of https://github.com/VCHS-R-D/EZCheck into main
akhil-datla Nov 25, 2022
d904011
Create new get user and get admin route
akhil-datla Nov 25, 2022
37f88e2
deleted old frontend folder
braydentam Nov 25, 2022
69f129c
barely started frontend code
braydentam Nov 25, 2022
23d248e
added userlist for admin
braydentam Nov 26, 2022
91af9bc
Minor updates
akhil-datla Nov 26, 2022
fe9417a
Update routers.go
akhil-datla Nov 26, 2022
bc9ba49
Update routers.go
akhil-datla Nov 26, 2022
eb2d417
Create ArduinoAuthenticator.ino
3LucasZ Nov 27, 2022
9e9cd44
Delete ArduinoAuthenticator
3LucasZ Nov 27, 2022
4525c89
Fixed user and admin auth
akhil-datla Nov 27, 2022
24dcb5f
Update README.md
3LucasZ Nov 27, 2022
a808f2d
Create ESPPost.ino
3LucasZ Nov 27, 2022
91811d7
Update ESPPost.ino
3LucasZ Nov 27, 2022
acc80e8
Create ESPGet.ino
3LucasZ Nov 27, 2022
94c16ef
Update ESPGet.ino
3LucasZ Nov 27, 2022
174070b
combined lucas code and added to hardware manager
abalakrishnan1 Nov 28, 2022
4834e3f
Merge branch 'main' of https://github.com/VCHS-R-D/EZCheck into main
abalakrishnan1 Nov 28, 2022
f54e7d4
key pad clear, lcd clear, other fixes.
abalakrishnan1 Nov 28, 2022
7890518
deleted unecessary files
abalakrishnan1 Nov 28, 2022
5c1fd12
Add ESP code
3LucasZ Nov 29, 2022
798f30b
Relocate to ESP folder (deleted arduino)
3LucasZ Nov 30, 2022
72f0d7b
added logs
braydentam Dec 5, 2022
a7ea62d
Fix search users and admins
akhil-datla Dec 18, 2022
e102f1d
Fixes
akhil-datla Dec 18, 2022
5491b72
showing machines
braydentam Dec 19, 2022
1d60688
Fixes
akhil-datla Dec 19, 2022
be3d9f1
Merge branch 'main' of https://github.com/VCHS-R-D/EZCheck into main
akhil-datla Dec 19, 2022
82b2870
Fixed naming conventions
akhil-datla Dec 19, 2022
6279924
Fix get user and admin API
akhil-datla Dec 19, 2022
ec6691a
Fixed user search
akhil-datla Dec 20, 2022
c26f305
certification
braydentam Dec 22, 2022
ac68545
working student select + machine adding
braydentam Dec 26, 2022
3516cc2
logout
braydentam Dec 27, 2022
65df46a
Fix API return statements
akhil-datla Dec 27, 2022
a448c4b
Merge branch 'main' of https://github.com/VCHS-R-D/EZCheck into main
akhil-datla Dec 27, 2022
14b1ec9
user account creation/signin
braydentam Dec 29, 2022
6463959
create/delete machines
braydentam Jan 3, 2023
7827249
cleaned up code
braydentam Jan 3, 2023
c92f64b
Clear machine associations before deleting user
akhil-datla Jan 4, 2023
65585b6
Merge branch 'main' of https://github.com/VCHS-R-D/EZCheck into main
akhil-datla Jan 4, 2023
411aa92
Update ESPAuthenticator.ino
3LucasZ Jan 7, 2023
9fa1586
Bump json5 from 1.0.1 to 1.0.2 in /frontend/ezcheck
dependabot[bot] Jan 9, 2023
e3a0f2a
prototype code with fixes
abalakrishnan1 Jan 18, 2023
53d4c8d
merge conflicts
abalakrishnan1 Jan 18, 2023
d9d9d3e
Newest edition of ESP Authenticator
3LucasZ Jan 19, 2023
60dd507
Update .gitignore
3LucasZ Jan 19, 2023
2521e79
New Machine Manager
3LucasZ Jan 19, 2023
7a806a0
Refactor ESP32 Unit Testing
3LucasZ Jan 19, 2023
b02b9dd
Fix CreateAdmin
akhil-datla Jan 26, 2023
ddc9301
Fix Authenticate and Signout handlers
akhil-datla Jan 27, 2023
afb9bef
Style ui with tailwind
adityapawar1 Jan 27, 2023
2ddf6d4
chg
3LucasZ Jan 27, 2023
ab509f1
chg
3LucasZ Jan 27, 2023
23a503e
Merge pull request #2 from adityapawar1/main
abalakrishnan1 Jan 29, 2023
e26883f
Fix Authenticate handler
akhil-datla Jan 30, 2023
c86fe26
Merge branch 'main' of https://github.com/VCHS-R-D/EZCheck into main
akhil-datla Jan 30, 2023
8a62107
Merge pull request #1 from VCHS-R-D/dependabot/npm_and_yarn/frontend/…
akhil-datla Jan 30, 2023
1873cdb
updated code for esp
abalakrishnan1 Jan 31, 2023
44878c6
resolved merge conflicts
abalakrishnan1 Feb 1, 2023
6fdc4f6
Update MachineManager.ino
3LucasZ Feb 1, 2023
7cbc994
Merge branch 'main' of https://github.com/VCHS-R-D/EZCheck
3LucasZ Feb 1, 2023
25b7c17
added ui
braydentam Feb 6, 2023
5f122ab
finished UI
braydentam Feb 6, 2023
809afa8
ui improvements
braydentam Feb 7, 2023
4a8ecdc
fixes
braydentam Feb 9, 2023
6273199
Refactor code
akhil-datla Feb 22, 2023
02748f0
Bump golang.org/x/net from 0.2.0 to 0.7.0
dependabot[bot] Feb 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
variables.env

# Binaries for programs and plugins
*.exe
*.exe~
Expand All @@ -14,4 +16,5 @@
# frontend crap
frontend/my-app/node_modules
frontend/my-app/package-lock.json
frontend/my-app/package.json
frontend/my-app/package.json
.DS_Store
4 changes: 3 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# .goreleaser.yml
archives:
- files:
- variables.env
builds:
- goos:
- darwin
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"C_Cpp.errorSquiggles": "disabled"
}
184 changes: 184 additions & 0 deletions ESP32/MachineManager/MachineManager.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
#include <ArduinoJson.h>
#include <Keypad.h>
#include <LiquidCrystal.h>
#include <WiFi.h>
#include <HTTPClient.h>
//HTTP vars
const char* ssid = "Metro";
const char* password = "nosoup4u";

const String machineID = "machine1";
const String path = "http://10.124.5.254:8080/auth";
const String signout = "http://10.124.5.254:8080/signout";
bool signedIn = false;
String curr_name = "";

//Keypad vars
const int ROW_NUM = 4; //four rows
const int COLUMN_NUM = 4; //four columns

char keys[ROW_NUM][COLUMN_NUM] = {
{'1','2','3', 'A'},
{'4','5','6', 'B'},
{'7','8','9', 'C'},
{'*','0','#', 'D'}
};

byte pin_rows[ROW_NUM] = {17, 5, 18, 19}; //connect to the row pinouts of the keypad {R1, R2, R3, R4}
byte pin_column[COLUMN_NUM] = {15, 2, 4, 16}; //connect to the column pinouts of the keypad {C1, C2, C3, C4}

Keypad keypad = Keypad( makeKeymap(keys), pin_rows, pin_column, ROW_NUM, COLUMN_NUM);

//LCD vars
const int rs = 33, en = 25, d4 = 26, d5 = 27, d6 = 14, d7 = 32;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

//LED vars
const int led = 21;

//Pass vars
String pass = "";

void setup(){
//activate
Serial.begin(9600);
WiFi.begin(ssid, password);
lcd.begin(16, 2);
pinMode(led,OUTPUT);

//setup wifi
lcd.print("Connecting");
while(WiFi.status() != WL_CONNECTED) {
delay(500);
lcd.print(".");
}
lcd.clear();
lcd.print("Connected");
delay(1000);

//init state
lcd.clear();
lcd.print("Welcome!");
digitalWrite(led,LOW);
}

void loop(){
//handle keypress
char key = keypad.getKey();
if (key){
//# -> sign out
if (signedIn){
if (key=='#') {
if (machineSignout()) {
digitalWrite(led, LOW);
lcd.clear();
lcd.print("Signed Out");
signedIn = !signedIn;
}
}
}
else {
//D -> cut pass
if (key=='D') {
pass.remove(pass.length()-1);
//display
lcd.clear();
lcd.print(pass);
}
//* -> submit pass
else if (key=='*') {
lcd.clear();
//make request
boolean res = validate(pass);
// correct pass
if (res) {
lcd.clear();
String message = "Hello ";
message.concat(curr_name);
lcd.print(message);
digitalWrite(led,HIGH);
signedIn = true;
}
//wrong pass
else lcd.print("Denied Access");
pass="";
}
//else -> add char to pass
else {
pass.concat(key);
//display
lcd.clear();
lcd.print(pass);
Serial.println(pass);
}
}
}
}

boolean validate(String pass){
//connected
if(WiFi.status() == WL_CONNECTED){
//confirmation
lcd.clear();
lcd.print("Sending pin");
//send post request
WiFiClient client;
HTTPClient http;
http.begin(client, path);
http.addHeader("Content-Type", "application/json");
int httpResponseCode = http.POST("{\"code\":\"" + pass + "\",\"machineID\":\"" + machineID+"\"}");
//valid request
String response = http.getString();
DynamicJsonDocument response_data(1024);
deserializeJson(response_data, response);
bool auth = response_data["authorized"];

if (auth) {
String temp_name = response_data["name"];
curr_name = temp_name;
http.end();
pass = "";
return true;
}
else {
lcd.clear();
lcd.print("Error: ");
lcd.print(httpResponseCode);
Serial.println(httpResponseCode);
curr_name = "";
http.end();
pass = "";
return false;
}
// Free resources
}
return false;
}

boolean machineSignout(){
//connected
if(WiFi.status() == WL_CONNECTED){
//send post request
WiFiClient client;
HTTPClient http;
http.begin(client, signout);
http.addHeader("Content-Type", "application/json");
int httpResponseCode = http.POST("{\"name\":\"" + curr_name + "\",\"machineID\":\"" + machineID+"\"}");

if (httpResponseCode == 200) {
return true;
}
else {
lcd.clear();
lcd.print("Error Signing Out: ");
lcd.print(httpResponseCode);
Serial.println(httpResponseCode);
curr_name = "";
http.end();
pass = "";
return false;
}
// Free resources
}
return false;
}
97 changes: 97 additions & 0 deletions ESP32/Misc/hardware_manager/hardware_manager.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// arduino json
#include <WiFi.h>
#include <HTTPClient.h>
#include <Keypad.h>
#include <LiquidCrystal.h>

#define BUTTON_PIN 2
#define LED_PIN 3
//Keypad vars
const int ROW_NUM = 4; //four rows
const int COLUMN_NUM = 4; //four columns

char keys[ROW_NUM][COLUMN_NUM] = {
{'1','2','3', 'A'},
{'4','5','6', 'B'},
{'7','8','9', 'C'},
{'*','0','#', 'D'}
};

byte pin_rows[ROW_NUM] = {36, 34, 32, 30}; //connect to the row pinouts of the keypad
byte pin_column[COLUMN_NUM] = {28, 26, 24, 22}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), pin_rows, pin_column, ROW_NUM, COLUMN_NUM );

//LCD vars
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
const int LENGTH = 6;

String keypad_buffer;

//pass
const char* ssid = "";
const char* password = "";

//server endpoints
String path = "http://192.168.1.208:8080/";
String authPath = server+"/auth";
String machineID = "laser_cutter";

void setup() {
keypad_buffer = "";
// light protoype with LED
setMode(LED_PIN, OUTPUT);
Serial.begin(115200);
WiFi.begin(ssid, password);
Serial.println("Connecting");

while(WiFi.status() != WL_CONNECTED) {}

Serial.println("");
Serial.print("Connected to WiFi network with IP Address: ");
Serial.println(WiFi.localIP());
}

void loop() {
char key = keypad.getKey();
String lcd_input = "";

if (key) {
if key == 'D' && keypad_buffer.length() > 0 {
keypad_buffer.remove(keypad_buffer.length() - 1);
lcd.print(lcd_input.remove(lcd_input.length() - 1));
} else {
keypad_buffer.concat(key);
lcd.print(lcd_input.concat("*"));

if(keypad_buffer.length() == 6 && WiFi.status() == WL_CONNECTED) {
WiFiClient client;
HTTPClient http;
http.begin(client, authPath);
http.addHeader("Content-Type", "application/json");

int httpResponseCode = http.POST("{\"code\":\""+keypad_buffer+"\",\"machineID\":\""+machineID+"\"}");
//handle response
if (httpResponseCode>0) {
Serial.print("HTTP Response code: ");
Serial.println(httpResponseCode);
String payload = http.getString();
Serial.println(payload);
}
else {
Serial.print("Error code: ");
Serial.println(httpResponseCode);
}

// Free resources
http.end();

// clear hardware resources
lcd.clear();
keypad_buffer.remove(0);
}
}
}

}
14 changes: 14 additions & 0 deletions ESP32/Misc/protoype/debug.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Example OpenOCD configuration file for ESP32-WROVER-KIT board.
#
# For example, OpenOCD can be started for ESP32 debugging on
#
# openocd -f board/esp32-wrover-kit-3.3v.cfg
#

# Source the JTAG interface configuration file
source [find interface/ftdi/esp32_devkitj_v1.cfg]
set ESP32_FLASH_VOLTAGE 3.3
# Source the ESP32 configuration file
source [find target/esp32.cfg]
19 changes: 19 additions & 0 deletions ESP32/Misc/protoype/debug_custom.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name":"Arduino on ESP32",
"toolchainPrefix":"xtensa-esp32-elf",
"svdFile":"esp32.svd",
"request":"attach",
"postAttachCommands":[
"set remote hardware-watchpoint-limit 2",
"monitor reset halt",
"monitor gdb_sync",
"thb setup",
"c"
],
"overrideRestartCommands":[
"monitor reset halt",
"monitor gdb_sync",
"thb setup",
"c"
]
}
Loading