Commit ab1ee65e authored by Jacob Priddy's avatar Jacob Priddy 👌

add local cert file for default dev doorcode project, set good defautls

for config, remove debug task in main
parent f99ffc21
Pipeline #12540 passed with stages
in 1 minute and 13 seconds
-----BEGIN CERTIFICATE-----
MIIB6jCCAZECFDb5sh03iLzvv3lh9hGvPShVD+XxMAoGCCqGSM49BAMCMHcxCzAJ
BgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRYwFAYDVQQHDA1Db2xsZWdl
IFBsYWNlMQwwCgYDVQQKDANXV1UxHTAbBgNVBAsMFGVsb2NrIFJPT1QgQ0EgSVNT
VUVSMQ4wDAYDVQQDDAVlbG9jazAgFw0yMDA2MjcyMzIyNTFaGA8yMDcwMDYxNTIz
MjI1MVowdzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xFjAUBgNV
BAcMDUNvbGxlZ2UgUGxhY2UxDDAKBgNVBAoMA1dXVTEdMBsGA1UECwwUZWxvY2sg
Uk9PVCBDQSBJU1NVRVIxDjAMBgNVBAMMBWVsb2NrMFkwEwYHKoZIzj0CAQYIKoZI
zj0DAQcDQgAEAhPkFYRa4nWox26JCB8ClUg/PORZvkkzGMV4/yKZNWPSRtqS8QKD
09dRt55MVj5W4AmRkRHwqbXTAvujt7eovzAKBggqhkjOPQQDAgNHADBEAiBjDRHN
wmkwISOF2AE3cAgyMiUlXPA+WAZKHgbxKX1MUwIgdW47WeuGJ53939yX1vOiYDky
GLh8/I3sv/uEnA0TIFI=
-----END CERTIFICATE-----
#ifndef DOOR_CONFIG_H
#define DOOR_CONFIG_H
#define DOOR_WIFI_SSID "ssid"
#define DOOR_WIFI_PASSWORD "password"
#define DOOR_WIFI_SSID "WWU-HWAuth"
#define DOOR_WIFI_PASSWORD ""
#define API_HOST "elock.cs.wallawalla.edu"
#define API_PORT 4433
......@@ -30,7 +30,7 @@
// Every Day
#define SNTP_UPDATE_INTERVAL_MS (1000*60*60*24)
//#define UPDATE_SKIP_VERSION_CHECK
#define UPDATE_SKIP_VERSION_CHECK
#define DOOR_LATCH_PIN 19
......@@ -43,7 +43,7 @@
#define KEYPAD_COL1_PIN 5
#define KEYPAD_COL2_PIN 18
#define DOOR_LOCK_PIN 12
#define DOOR_LOCK_PIN 21
#define DOOR_OPEN_LENGTH_MS (2.5 * 1000)
#define MIN_CODE_LENGTH 4
......@@ -55,7 +55,7 @@
#define KEYPAD_SCAN_PERIOD_MS 50
// How long to wait before clearing the keypad if there have been no keypresses
#define KEYPAD_CLEAR_TIME_MS (1000 * 30)
#define KEYPAD_CLEAR_TIME_MS (1000 * 15)
#define KEYPAD_SUBMIT_CODE_KEY '#'
......
......@@ -19,56 +19,56 @@
#include "app/latch.h"
static const char* TAG = "MAIN_MODULE";
static volatile bool door_request_done;
static volatile bool door_access_accepted;
static void code_check_done(int32_t status_code)
{
door_request_done = true;
door_access_accepted = status_code == HTTP_SUCCESS;
}
static void check_code_task(void* pvParameters)
{
(void)pvParameters;
door_rtos_wait_forever_for_event(WIFI_CONNECTED_EVENT);
ESP_LOGI(TAG, "Connected to AP, begin connecting to DoorCode API");
door_api_verify_code("123866", code_check_done);
while (!door_request_done)
door_rtos_task_delay(100);
if (door_access_accepted)
{
ESP_LOGI(TAG, "We are allowed in the first door!");
door_lock_open();
}
else
ESP_LOGI(TAG, "REJECTED from first door");
door_request_done = false;
door_rtos_task_delay(5000);
ESP_LOGI(TAG, "Making second request");
door_api_verify_code("123867", code_check_done);
while (!door_request_done)
door_rtos_task_delay(100);
ESP_LOGI(TAG, "Done with second request");
if (door_access_accepted)
{
ESP_LOGI(TAG, "We are allowed in the second door!");
door_lock_open();
}
else
ESP_LOGI(TAG, "REJECTED from second door");
// door_api_stop();
// door_wifi_destroy();
ESP_LOGI(TAG, "Finished Requests shutting down the scrublord thread");
door_rtos_task_current_kill();
}
//static volatile bool door_request_done;
//static volatile bool door_access_accepted;
//static void code_check_done(int32_t status_code)
//{
// door_request_done = true;
// door_access_accepted = status_code == HTTP_SUCCESS;
//}
//static void check_code_task(void* pvParameters)
//{
// (void)pvParameters;
// door_rtos_wait_forever_for_event(WIFI_CONNECTED_EVENT);
// ESP_LOGI(TAG, "Connected to AP, begin connecting to DoorCode API");
//
// door_api_verify_code("123866", code_check_done);
// while (!door_request_done)
// door_rtos_task_delay(100);
//
// if (door_access_accepted)
// {
// ESP_LOGI(TAG, "We are allowed in the first door!");
// door_lock_open();
// }
// else
// ESP_LOGI(TAG, "REJECTED from first door");
//
// door_request_done = false;
//
// door_rtos_task_delay(5000);
//
// ESP_LOGI(TAG, "Making second request");
//
// door_api_verify_code("123867", code_check_done);
// while (!door_request_done)
// door_rtos_task_delay(100);
// ESP_LOGI(TAG, "Done with second request");
// if (door_access_accepted)
// {
// ESP_LOGI(TAG, "We are allowed in the second door!");
// door_lock_open();
// }
// else
// ESP_LOGI(TAG, "REJECTED from second door");
//
//// door_api_stop();
//// door_wifi_destroy();
// ESP_LOGI(TAG, "Finished Requests shutting down the scrublord thread");
// door_rtos_task_current_kill();
//}
void initialize(void)
{
......@@ -106,7 +106,7 @@ void start(void)
xTaskCreate(door_state_task, "state_task", 4096, NULL, 5, NULL);
xTaskCreate(update_task, "update_task", 4096, NULL, 2, NULL);
xTaskCreate(check_code_task, "http_task", 4096, NULL, 3, NULL);
// xTaskCreate(check_code_task, "http_task", 4096, NULL, 3, NULL);
xTaskCreate(door_status_refresh_task, "refresh_task", 4096, NULL, 5, NULL);
xTaskCreate(door_status_sync_status_task, "sync_task", 10240, NULL, 4, NULL);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment