Skip to content

Commit

Permalink
Merge pull request #143 from dasuntheekshanagit/main
Browse files Browse the repository at this point in the history
gun finialized
  • Loading branch information
dasuntheekshanagit authored Jan 29, 2024
2 parents 9dcf7cc + ddac243 commit 332cbc3
Show file tree
Hide file tree
Showing 7 changed files with 296 additions and 165 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,8 @@ sysinfo.txt
*.unitypackage

.DS_Store

code/mqtt/awsRootCA.pem
code/mqtt/deviceCert.crt
code/mqtt/deviceCert.key
code/Gun/lib/Secrete.h
1 change: 1 addition & 0 deletions code/Gun/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
lib/*
114 changes: 56 additions & 58 deletions code/Gun/lib/Secrets.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#include <pgmspace.h>

#define SECRET
#define THINGNAME "Gyro_ESP32"
#define PUBLISH_TOPIC "gyro/pub"
#define SUBSCRIBE_TOPIC "gyro/sub"
#define ISRFIRE_PUBLISH_TOPIC "gyro/ISR/fire"
#define ISRMODE_PUBLISH_TOPIC "gyro/ISR/mode"
#define ISRRELOAD_PUBLISH_TOPIC "gyro/ISR/reload"
#define THINGNAME "gun0002"
#define PUBLISH_TOPIC "gun0002/gyro/pub"
#define SUBSCRIBE_TOPIC "gun0002/gyro/sub"
#define ISRFIRE_PUBLISH_TOPIC "gun0002/gyro/ISR/fire"
#define ISRMODE_PUBLISH_TOPIC "gun0002/gyro/ISR/mode"
#define ISRRELOAD_PUBLISH_TOPIC "gun0002/gyro/ISR/reload"

const char WIFI_SSID[] = "Dasun's Galaxy M21";
const char WIFI_PASSWORD[] = "sise9444";
// const char AWS_IOT_ENDPOINT[] = "a33hi7uoksyr8d-ats.iot.eu-north-1.amazonaws.com";
const char AWS_IOT_ENDPOINT[] = "192.168.224.122";
// const int AWS_IOT_PORT = 8883;
const int AWS_IOT_PORT = 1884;
const char AWS_IOT_ENDPOINT[] = "a2leuqp8y2i70g-ats.iot.ap-southeast-1.amazonaws.com";
const int AWS_IOT_PORT = 8883;
// const int AWS_IOT_PORT = 1884;

// Amazon Root CA 1
static const char AWS_CERT_CA[] PROGMEM = R"EOF(
Expand All @@ -37,63 +37,61 @@ o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU
5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy
rqXRfboQnoZsG4q5WTP468SQvvG5
-----END CERTIFICATE-----

)EOF";
// Device Certificate //change this
static const char AWS_CERT_CRT[] PROGMEM = R"KEY(
-----BEGIN CERTIFICATE-----
MIIDWTCCAkGgAwIBAgIUDCM5pNbhQBIjgYPfeqXlZovOjlEwDQYJKoZIhvcNAQEL
BQAwTTFLMEkGA1UECwxCQW1hem9uIFdlYiBTZXJ2aWNlcyBPPUFtYXpvbi5jb20g
SW5jLiBMPVNlYXR0bGUgU1Q9V2FzaGluZ3RvbiBDPVVTMB4XDTI0MDEwNjE4Mzcw
NVoXDTQ5MTIzMTIzNTk1OVowHjEcMBoGA1UEAwwTQVdTIElvVCBDZXJ0aWZpY2F0
ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJucTSNt2VpWIn5HDjxp
3gvz6ndOuYGQ03Y4RMowaOyUvOYpU5qP8ujou2fd38C10FSLkK7L7mujWagMpgio
n2O7JvGb7tEmhFPpOKlXJLRyhKOOOsfISQE3exXjNbZn7KD/Obpbd56wAkgu/Kt0
i6L0tvoDkbCzCVljQ6AOtVIMbHyIzVPOKjGq2gEcUSasDoZZEqfTFq2c2pK4+r4C
jiV61tDf8jwFG4tr7/wyxqB/7PfdldVHw4OUVnPR4XiyIipPG7G6ZONqUBL8W4K4
e7yzwUovA3K9EDRjJzHo+T0h9ISFVXTgkjLo51zOLCwq/GEMDDZfkMH8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O4EaJs4V1YwFu6FLNl/ns/hpAF3FUr5YP4Ng
jo9evvzzr/rACDpwRqO7rpums7VRqhB588YfV+iUpbkff9jK1UIEy+LfDFbX+s44
RVhH4QIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBPV1dOP7c41H0NoCh6TW+rcPbw
WrBF6Zzml9Bhs7wmSdXJjwA26bqvFWkOxBu46UM3qHPDOUSlhJBxnv/WMy/BWmds
/QIYb7cR1yg+DWsODTw4ZauG067yBAVYZtMIjxSRrdR4GB5PDkC5dHECSWDssTSi
eribVpbdduTFrnTkyBdWzCwxrgZLU4dXxhGAK+5Xw3cJ+Qkxxf4zkPtuqp3AOb2M
kOpHPfX6Z0zUG9g34io2DRZidYAdB//9K4V5hkqMWqB3WPBtbPaYuRVs6yLqibnJ
bJ+qloMlqw8zSQ7O3Y7K+Oq+JmF1w5/J09SzOULX9qJxf5C0tMDbsHABjHkq
-----END CERTIFICATE-----



)KEY";
// Device Private Key //change this
static const char AWS_CERT_PRIVATE[] PROGMEM = R"KEY(
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAm5xNI23ZWlYifkcOPGneC/Pqd065gZDTdjhEyjBo7JS85ilT
mo/y6Oi7Z93fwLXQVIuQrsvua6NZqAymCKifY7sm8Zvu0SaEU+k4qVcktHKEo446
x8hJATd7FeM1tmfsoP85ult3nrACSC78q3SLovS2+gORsLMJWWNDoA61UgxsfIjN
U84qMaraARxRJqwOhlkSp9MWrZzakrj6vgKOJXrW0N/yPAUbi2vv/DLGoH/s992V
1UfDg5RWc9HheLIiKk8bsbpk42pQEvxbgrh7vLPBSi8Dcr0QNGMnMej5PSH0hIVV
dOCSMujnXM4sLCr8YQwMNl+QwfyXrJqw5irg3wIDAQABAoIBAHwoL5vvD5b2Vrsu
cntddN9QlGjxFS39odsXdjtkeLMa0cVKf/w4knWnC7AJ5XdbGYf7e0scR3T2dpiQ
zwDlmZb3QlFQOzIBa1+QG7dxYkXfgVkGKHwyn50q6ThDex24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baHpLpGegzVe8P/9TRe4cBjmD33PnqnJZPs7ejN
jFiqLdMDQp4VGouU+BEC9e0FAs8GwWQnIC8mdWcKO2IKFSd3ENJeRqDYyJR3AeqB
Jce674+89wKBgQCubDO1JsriXgiC8IWppQliYTw3WzXbALWw6qlkYvROUrZIWgtm
1KF0M84kMWHVbYmywCYr1kblZN5x76HSZQQ53MMXGweAoflnnxIsONyfWSsseAvI
j0N/QK3/s04cVNWNXio4z0ZkgvQicvONHJj7aORdwo2IaaO5zUmgrIlLNwKBgF+X
7TKue2w3ezNY7zx7Q8P7nt5j1quYyMQsQvuikiKBDj3bbEWSjAynBHIaRkm6698/
jIxjCQ2F3heLF9CFERsmLeY6G0mPhEw7bnjcyP4uuV1quSTmOHLxLo5+DNW755k1
Xpo1Ab/hwzbFT2WJ58Jubz6x2pHIuAP+t+Uw1axvAoGBAJMy8D07KRdAMp5MkQUs
Qk5WTXM+fr5ZIwoFeZTRm0tqaqhY1xocDbfyJJKBN0kWuivfyAtT0x3JyhMtN+Lf
hZhaa4NBqtgC6EAZIzuOzYKvBtZGKt45nILpjqVTjGsjgLIDeodxdUKBSdyEPBM2
0IQD6dSpqznSG/dXdhB5IsWA
-----END PRIVATE KEY-----

)KEY";
Loading

0 comments on commit 332cbc3

Please sign in to comment.