Browse Source

Added LED, changed from interrupt to polling for RFID reader, changed request according to new format and route

master
Alexandre Poincet 6 months ago
parent
commit
8feb01900f

BIN
cert/E209.bin.crt View File


+ 19
- 0
cert/E209.crt View File

@@ -0,0 +1,19 @@
1
+-----BEGIN CERTIFICATE-----
2
+MIIDGzCCAgMCCQCnF1LeWvlhzTANBgkqhkiG9w0BAQsFADBUMQswCQYDVQQGEwJG
3
+UjEQMA4GA1UEBwwHQk9VUkdFUzENMAsGA1UECgwESU5TQTEMMAoGA1UECwwDMlNB
4
+MRYwFAYDVQQDDA1Db25xdWlzdGFEb29yMB4XDTE5MDIwNzE1Mjg0OVoXDTE5MDMw
5
+OTE1Mjg0OVowSzELMAkGA1UEBhMCRlIxDTALBgNVBAMMBEUyMDkxEDAOBgNVBAcM
6
+B0JPVVJHRVMxDTALBgNVBAoMBElOU0ExDDAKBgNVBAsMAzJTQTCCASIwDQYJKoZI
7
+hvcNAQEBBQADggEPADCCAQoCggEBANMv/4/BSwSQ5hMIM2VcWGB8dLViizb1KRWe
8
+W1dZ1JDFh/v15H6dOEkTg3HJoDrwVADDfZAkw6Gfi3P2HU6rqIgIQagtNseADxQ2
9
+YaknDk07MX0eVmXXNlOAoygKJme1FfVqFX3pFSTkbDP+0js0ic40F3xzdW70876V
10
+bTgZo+PxAFUKnnGBJ3QrD7Z2I2VkLl7+JUt01uJ3PtNBGd8xOblJ1IHmNa9sRNgf
11
+iHuQzWpbUVVCTDDA4t+nxgH0AVmFdsHEhf3MnKXuh+sBrN7ubq9gUUMg3W/VKcjw
12
+uIPJsH0YbjHm7ykMmhEXY6eHQlC0tEZ/Jpglf5TKTC53U9N/CPkCAwEAATANBgkq
13
+hkiG9w0BAQsFAAOCAQEAJQYW/HLopWH3/WTEbCE9H/yGpAS2KaD4dUdlmxaexsQH
14
+E/8jQQWavJOANCF/WVaVIQYZoH7v28q4LMavE7AjfB1x6/IUZE6zA0troy/DQyqU
15
+2m6nn8Z7KSLUrAJbB0bFYoNkP7C5SGdYz00iJJ63CELTpSfIAiHRPe83rtIazK+U
16
+hy2wSk3TkPfvAtmsZd1bGTn6MioU7L8a4rho1Gza6OiY4Lz0EbP1xBtca4cEwAEO
17
+CaleY3wnQZWxmG8pskpBKiyZAE5AyvzDOOLivwb9OeOWmYsZYbaHnThi6BsUrN2W
18
+qLSfHjqn1p6cTu54kjEAu7GBqTXjtPMKbmz3bu8EPg==
19
+-----END CERTIFICATE-----

+ 28
- 0
cert/E209.key View File

@@ -0,0 +1,28 @@
1
+-----BEGIN PRIVATE KEY-----
2
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDTL/+PwUsEkOYT
3
+CDNlXFhgfHS1Yos29SkVnltXWdSQxYf79eR+nThJE4NxyaA68FQAw32QJMOhn4tz
4
+9h1Oq6iICEGoLTbHgA8UNmGpJw5NOzF9HlZl1zZTgKMoCiZntRX1ahV96RUk5Gwz
5
+/tI7NInONBd8c3Vu9PO+lW04GaPj8QBVCp5xgSd0Kw+2diNlZC5e/iVLdNbidz7T
6
+QRnfMTm5SdSB5jWvbETYH4h7kM1qW1FVQkwwwOLfp8YB9AFZhXbBxIX9zJyl7ofr
7
+Aaze7m6vYFFDIN1v1SnI8LiDybB9GG4x5u8pDJoRF2Onh0JQtLRGfyaYJX+Uykwu
8
+d1PTfwj5AgMBAAECggEAer+PPzMOM101HSLLHMML6yjrfPIGEK92bcZZOPBRiMQH
9
+Qf+uC5m+OVtKLz0OELPXX4pA1SNJQgvFtmT6q9tCXa7O2r1M9bANE6Z4JSU6PtGE
10
+9kBH33Gzdd1y97bOk8DBPp+mVkS/sW3DJoWaFCd5YY0NiZxiSVe+xKt9i/n7NGS1
11
+jHfXcX2BbIUYZdDS1aXCMmR2hzFlY+C3rKc6hKHt6DDIXM9dE1mMJ/88P3fLS8uX
12
+5KraaKh0Us6NhhkD+QzjD0mAkrm92aNONk3lGCz0JkFf5q5C7/d5mJt0j8q7WqzF
13
++6YpnQezoYdTQorM5yHzKR0wublQrj/5k07wy/UycQKBgQDpmWfYa9JqZLMp2P3p
14
+rqzYngB6StXECZ8/QtK2lBm7NQQ7bP912pWGKuIg2U4r+cH2Ph1i3VPpXHM9XKns
15
+5tmNtnyPo07KExwXs17XFYcabFc3yEluoIjtFRLl1mgVWc6OZsprsAnpniQA3lxo
16
+wkyy3fohq+NeJvSsAPtQTVGFnwKBgQDncGjsZrHBsovWoVNkcKFK5HUnTvT1ZwKO
17
+U6hg5thAAEnlOnwRWN3z3csZhcqpzZDBbfScNDI0ES2Yjjvz6A+JC9eDwLWSkitJ
18
+Cf0+iHgZ/INYfdZ7KR9HiR3ZRLu4nkYv2JQT1gOt8NISzGgCwPrEcg96PpXFp+VT
19
+fMG+5qv6ZwKBgGUoRUv3BRuFmABbMzlqpvb3FQXgOkm2UPu4GD9wSuRCxR5myQlk
20
+KrP7BglrkOqCMXhM1bTmW1wG6PB9nCg2n6c6ix44ffoL5HJu/nbtn5/Vor9JQGNj
21
+qWfhZFmbS19TkJsh8C5KAUDldnnZ0PKckVIzxgmmwcMX44RIuIvBr7fJAoGBAIxk
22
+URGOXif8sf05kYetFvqCSVrV95xhp1hFAS/++JEiW7EU4Cv5t3H2Sfyqfzyv+S6N
23
+D8QtmYKiJQGUzmNvkvT0XQCMRtipmF5PE/L5/7jrx5VHiHLfiBzx3Uxt+F3OjQ77
24
+FyBNQ6AhJJ3IpxN8kuHVuvPRwTLMXT1ewXyXGx3jAoGBAMUBfBlbZHI84MZhh8QR
25
+Jj0udNQEaHU+e1pS0OKbNQch2X6uExMsaFfyv4K5DAHWK89rpdYUHCEfHKtKpLDb
26
+9te47ws95IAdiB9w8VP/9IUlv4S+LoO+g/DrqWFnmS5J5FiQMUJUHgejTivVlnvp
27
+bXcWGc4opgFXotLmrwSHi0Dw
28
+-----END PRIVATE KEY-----

BIN
cert/E209.key.bin View File


BIN
cert/myca.bin.crt View File


+ 21
- 0
cert/myca.crt View File

@@ -0,0 +1,21 @@
1
+-----BEGIN CERTIFICATE-----
2
+MIIDfjCCAmagAwIBAgIJAOb4EbcAPSF7MA0GCSqGSIb3DQEBCwUAMFQxCzAJBgNV
3
+BAYTAkZSMRAwDgYDVQQHDAdCT1VSR0VTMQ0wCwYDVQQKDARJTlNBMQwwCgYDVQQL
4
+DAMyU0ExFjAUBgNVBAMMDUNvbnF1aXN0YURvb3IwHhcNMTkwMjA3MTUyODQ3WhcN
5
+MjQwMjA2MTUyODQ3WjBUMQswCQYDVQQGEwJGUjEQMA4GA1UEBwwHQk9VUkdFUzEN
6
+MAsGA1UECgwESU5TQTEMMAoGA1UECwwDMlNBMRYwFAYDVQQDDA1Db25xdWlzdGFE
7
+b29yMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2B0acnIWqDwZ2a2y
8
+7fO8cBzyYLpbOn5zQTOsf9+SIyBo1Crff9oGdY2ZuKacOcNI/nGSxAq71FMQJW++
9
+qKxrY2BGcJJE5qOgomFFXcQQR1Ph7ki/ilhsEb2W9MxM7zCXSE7eDJE4yu3C//aC
10
+X1yl5Uth4cl0cf0FA/bOvPqjYcxM5S5tRGDcNogqjuqz4eCdwpyTyFGv/Tiuzsm1
11
+YKx1wwMJsqfeGCfkF0AW9USlFmjpPIiTKXiV37VxqKuauVVXui6BAC0VsccL500d
12
+WTsBA+SCMFSI8OFXz30iT/dXxUQYoeG6nvR1Fk8/gdhbhg08u6EOWM7yctqbViHz
13
+sFk6AQIDAQABo1MwUTAdBgNVHQ4EFgQUEPAKplln6ejyROXRTbKLv1peuCIwHwYD
14
+VR0jBBgwFoAUEPAKplln6ejyROXRTbKLv1peuCIwDwYDVR0TAQH/BAUwAwEB/zAN
15
+BgkqhkiG9w0BAQsFAAOCAQEA0C+ka39788c51gCaF21J3zZWM7BzgZDPbT64s8p4
16
+MdXNU8nGm5tbCRQ86CNDq4wvVZrRckbXnfxc4EocOTTfDPDNxbDE+4s6eSebcqZe
17
+03GO1acsQkbcsaQuRO1gKiaSF6t1wMzXC6Wl2rTCqdxp9ehrE+mWdl3Bcg5vYaI/
18
+inxs+yOCLl9aNTPLYaHKV2/masNB1QAeVCVM4MbWLO0MqcHAWziiTn+YnY8LsEfW
19
+AgZR1YRZLDitIbafmnKjd6ku0cbzUZjzmuh4o6uFzXGhJ/ARCme9Pbptbt2OORiW
20
+mrpZIo9oKKDFXTpKouv76a33YVKvhoXy+fZtHXRsaenlRg==
21
+-----END CERTIFICATE-----

+ 8
- 0
cert/udpdate_cert.sh View File

@@ -0,0 +1,8 @@
1
+#!/bin/bash
2
+
3
+openssl x509 -in myca.crt -out myca.bin.crt -outform DER
4
+openssl x509 -in E209.crt -out E209.bin.crt -outform DER
5
+openssl rsa -in E209.key -out E209.key.bin -outform DER
6
+
7
+#ca_crt=$(xxd -i  myca.bin.crt | cut -d'{' -f2 | cut -d'}' -f1)
8
+#echo  $ca_crt

+ 258
- 0
include/certs.h View File

@@ -272,4 +272,262 @@ unsigned char private_client_bin_key[] = {
272 272
 };
273 273
 unsigned int private_client_bin_key_len = 1192;
274 274
 
275
+
276
+// =========================================================
277
+
278
+// unsigned char caCert[] PROGMEM = {
279
+//   0x30, 0x82, 0x03, 0x7e, 0x30, 0x82, 0x02, 0x66, 0xa0, 0x03, 0x02, 0x01,
280
+//   0x02, 0x02, 0x09, 0x00, 0xe6, 0xf8, 0x11, 0xb7, 0x00, 0x3d, 0x21, 0x7b,
281
+//   0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
282
+//   0x0b, 0x05, 0x00, 0x30, 0x54, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
283
+//   0x04, 0x06, 0x13, 0x02, 0x46, 0x52, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03,
284
+//   0x55, 0x04, 0x07, 0x0c, 0x07, 0x42, 0x4f, 0x55, 0x52, 0x47, 0x45, 0x53,
285
+//   0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x04, 0x49,
286
+//   0x4e, 0x53, 0x41, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0b,
287
+//   0x0c, 0x03, 0x32, 0x53, 0x41, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55,
288
+//   0x04, 0x03, 0x0c, 0x0d, 0x43, 0x6f, 0x6e, 0x71, 0x75, 0x69, 0x73, 0x74,
289
+//   0x61, 0x44, 0x6f, 0x6f, 0x72, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30,
290
+//   0x32, 0x30, 0x37, 0x31, 0x35, 0x32, 0x38, 0x34, 0x37, 0x5a, 0x17, 0x0d,
291
+//   0x32, 0x34, 0x30, 0x32, 0x30, 0x36, 0x31, 0x35, 0x32, 0x38, 0x34, 0x37,
292
+//   0x5a, 0x30, 0x54, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
293
+//   0x13, 0x02, 0x46, 0x52, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04,
294
+//   0x07, 0x0c, 0x07, 0x42, 0x4f, 0x55, 0x52, 0x47, 0x45, 0x53, 0x31, 0x0d,
295
+//   0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x04, 0x49, 0x4e, 0x53,
296
+//   0x41, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x03,
297
+//   0x32, 0x53, 0x41, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x03,
298
+//   0x0c, 0x0d, 0x43, 0x6f, 0x6e, 0x71, 0x75, 0x69, 0x73, 0x74, 0x61, 0x44,
299
+//   0x6f, 0x6f, 0x72, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a,
300
+//   0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82,
301
+//   0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00,
302
+//   0xd8, 0x1d, 0x1a, 0x72, 0x72, 0x16, 0xa8, 0x3c, 0x19, 0xd9, 0xad, 0xb2,
303
+//   0xed, 0xf3, 0xbc, 0x70, 0x1c, 0xf2, 0x60, 0xba, 0x5b, 0x3a, 0x7e, 0x73,
304
+//   0x41, 0x33, 0xac, 0x7f, 0xdf, 0x92, 0x23, 0x20, 0x68, 0xd4, 0x2a, 0xdf,
305
+//   0x7f, 0xda, 0x06, 0x75, 0x8d, 0x99, 0xb8, 0xa6, 0x9c, 0x39, 0xc3, 0x48,
306
+//   0xfe, 0x71, 0x92, 0xc4, 0x0a, 0xbb, 0xd4, 0x53, 0x10, 0x25, 0x6f, 0xbe,
307
+//   0xa8, 0xac, 0x6b, 0x63, 0x60, 0x46, 0x70, 0x92, 0x44, 0xe6, 0xa3, 0xa0,
308
+//   0xa2, 0x61, 0x45, 0x5d, 0xc4, 0x10, 0x47, 0x53, 0xe1, 0xee, 0x48, 0xbf,
309
+//   0x8a, 0x58, 0x6c, 0x11, 0xbd, 0x96, 0xf4, 0xcc, 0x4c, 0xef, 0x30, 0x97,
310
+//   0x48, 0x4e, 0xde, 0x0c, 0x91, 0x38, 0xca, 0xed, 0xc2, 0xff, 0xf6, 0x82,
311
+//   0x5f, 0x5c, 0xa5, 0xe5, 0x4b, 0x61, 0xe1, 0xc9, 0x74, 0x71, 0xfd, 0x05,
312
+//   0x03, 0xf6, 0xce, 0xbc, 0xfa, 0xa3, 0x61, 0xcc, 0x4c, 0xe5, 0x2e, 0x6d,
313
+//   0x44, 0x60, 0xdc, 0x36, 0x88, 0x2a, 0x8e, 0xea, 0xb3, 0xe1, 0xe0, 0x9d,
314
+//   0xc2, 0x9c, 0x93, 0xc8, 0x51, 0xaf, 0xfd, 0x38, 0xae, 0xce, 0xc9, 0xb5,
315
+//   0x60, 0xac, 0x75, 0xc3, 0x03, 0x09, 0xb2, 0xa7, 0xde, 0x18, 0x27, 0xe4,
316
+//   0x17, 0x40, 0x16, 0xf5, 0x44, 0xa5, 0x16, 0x68, 0xe9, 0x3c, 0x88, 0x93,
317
+//   0x29, 0x78, 0x95, 0xdf, 0xb5, 0x71, 0xa8, 0xab, 0x9a, 0xb9, 0x55, 0x57,
318
+//   0xba, 0x2e, 0x81, 0x00, 0x2d, 0x15, 0xb1, 0xc7, 0x0b, 0xe7, 0x4d, 0x1d,
319
+//   0x59, 0x3b, 0x01, 0x03, 0xe4, 0x82, 0x30, 0x54, 0x88, 0xf0, 0xe1, 0x57,
320
+//   0xcf, 0x7d, 0x22, 0x4f, 0xf7, 0x57, 0xc5, 0x44, 0x18, 0xa1, 0xe1, 0xba,
321
+//   0x9e, 0xf4, 0x75, 0x16, 0x4f, 0x3f, 0x81, 0xd8, 0x5b, 0x86, 0x0d, 0x3c,
322
+//   0xbb, 0xa1, 0x0e, 0x58, 0xce, 0xf2, 0x72, 0xda, 0x9b, 0x56, 0x21, 0xf3,
323
+//   0xb0, 0x59, 0x3a, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x53, 0x30,
324
+//   0x51, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14,
325
+//   0x10, 0xf0, 0x0a, 0xa6, 0x59, 0x67, 0xe9, 0xe8, 0xf2, 0x44, 0xe5, 0xd1,
326
+//   0x4d, 0xb2, 0x8b, 0xbf, 0x5a, 0x5e, 0xb8, 0x22, 0x30, 0x1f, 0x06, 0x03,
327
+//   0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x10, 0xf0, 0x0a,
328
+//   0xa6, 0x59, 0x67, 0xe9, 0xe8, 0xf2, 0x44, 0xe5, 0xd1, 0x4d, 0xb2, 0x8b,
329
+//   0xbf, 0x5a, 0x5e, 0xb8, 0x22, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13,
330
+//   0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0d,
331
+//   0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05,
332
+//   0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0xd0, 0x2f, 0xa4, 0x6b, 0x7f, 0x7b,
333
+//   0xf3, 0xc7, 0x39, 0xd6, 0x00, 0x9a, 0x17, 0x6d, 0x49, 0xdf, 0x36, 0x56,
334
+//   0x33, 0xb0, 0x73, 0x81, 0x90, 0xcf, 0x6d, 0x3e, 0xb8, 0xb3, 0xca, 0x78,
335
+//   0x31, 0xd5, 0xcd, 0x53, 0xc9, 0xc6, 0x9b, 0x9b, 0x5b, 0x09, 0x14, 0x3c,
336
+//   0xe8, 0x23, 0x43, 0xab, 0x8c, 0x2f, 0x55, 0x9a, 0xd1, 0x72, 0x46, 0xd7,
337
+//   0x9d, 0xfc, 0x5c, 0xe0, 0x4a, 0x1c, 0x39, 0x34, 0xdf, 0x0c, 0xf0, 0xcd,
338
+//   0xc5, 0xb0, 0xc4, 0xfb, 0x8b, 0x3a, 0x79, 0x27, 0x9b, 0x72, 0xa6, 0x5e,
339
+//   0xd3, 0x71, 0x8e, 0xd5, 0xa7, 0x2c, 0x42, 0x46, 0xdc, 0xb1, 0xa4, 0x2e,
340
+//   0x44, 0xed, 0x60, 0x2a, 0x26, 0x92, 0x17, 0xab, 0x75, 0xc0, 0xcc, 0xd7,
341
+//   0x0b, 0xa5, 0xa5, 0xda, 0xb4, 0xc2, 0xa9, 0xdc, 0x69, 0xf5, 0xe8, 0x6b,
342
+//   0x13, 0xe9, 0x96, 0x76, 0x5d, 0xc1, 0x72, 0x0e, 0x6f, 0x61, 0xa2, 0x3f,
343
+//   0x8a, 0x7c, 0x6c, 0xfb, 0x23, 0x82, 0x2e, 0x5f, 0x5a, 0x35, 0x33, 0xcb,
344
+//   0x61, 0xa1, 0xca, 0x57, 0x6f, 0xe6, 0x6a, 0xc3, 0x41, 0xd5, 0x00, 0x1e,
345
+//   0x54, 0x25, 0x4c, 0xe0, 0xc6, 0xd6, 0x2c, 0xed, 0x0c, 0xa9, 0xc1, 0xc0,
346
+//   0x5b, 0x38, 0xa2, 0x4e, 0x7f, 0x98, 0x9d, 0x8f, 0x0b, 0xb0, 0x47, 0xd6,
347
+//   0x02, 0x06, 0x51, 0xd5, 0x84, 0x59, 0x2c, 0x38, 0xad, 0x21, 0xb6, 0x9f,
348
+//   0x9a, 0x72, 0xa3, 0x77, 0xa9, 0x2e, 0xd1, 0xc6, 0xf3, 0x51, 0x98, 0xf3,
349
+//   0x9a, 0xe8, 0x78, 0xa3, 0xab, 0x85, 0xcd, 0x71, 0xa1, 0x27, 0xf0, 0x11,
350
+//   0x0a, 0x67, 0xbd, 0x3d, 0xba, 0x6d, 0x6e, 0xdd, 0x8e, 0x39, 0x18, 0x96,
351
+//   0x9a, 0xba, 0x59, 0x22, 0x8f, 0x68, 0x28, 0xa0, 0xc5, 0x5d, 0x3a, 0x4a,
352
+//   0xa2, 0xeb, 0xfb, 0xe9, 0xad, 0xf7, 0x61, 0x52, 0xaf, 0x86, 0x85, 0xf2,
353
+//   0xf9, 0xf6, 0x6d, 0x1d, 0x74, 0x6c, 0x69, 0xe9, 0xe5, 0x46
354
+// };
355
+
356
+// unsigned int caCertLen = 898;
357
+
358
+// unsigned char certs_client_bin_crt[] PROGMEM = {
359
+//   0x30, 0x82, 0x03, 0x1b, 0x30, 0x82, 0x02, 0x03, 0x02, 0x09, 0x00, 0xa7,
360
+//   0x17, 0x52, 0xde, 0x5a, 0xf9, 0x61, 0xcd, 0x30, 0x0d, 0x06, 0x09, 0x2a,
361
+//   0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x54,
362
+//   0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x46,
363
+//   0x52, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x07,
364
+//   0x42, 0x4f, 0x55, 0x52, 0x47, 0x45, 0x53, 0x31, 0x0d, 0x30, 0x0b, 0x06,
365
+//   0x03, 0x55, 0x04, 0x0a, 0x0c, 0x04, 0x49, 0x4e, 0x53, 0x41, 0x31, 0x0c,
366
+//   0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x03, 0x32, 0x53, 0x41,
367
+//   0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0d, 0x43,
368
+//   0x6f, 0x6e, 0x71, 0x75, 0x69, 0x73, 0x74, 0x61, 0x44, 0x6f, 0x6f, 0x72,
369
+//   0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, 0x32, 0x30, 0x37, 0x31, 0x35,
370
+//   0x32, 0x38, 0x34, 0x39, 0x5a, 0x17, 0x0d, 0x31, 0x39, 0x30, 0x33, 0x30,
371
+//   0x39, 0x31, 0x35, 0x32, 0x38, 0x34, 0x39, 0x5a, 0x30, 0x4b, 0x31, 0x0b,
372
+//   0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x46, 0x52, 0x31,
373
+//   0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x04, 0x45, 0x32,
374
+//   0x30, 0x39, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c,
375
+//   0x07, 0x42, 0x4f, 0x55, 0x52, 0x47, 0x45, 0x53, 0x31, 0x0d, 0x30, 0x0b,
376
+//   0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x04, 0x49, 0x4e, 0x53, 0x41, 0x31,
377
+//   0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x03, 0x32, 0x53,
378
+//   0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48,
379
+//   0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f,
380
+//   0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xd3, 0x2f,
381
+//   0xff, 0x8f, 0xc1, 0x4b, 0x04, 0x90, 0xe6, 0x13, 0x08, 0x33, 0x65, 0x5c,
382
+//   0x58, 0x60, 0x7c, 0x74, 0xb5, 0x62, 0x8b, 0x36, 0xf5, 0x29, 0x15, 0x9e,
383
+//   0x5b, 0x57, 0x59, 0xd4, 0x90, 0xc5, 0x87, 0xfb, 0xf5, 0xe4, 0x7e, 0x9d,
384
+//   0x38, 0x49, 0x13, 0x83, 0x71, 0xc9, 0xa0, 0x3a, 0xf0, 0x54, 0x00, 0xc3,
385
+//   0x7d, 0x90, 0x24, 0xc3, 0xa1, 0x9f, 0x8b, 0x73, 0xf6, 0x1d, 0x4e, 0xab,
386
+//   0xa8, 0x88, 0x08, 0x41, 0xa8, 0x2d, 0x36, 0xc7, 0x80, 0x0f, 0x14, 0x36,
387
+//   0x61, 0xa9, 0x27, 0x0e, 0x4d, 0x3b, 0x31, 0x7d, 0x1e, 0x56, 0x65, 0xd7,
388
+//   0x36, 0x53, 0x80, 0xa3, 0x28, 0x0a, 0x26, 0x67, 0xb5, 0x15, 0xf5, 0x6a,
389
+//   0x15, 0x7d, 0xe9, 0x15, 0x24, 0xe4, 0x6c, 0x33, 0xfe, 0xd2, 0x3b, 0x34,
390
+//   0x89, 0xce, 0x34, 0x17, 0x7c, 0x73, 0x75, 0x6e, 0xf4, 0xf3, 0xbe, 0x95,
391
+//   0x6d, 0x38, 0x19, 0xa3, 0xe3, 0xf1, 0x00, 0x55, 0x0a, 0x9e, 0x71, 0x81,
392
+//   0x27, 0x74, 0x2b, 0x0f, 0xb6, 0x76, 0x23, 0x65, 0x64, 0x2e, 0x5e, 0xfe,
393
+//   0x25, 0x4b, 0x74, 0xd6, 0xe2, 0x77, 0x3e, 0xd3, 0x41, 0x19, 0xdf, 0x31,
394
+//   0x39, 0xb9, 0x49, 0xd4, 0x81, 0xe6, 0x35, 0xaf, 0x6c, 0x44, 0xd8, 0x1f,
395
+//   0x88, 0x7b, 0x90, 0xcd, 0x6a, 0x5b, 0x51, 0x55, 0x42, 0x4c, 0x30, 0xc0,
396
+//   0xe2, 0xdf, 0xa7, 0xc6, 0x01, 0xf4, 0x01, 0x59, 0x85, 0x76, 0xc1, 0xc4,
397
+//   0x85, 0xfd, 0xcc, 0x9c, 0xa5, 0xee, 0x87, 0xeb, 0x01, 0xac, 0xde, 0xee,
398
+//   0x6e, 0xaf, 0x60, 0x51, 0x43, 0x20, 0xdd, 0x6f, 0xd5, 0x29, 0xc8, 0xf0,
399
+//   0xb8, 0x83, 0xc9, 0xb0, 0x7d, 0x18, 0x6e, 0x31, 0xe6, 0xef, 0x29, 0x0c,
400
+//   0x9a, 0x11, 0x17, 0x63, 0xa7, 0x87, 0x42, 0x50, 0xb4, 0xb4, 0x46, 0x7f,
401
+//   0x26, 0x98, 0x25, 0x7f, 0x94, 0xca, 0x4c, 0x2e, 0x77, 0x53, 0xd3, 0x7f,
402
+//   0x08, 0xf9, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a,
403
+//   0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82,
404
+//   0x01, 0x01, 0x00, 0x25, 0x06, 0x16, 0xfc, 0x72, 0xe8, 0xa5, 0x61, 0xf7,
405
+//   0xfd, 0x64, 0xc4, 0x6c, 0x21, 0x3d, 0x1f, 0xfc, 0x86, 0xa4, 0x04, 0xb6,
406
+//   0x29, 0xa0, 0xf8, 0x75, 0x47, 0x65, 0x9b, 0x16, 0x9e, 0xc6, 0xc4, 0x07,
407
+//   0x13, 0xff, 0x23, 0x41, 0x05, 0x9a, 0xbc, 0x93, 0x80, 0x34, 0x21, 0x7f,
408
+//   0x59, 0x56, 0x95, 0x21, 0x06, 0x19, 0xa0, 0x7e, 0xef, 0xdb, 0xca, 0xb8,
409
+//   0x2c, 0xc6, 0xaf, 0x13, 0xb0, 0x23, 0x7c, 0x1d, 0x71, 0xeb, 0xf2, 0x14,
410
+//   0x64, 0x4e, 0xb3, 0x03, 0x4b, 0x6b, 0xa3, 0x2f, 0xc3, 0x43, 0x2a, 0x94,
411
+//   0xda, 0x6e, 0xa7, 0x9f, 0xc6, 0x7b, 0x29, 0x22, 0xd4, 0xac, 0x02, 0x5b,
412
+//   0x07, 0x46, 0xc5, 0x62, 0x83, 0x64, 0x3f, 0xb0, 0xb9, 0x48, 0x67, 0x58,
413
+//   0xcf, 0x4d, 0x22, 0x24, 0x9e, 0xb7, 0x08, 0x42, 0xd3, 0xa5, 0x27, 0xc8,
414
+//   0x02, 0x21, 0xd1, 0x3d, 0xef, 0x37, 0xae, 0xd2, 0x1a, 0xcc, 0xaf, 0x94,
415
+//   0x87, 0x2d, 0xb0, 0x4a, 0x4d, 0xd3, 0x90, 0xf7, 0xef, 0x02, 0xd9, 0xac,
416
+//   0x65, 0xdd, 0x5b, 0x19, 0x39, 0xfa, 0x32, 0x2a, 0x14, 0xec, 0xbf, 0x1a,
417
+//   0xe2, 0xb8, 0x68, 0xd4, 0x6c, 0xda, 0xe8, 0xe8, 0x98, 0xe0, 0xbc, 0xf4,
418
+//   0x11, 0xb3, 0xf5, 0xc4, 0x1b, 0x5c, 0x6b, 0x87, 0x04, 0xc0, 0x01, 0x0e,
419
+//   0x09, 0xa9, 0x5e, 0x63, 0x7c, 0x27, 0x41, 0x95, 0xb1, 0x98, 0x6f, 0x29,
420
+//   0xb2, 0x4a, 0x41, 0x2a, 0x2c, 0x99, 0x00, 0x4e, 0x40, 0xca, 0xfc, 0xc3,
421
+//   0x38, 0xe2, 0xe2, 0xbf, 0x06, 0xfd, 0x39, 0xe3, 0x96, 0x99, 0x8b, 0x19,
422
+//   0x61, 0xb6, 0x87, 0x9d, 0x38, 0x62, 0xe8, 0x1b, 0x14, 0xac, 0xdd, 0x96,
423
+//   0xa8, 0xb4, 0x9f, 0x1e, 0x3a, 0xa7, 0xd6, 0x9e, 0x9c, 0x4e, 0xee, 0x78,
424
+//   0x92, 0x31, 0x00, 0xbb, 0xb1, 0x81, 0xa9, 0x35, 0xe3, 0xb4, 0xf3, 0x0a,
425
+//   0x6e, 0x6c, 0xf7, 0x6e, 0xef, 0x04, 0x3e
426
+// };
427
+// unsigned int certs_client_bin_crt_len = 799;
428
+
429
+// unsigned char private_client_bin_key[] PROGMEM = {
430
+//   0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00,
431
+//   0xd3, 0x2f, 0xff, 0x8f, 0xc1, 0x4b, 0x04, 0x90, 0xe6, 0x13, 0x08, 0x33,
432
+//   0x65, 0x5c, 0x58, 0x60, 0x7c, 0x74, 0xb5, 0x62, 0x8b, 0x36, 0xf5, 0x29,
433
+//   0x15, 0x9e, 0x5b, 0x57, 0x59, 0xd4, 0x90, 0xc5, 0x87, 0xfb, 0xf5, 0xe4,
434
+//   0x7e, 0x9d, 0x38, 0x49, 0x13, 0x83, 0x71, 0xc9, 0xa0, 0x3a, 0xf0, 0x54,
435
+//   0x00, 0xc3, 0x7d, 0x90, 0x24, 0xc3, 0xa1, 0x9f, 0x8b, 0x73, 0xf6, 0x1d,
436
+//   0x4e, 0xab, 0xa8, 0x88, 0x08, 0x41, 0xa8, 0x2d, 0x36, 0xc7, 0x80, 0x0f,
437
+//   0x14, 0x36, 0x61, 0xa9, 0x27, 0x0e, 0x4d, 0x3b, 0x31, 0x7d, 0x1e, 0x56,
438
+//   0x65, 0xd7, 0x36, 0x53, 0x80, 0xa3, 0x28, 0x0a, 0x26, 0x67, 0xb5, 0x15,
439
+//   0xf5, 0x6a, 0x15, 0x7d, 0xe9, 0x15, 0x24, 0xe4, 0x6c, 0x33, 0xfe, 0xd2,
440
+//   0x3b, 0x34, 0x89, 0xce, 0x34, 0x17, 0x7c, 0x73, 0x75, 0x6e, 0xf4, 0xf3,
441
+//   0xbe, 0x95, 0x6d, 0x38, 0x19, 0xa3, 0xe3, 0xf1, 0x00, 0x55, 0x0a, 0x9e,
442
+//   0x71, 0x81, 0x27, 0x74, 0x2b, 0x0f, 0xb6, 0x76, 0x23, 0x65, 0x64, 0x2e,
443
+//   0x5e, 0xfe, 0x25, 0x4b, 0x74, 0xd6, 0xe2, 0x77, 0x3e, 0xd3, 0x41, 0x19,
444
+//   0xdf, 0x31, 0x39, 0xb9, 0x49, 0xd4, 0x81, 0xe6, 0x35, 0xaf, 0x6c, 0x44,
445
+//   0xd8, 0x1f, 0x88, 0x7b, 0x90, 0xcd, 0x6a, 0x5b, 0x51, 0x55, 0x42, 0x4c,
446
+//   0x30, 0xc0, 0xe2, 0xdf, 0xa7, 0xc6, 0x01, 0xf4, 0x01, 0x59, 0x85, 0x76,
447
+//   0xc1, 0xc4, 0x85, 0xfd, 0xcc, 0x9c, 0xa5, 0xee, 0x87, 0xeb, 0x01, 0xac,
448
+//   0xde, 0xee, 0x6e, 0xaf, 0x60, 0x51, 0x43, 0x20, 0xdd, 0x6f, 0xd5, 0x29,
449
+//   0xc8, 0xf0, 0xb8, 0x83, 0xc9, 0xb0, 0x7d, 0x18, 0x6e, 0x31, 0xe6, 0xef,
450
+//   0x29, 0x0c, 0x9a, 0x11, 0x17, 0x63, 0xa7, 0x87, 0x42, 0x50, 0xb4, 0xb4,
451
+//   0x46, 0x7f, 0x26, 0x98, 0x25, 0x7f, 0x94, 0xca, 0x4c, 0x2e, 0x77, 0x53,
452
+//   0xd3, 0x7f, 0x08, 0xf9, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x82, 0x01,
453
+//   0x00, 0x7a, 0xbf, 0x8f, 0x3f, 0x33, 0x0e, 0x33, 0x5d, 0x35, 0x1d, 0x22,
454
+//   0xcb, 0x1c, 0xc3, 0x0b, 0xeb, 0x28, 0xeb, 0x7c, 0xf2, 0x06, 0x10, 0xaf,
455
+//   0x76, 0x6d, 0xc6, 0x59, 0x38, 0xf0, 0x51, 0x88, 0xc4, 0x07, 0x41, 0xff,
456
+//   0xae, 0x0b, 0x99, 0xbe, 0x39, 0x5b, 0x4a, 0x2f, 0x3d, 0x0e, 0x10, 0xb3,
457
+//   0xd7, 0x5f, 0x8a, 0x40, 0xd5, 0x23, 0x49, 0x42, 0x0b, 0xc5, 0xb6, 0x64,
458
+//   0xfa, 0xab, 0xdb, 0x42, 0x5d, 0xae, 0xce, 0xda, 0xbd, 0x4c, 0xf5, 0xb0,
459
+//   0x0d, 0x13, 0xa6, 0x78, 0x25, 0x25, 0x3a, 0x3e, 0xd1, 0x84, 0xf6, 0x40,
460
+//   0x47, 0xdf, 0x71, 0xb3, 0x75, 0xdd, 0x72, 0xf7, 0xb6, 0xce, 0x93, 0xc0,
461
+//   0xc1, 0x3e, 0x9f, 0xa6, 0x56, 0x44, 0xbf, 0xb1, 0x6d, 0xc3, 0x26, 0x85,
462
+//   0x9a, 0x14, 0x27, 0x79, 0x61, 0x8d, 0x0d, 0x89, 0x9c, 0x62, 0x49, 0x57,
463
+//   0xbe, 0xc4, 0xab, 0x7d, 0x8b, 0xf9, 0xfb, 0x34, 0x64, 0xb5, 0x8c, 0x77,
464
+//   0xd7, 0x71, 0x7d, 0x81, 0x6c, 0x85, 0x18, 0x65, 0xd0, 0xd2, 0xd5, 0xa5,
465
+//   0xc2, 0x32, 0x64, 0x76, 0x87, 0x31, 0x65, 0x63, 0xe0, 0xb7, 0xac, 0xa7,
466
+//   0x3a, 0x84, 0xa1, 0xed, 0xe8, 0x30, 0xc8, 0x5c, 0xcf, 0x5d, 0x13, 0x59,
467
+//   0x8c, 0x27, 0xff, 0x3c, 0x3f, 0x77, 0xcb, 0x4b, 0xcb, 0x97, 0xe4, 0xaa,
468
+//   0xda, 0x68, 0xa8, 0x74, 0x52, 0xce, 0x8d, 0x86, 0x19, 0x03, 0xf9, 0x0c,
469
+//   0xe3, 0x0f, 0x49, 0x80, 0x92, 0xb9, 0xbd, 0xd9, 0xa3, 0x4e, 0x36, 0x4d,
470
+//   0xe5, 0x18, 0x2c, 0xf4, 0x26, 0x41, 0x5f, 0xe6, 0xae, 0x42, 0xef, 0xf7,
471
+//   0x79, 0x98, 0x9b, 0x74, 0x8f, 0xca, 0xbb, 0x5a, 0xac, 0xc5, 0xfb, 0xa6,
472
+//   0x29, 0x9d, 0x07, 0xb3, 0xa1, 0x87, 0x53, 0x42, 0x8a, 0xcc, 0xe7, 0x21,
473
+//   0xf3, 0x29, 0x1d, 0x30, 0xb9, 0xb9, 0x50, 0xae, 0x3f, 0xf9, 0x93, 0x4e,
474
+//   0xf0, 0xcb, 0xf5, 0x32, 0x71, 0x02, 0x81, 0x81, 0x00, 0xe9, 0x99, 0x67,
475
+//   0xd8, 0x6b, 0xd2, 0x6a, 0x64, 0xb3, 0x29, 0xd8, 0xfd, 0xe9, 0xae, 0xac,
476
+//   0xd8, 0x9e, 0x00, 0x7a, 0x4a, 0xd5, 0xc4, 0x09, 0x9f, 0x3f, 0x42, 0xd2,
477
+//   0xb6, 0x94, 0x19, 0xbb, 0x35, 0x04, 0x3b, 0x6c, 0xff, 0x75, 0xda, 0x95,
478
+//   0x86, 0x2a, 0xe2, 0x20, 0xd9, 0x4e, 0x2b, 0xf9, 0xc1, 0xf6, 0x3e, 0x1d,
479
+//   0x62, 0xdd, 0x53, 0xe9, 0x5c, 0x73, 0x3d, 0x5c, 0xa9, 0xec, 0xe6, 0xd9,
480
+//   0x8d, 0xb6, 0x7c, 0x8f, 0xa3, 0x4e, 0xca, 0x13, 0x1c, 0x17, 0xb3, 0x5e,
481
+//   0xd7, 0x15, 0x87, 0x1a, 0x6c, 0x57, 0x37, 0xc8, 0x49, 0x6e, 0xa0, 0x88,
482
+//   0xed, 0x15, 0x12, 0xe5, 0xd6, 0x68, 0x15, 0x59, 0xce, 0x8e, 0x66, 0xca,
483
+//   0x6b, 0xb0, 0x09, 0xe9, 0x9e, 0x24, 0x00, 0xde, 0x5c, 0x68, 0xc2, 0x4c,
484
+//   0xb2, 0xdd, 0xfa, 0x21, 0xab, 0xe3, 0x5e, 0x26, 0xf4, 0xac, 0x00, 0xfb,
485
+//   0x50, 0x4d, 0x51, 0x85, 0x9f, 0x02, 0x81, 0x81, 0x00, 0xe7, 0x70, 0x68,
486
+//   0xec, 0x66, 0xb1, 0xc1, 0xb2, 0x8b, 0xd6, 0xa1, 0x53, 0x64, 0x70, 0xa1,
487
+//   0x4a, 0xe4, 0x75, 0x27, 0x4e, 0xf4, 0xf5, 0x67, 0x02, 0x8e, 0x53, 0xa8,
488
+//   0x60, 0xe6, 0xd8, 0x40, 0x00, 0x49, 0xe5, 0x3a, 0x7c, 0x11, 0x58, 0xdd,
489
+//   0xf3, 0xdd, 0xcb, 0x19, 0x85, 0xca, 0xa9, 0xcd, 0x90, 0xc1, 0x6d, 0xf4,
490
+//   0x9c, 0x34, 0x32, 0x34, 0x11, 0x2d, 0x98, 0x8e, 0x3b, 0xf3, 0xe8, 0x0f,
491
+//   0x89, 0x0b, 0xd7, 0x83, 0xc0, 0xb5, 0x92, 0x92, 0x2b, 0x49, 0x09, 0xfd,
492
+//   0x3e, 0x88, 0x78, 0x19, 0xfc, 0x83, 0x58, 0x7d, 0xd6, 0x7b, 0x29, 0x1f,
493
+//   0x47, 0x89, 0x1d, 0xd9, 0x44, 0xbb, 0xb8, 0x9e, 0x46, 0x2f, 0xd8, 0x94,
494
+//   0x13, 0xd6, 0x03, 0xad, 0xf0, 0xd2, 0x12, 0xcc, 0x68, 0x02, 0xc0, 0xfa,
495
+//   0xc4, 0x72, 0x0f, 0x7a, 0x3e, 0x95, 0xc5, 0xa7, 0xe5, 0x53, 0x7c, 0xc1,
496
+//   0xbe, 0xe6, 0xab, 0xfa, 0x67, 0x02, 0x81, 0x80, 0x65, 0x28, 0x45, 0x4b,
497
+//   0xf7, 0x05, 0x1b, 0x85, 0x98, 0x00, 0x5b, 0x33, 0x39, 0x6a, 0xa6, 0xf6,
498
+//   0xf7, 0x15, 0x05, 0xe0, 0x3a, 0x49, 0xb6, 0x50, 0xfb, 0xb8, 0x18, 0x3f,
499
+//   0x70, 0x4a, 0xe4, 0x42, 0xc5, 0x1e, 0x66, 0xc9, 0x09, 0x64, 0x2a, 0xb3,
500
+//   0xfb, 0x06, 0x09, 0x6b, 0x90, 0xea, 0x82, 0x31, 0x78, 0x4c, 0xd5, 0xb4,
501
+//   0xe6, 0x5b, 0x5c, 0x06, 0xe8, 0xf0, 0x7d, 0x9c, 0x28, 0x36, 0x9f, 0xa7,
502
+//   0x3a, 0x8b, 0x1e, 0x38, 0x7d, 0xfa, 0x0b, 0xe4, 0x72, 0x6e, 0xfe, 0x76,
503
+//   0xed, 0x9f, 0x9f, 0xd5, 0xa2, 0xbf, 0x49, 0x40, 0x63, 0x63, 0xa9, 0x67,
504
+//   0xe1, 0x64, 0x59, 0x9b, 0x4b, 0x5f, 0x53, 0x90, 0x9b, 0x21, 0xf0, 0x2e,
505
+//   0x4a, 0x01, 0x40, 0xe5, 0x76, 0x79, 0xd9, 0xd0, 0xf2, 0x9c, 0x91, 0x52,
506
+//   0x33, 0xc6, 0x09, 0xa6, 0xc1, 0xc3, 0x17, 0xe3, 0x84, 0x48, 0xb8, 0x8b,
507
+//   0xc1, 0xaf, 0xb7, 0xc9, 0x02, 0x81, 0x81, 0x00, 0x8c, 0x64, 0x51, 0x11,
508
+//   0x8e, 0x5e, 0x27, 0xfc, 0xb1, 0xfd, 0x39, 0x91, 0x87, 0xad, 0x16, 0xfa,
509
+//   0x82, 0x49, 0x5a, 0xd5, 0xf7, 0x9c, 0x61, 0xa7, 0x58, 0x45, 0x01, 0x2f,
510
+//   0xfe, 0xf8, 0x91, 0x22, 0x5b, 0xb1, 0x14, 0xe0, 0x2b, 0xf9, 0xb7, 0x71,
511
+//   0xf6, 0x49, 0xfc, 0xaa, 0x7f, 0x3c, 0xaf, 0xf9, 0x2e, 0x8d, 0x0f, 0xc4,
512
+//   0x2d, 0x99, 0x82, 0xa2, 0x25, 0x01, 0x94, 0xce, 0x63, 0x6f, 0x92, 0xf4,
513
+//   0xf4, 0x5d, 0x00, 0x8c, 0x46, 0xd8, 0xa9, 0x98, 0x5e, 0x4f, 0x13, 0xf2,
514
+//   0xf9, 0xff, 0xb8, 0xeb, 0xc7, 0x95, 0x47, 0x88, 0x72, 0xdf, 0x88, 0x1c,
515
+//   0xf1, 0xdd, 0x4c, 0x6d, 0xf8, 0x5d, 0xce, 0x8d, 0x0e, 0xfb, 0x17, 0x20,
516
+//   0x4d, 0x43, 0xa0, 0x21, 0x24, 0x9d, 0xc8, 0xa7, 0x13, 0x7c, 0x92, 0xe1,
517
+//   0xd5, 0xba, 0xf3, 0xd1, 0xc1, 0x32, 0xcc, 0x5d, 0x3d, 0x5e, 0xc1, 0x7c,
518
+//   0x97, 0x1b, 0x1d, 0xe3, 0x02, 0x81, 0x81, 0x00, 0xc5, 0x01, 0x7c, 0x19,
519
+//   0x5b, 0x64, 0x72, 0x3c, 0xe0, 0xc6, 0x61, 0x87, 0xc4, 0x11, 0x26, 0x3d,
520
+//   0x2e, 0x74, 0xd4, 0x04, 0x68, 0x75, 0x3e, 0x7b, 0x5a, 0x52, 0xd0, 0xe2,
521
+//   0x9b, 0x35, 0x07, 0x21, 0xd9, 0x7e, 0xae, 0x13, 0x13, 0x2c, 0x68, 0x57,
522
+//   0xf2, 0xbf, 0x82, 0xb9, 0x0c, 0x01, 0xd6, 0x2b, 0xcf, 0x6b, 0xa5, 0xd6,
523
+//   0x14, 0x1c, 0x21, 0x1f, 0x1c, 0xab, 0x4a, 0xa4, 0xb0, 0xdb, 0xf6, 0xd7,
524
+//   0xb8, 0xef, 0x0b, 0x3d, 0xe4, 0x80, 0x1d, 0x88, 0x1f, 0x70, 0xf1, 0x53,
525
+//   0xff, 0xf4, 0x85, 0x25, 0xbf, 0x84, 0xbe, 0x2e, 0x83, 0xbe, 0x83, 0xf0,
526
+//   0xeb, 0xa9, 0x61, 0x67, 0x99, 0x2e, 0x49, 0xe4, 0x58, 0x90, 0x31, 0x42,
527
+//   0x54, 0x1e, 0x07, 0xa3, 0x4e, 0x2b, 0xd5, 0x96, 0x7b, 0xe9, 0x6d, 0x77,
528
+//   0x16, 0x19, 0xce, 0x28, 0xa6, 0x01, 0x57, 0xa2, 0xd2, 0xe6, 0xaf, 0x04,
529
+//   0x87, 0x8b, 0x40, 0xf0
530
+// };
531
+
532
+// unsigned int private_client_bin_key_len = 1192;
275 533
 #endif

+ 3
- 0
include/door_lib.h View File

@@ -2,8 +2,11 @@
2 2
 #define DOOR_LIB_H
3 3
 
4 4
 #define DOOR_PIN 5
5
+#define GREEN_LED 16
6
+#define RED_LED 4
5 7
 
6 8
 void setupDoor();
7 9
 void openDoor();
10
+void dontOpenDoor();
8 11
 
9 12
 #endif

+ 1
- 3
include/mrfc552_lib.h View File

@@ -6,10 +6,8 @@
6 6
 #define IRQ_PIN			4
7 7
 
8 8
 void setupMFRC552();
9
-void clearInt();
10
-void activateRec();
11 9
 void printCardUID(const char* uid);
12 10
 int readCardUID();
13
-void IRQ_cardAvailable();
11
+void resetMFRC552();
14 12
 
15 13
 #endif

+ 4
- 4
include/request_lib.h View File

@@ -7,10 +7,10 @@
7 7
 
8 8
 #define URL_OPENNING_REQ "/api/request"
9 9
 #define URL_REQ_POLL "/api/req_status"
10
-#define URL_PUB_DOOR_OPEN "/index.html"
11
-#define URL_PUB_DOOR_CLOSE "/index.html"
12
-#define URL_PUB_REQ_TO "/index.html"
13
-#define URL_PUB_OPEN_TO "/index.html"
10
+#define URL_PUB_DOOR_OPEN "/api/event/open"
11
+#define URL_PUB_DOOR_CLOSE "/api/event/close"
12
+#define URL_PUB_REQ_TO "api/timeout/request"
13
+#define URL_PUB_OPEN_TO "api/timeout/open"
14 14
 
15 15
 
16 16
 

+ 2
- 2
include/statemachine_lib.h View File

@@ -4,9 +4,9 @@
4 4
 #define MAX_TRY_REQUEST 3
5 5
 #define TIMEOUT_DELAY	10000
6 6
 
7
-#define DOOR_ID 		"E-209"
7
+#define DOOR_ID 		"E209"
8 8
 
9
-enum State{WAITING_CARD, CARD_AVAILABLE, CARD_READ, REQUEST_SENT, REQUEST_TIMEOUT, REQUEST_ACCEPTED, REQUEST_REJECTED};
9
+enum State{WAITING_CARD, CARD_READ, REQUEST_SENT, REQUEST_TIMEOUT, REQUEST_ACCEPTED, REQUEST_REJECTED};
10 10
 
11 11
 void runStateMachine();
12 12
 void resetStateMachine();

+ 10
- 10
src/connect_lib.cpp View File

@@ -26,7 +26,7 @@ const int httpsPort = 4000;
26 26
 // const char* ssid = "wifi-2su";
27 27
 // const char* password = "cle wifi 2su";
28 28
 
29
-// const char* host = "172.30.5.104";
29
+// const char* host = "172.30.5.137";
30 30
 // const int httpsPort = 4000;
31 31
 
32 32
 
@@ -61,6 +61,9 @@ bool connectToServer(){
61 61
   #endif
62 62
   if (!client.connect(host, httpsPort)) {
63 63
     Serial.println("connection failed");
64
+    char err_str[500];
65
+      int err = client.getLastSSLError(err_str, 500);
66
+      Serial.printf("last SSL error : %s\n", err_str);
64 67
     return false;
65 68
   }
66 69
 
@@ -70,6 +73,9 @@ bool connectToServer(){
70 73
     Serial.println("Server certificate verified");
71 74
   } else {
72 75
     Serial.println("ERROR: certificate verification failed!");
76
+    char err_str[500];
77
+      int err = client.getLastSSLError(err_str, 500);
78
+      Serial.printf("last SSL error : %s\n", err_str);
73 79
     return false;
74 80
   }
75 81
   #endif
@@ -98,26 +104,20 @@ bool addSSL(){
98 104
   if (!res0) {
99 105
     Serial.println("Failed to load client certificate!");
100 106
     return false;
101
-    // while (true) {
102
-    //   yield();
103
-    // }
104 107
   }
108
+
105 109
   bool res1 = client.setPrivateKey(private_client_bin_key, private_client_bin_key_len);
106 110
   if (!res1) {
107 111
     Serial.println("Failed to load client private key!");
108 112
     return false;
109
-    // while (true) {
110
-    //   yield();
111
-    // }
112 113
   }
114
+
113 115
   bool res = client.setCACert_P(caCert, caCertLen);
114 116
   if (!res) {
115 117
     Serial.println("Failed to load root CA certificate!");
116 118
     return false;
117
-    // while (true) {
118
-    //   yield();
119
-    // }
120 119
   }
121 120
   #endif
121
+
122 122
   return true;
123 123
 }

+ 10
- 0
src/door_lib.cpp View File

@@ -3,12 +3,22 @@
3 3
 
4 4
 void setupDoor(){
5 5
 	pinMode(DOOR_PIN, OUTPUT);
6
+	pinMode(GREEN_LED, OUTPUT);
7
+	pinMode(RED_LED, OUTPUT);
6 8
 }
7 9
 
8 10
 
9 11
 void openDoor(){
10 12
 	// Open door for X seconds and write result blockchain
11 13
 	digitalWrite(DOOR_PIN, HIGH);
14
+	digitalWrite(GREEN_LED, HIGH);
12 15
 	delay(2000);
13 16
 	digitalWrite(DOOR_PIN, LOW);
17
+	digitalWrite(GREEN_LED, LOW);
18
+}
19
+
20
+void dontOpenDoor(){
21
+	digitalWrite(RED_LED, HIGH);
22
+	delay(2000);
23
+	digitalWrite(RED_LED, LOW);
14 24
 }

+ 6
- 24
src/main.cpp View File

@@ -11,16 +11,12 @@
11 11
 #ifdef ENABLE_MFRC552
12 12
 #include "mrfc552_lib.h"
13 13
 #endif
14
+
14 15
 #ifdef ENABLE_DOOR
15 16
 #include "door_lib.h"
16 17
 #endif
17 18
 
18 19
 
19
-#ifdef ENABLE_MFRC552
20
-MFRC522 mfrc522(SS_PIN, RST_PIN);  // Create mfrc522 instance
21
-MFRC522::MIFARE_Key key;
22
-#endif
23
-
24 20
 #ifdef ADD_SSL
25 21
 WiFiClientSecure client;
26 22
 BearSSL::Session session;
@@ -49,21 +45,19 @@ void setup(){
49 45
 	setupMFRC552();
50 46
 	#endif
51 47
 
52
-// proceed with connecting of client to the host
48
+	// proceed with connecting of client to the host
53 49
 	bool wifi_connected = false;
54 50
 	while(!wifi_connected){
55 51
 		wifi_connected=connectToWIfi();
56 52
 		if(!wifi_connected) delay(60000);
57 53
 	}
58 54
 
59
-	//#ifdef ADD_SSL
60 55
 	// Add SSL layer
61 56
 	bool ssl_added=false;
62 57
 	while(!ssl_added){
63 58
 		ssl_added=addSSL();
64 59
 		if(!ssl_added) delay(500);
65 60
 	}
66
-	//#endif
67 61
 
68 62
 	Serial.println("Connected to WiFi and SSL ready");
69 63
 
@@ -71,15 +65,15 @@ void setup(){
71 65
 	bool server_connected=false;
72 66
 	while(!server_connected){
73 67
 		server_connected=connectToServer();
74
-		if(!server_connected) delay(500);
68
+		if(!server_connected){
69
+			delay(500);
70
+		}
75 71
 	}
76
-
77 72
 	Serial.println("Connected to server");
78 73
 
79
-
80 74
 	resetStateMachine();
75
+
81 76
 	#ifdef ENABLE_MFRC552
82
-	activateRec();
83 77
 	#else
84 78
 	current_state=CARD_READ;
85 79
 	#endif
@@ -87,17 +81,5 @@ void setup(){
87 81
 
88 82
 
89 83
 void loop(){
90
-	// if (card_available) { //new read interrupt
91
-	//     mfrc522.PICC_ReadCardSerial(); //read the tag data
92
-	//     // Show some details of the PICC (that is: the tag/card)
93
-	//     printCardUID();
94
-	//     resetStateMachine();
95
-	//     openDoor();
96
- //  	}
97
-
98
- //  // The receiving block needs regular retriggering (tell the tag it should transmit??)
99
- //  // (mfrc522.PCD_WriteRegister(mfrc522.FIFODataReg,mfrc522.PICC_CMD_REQA);)
100
- //  	activateRec();
101
- //    delay(100);
102 84
 	runStateMachine();
103 85
 }

+ 18
- 38
src/mrfc552_lib.cpp View File

@@ -3,46 +3,21 @@
3 3
 #include "mrfc552_lib.h"
4 4
 
5 5
 
6
-extern bool card_available;
7 6
 extern String currentCardUID;
8
-extern MFRC522 mfrc522;
7
+#ifdef ENABLE_MFRC552
8
+MFRC522 mfrc522(SS_PIN, RST_PIN);  // Create mfrc522 instance
9
+MFRC522::MIFARE_Key key;
10
+#endif
9 11
 
10 12
 
11 13
 void setupMFRC552(){
12
-	/* setup the IRQ pin*/
13
-	pinMode(IRQ_PIN, INPUT_PULLUP);
14 14
 
15 15
 	SPI.begin();			// Init SPI bus
16 16
 	mfrc522.PCD_Init();		// Init MFRC522
17
-	 /* read and printout the MFRC522 version (valid values 0x91 & 0x92)*/
18
-	Serial.print(F("Ver: 0x"));
19
-	byte readReg = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
20
-	Serial.println(readReg, HEX);
21
-	mfrc522.PCD_WriteRegister(mfrc522.ComIEnReg, 0xA0); // Enable interrupt
22 17
 
23
-	/*Activate the interrupt*/
24
-	attachInterrupt(digitalPinToInterrupt(IRQ_PIN), IRQ_cardAvailable, FALLING);
25
-
26
-	mfrc522.PCD_DumpVersionToSerial();	// Show details of PCD - MFRC522 Card Reader details
27
-	Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks+."));
28
-}
29
-
30
-
31
-/*
32
- * The function to clear the pending interrupt bits after interrupt serving routine
33
- */
34
-void clearInt() {
35
-  mfrc522.PCD_WriteRegister(mfrc522.ComIrqReg, 0x7F);
36
-  mfrc522.PICC_HaltA();
37
-}
38
-
39
-/*
40
- * The function sending to the MFRC522 the needed commands to activate the reception
41
- */
42
-void activateRec() {
43
-  mfrc522.PCD_WriteRegister(mfrc522.FIFODataReg, mfrc522.PICC_CMD_REQA);
44
-  mfrc522.PCD_WriteRegister(mfrc522.CommandReg, mfrc522.PCD_Transceive);
45
-  mfrc522.PCD_WriteRegister(mfrc522.BitFramingReg, 0x87);
18
+	//Serial.print(F("Ver: 0x"));
19
+	//byte readReg = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
20
+	//Serial.println(readReg, HEX);
46 21
 }
47 22
 
48 23
 void printCardUID(const char* uid){
@@ -51,14 +26,19 @@ void printCardUID(const char* uid){
51 26
 }
52 27
 
53 28
 int readCardUID(){
54
-	mfrc522.PICC_ReadCardSerial();
29
+	if ( ! mfrc522.PICC_IsNewCardPresent()) {
30
+		return 1;
31
+	}
32
+	  // Select one of the cards
33
+	if ( ! mfrc522.PICC_ReadCardSerial()) {
34
+	    return 1;
35
+	}
36
+
55 37
   	if(mfrc522.uid.size > 0){
56
-  		currentCardUID="";
57 38
   		for (byte i = 0; i < mfrc522.uid.size; i++) {
58 39
   			currentCardUID += String(mfrc522.uid.uidByte[i],HEX);
59 40
 		}
60
-  		printCardUID(currentCardUID.c_str());
61
-  		
41
+  		printCardUID(currentCardUID.c_str());	
62 42
   	}
63 43
   	else{
64 44
   		Serial.println("	Error : cannot read card UID");
@@ -67,6 +47,6 @@ int readCardUID(){
67 47
   	return 0;
68 48
 }
69 49
 
70
-void IRQ_cardAvailable(){
71
-	card_available=true;
50
+void resetMFRC552(){
51
+	mfrc522.PICC_HaltA();
72 52
 }

+ 19
- 2
src/request_lib.cpp View File

@@ -6,6 +6,7 @@
6 6
 #include "http_cli_lib.h"
7 7
 
8 8
 extern String currentTimestamp;
9
+extern String currentTxid;
9 10
 
10 11
 time_t getEpoch(){
11 12
 	time_t tnow = time(nullptr);
@@ -32,8 +33,24 @@ bool send_openning_request(const char *user_id, const char *door_id, char *res)
32 33
 	json.printTo(json_str,json.measureLength()+1);
33 34
 
34 35
 	// integrer la string api_request_string dans le champ POST d'une requete
35
-	return send_post_request(json_str, URL_OPENNING_REQ, res);
36
-	// return la réponse du noeud blockchain
36
+	if(send_post_request(json_str, URL_OPENNING_REQ, res)){
37
+		StaticJsonBuffer<500> jsonBuffer;
38
+		JsonObject& root = jsonBuffer.parseObject(res);
39
+		if (!root.success()) {
40
+		    Serial.println("parseObject() failed");
41
+		    return 0;
42
+		}
43
+
44
+		char json_str2[root.measureLength()+1];
45
+		root.printTo(json_str2,root.measureLength()+1);
46
+		// add check if key exist
47
+		String txid=root["txid"];
48
+		String time=root["timestamp"];
49
+		currentTxid=txid;
50
+		currentTimestamp=time;
51
+		return true;
52
+	}
53
+	return false;
37 54
 }
38 55
 
39 56
 

+ 23
- 35
src/statemachine_lib.cpp View File

@@ -8,6 +8,7 @@
8 8
 #include "door_lib.h"
9 9
 #endif
10 10
 #ifdef ENABLE_MFRC552
11
+#include <MFRC522.h>
11 12
 #include "mrfc552_lib.h"
12 13
 #endif
13 14
 
@@ -18,13 +19,7 @@ extern WiFiClientSecure client;
18 19
 extern WiFiClient client;
19 20
 #endif
20 21
 
21
-#ifdef ENABLE_MFRC552
22
-volatile bool card_available = false;
23
-#else
24
-volatile bool card_available = true;
25
-#endif
26 22
 volatile bool response_available = false;
27
-
28 23
 unsigned long start_timer=0;
29 24
 enum State current_state, last_state;
30 25
 String currentTxid;
@@ -43,52 +38,47 @@ void runStateMachine(){
43 38
 
44 39
 		switch(current_state){
45 40
 			case WAITING_CARD:
46
-				if(card_available){
47
-					current_state=CARD_AVAILABLE;
41
+				if(!readCardUID()){
42
+					current_state=CARD_READ;
48 43
 				}
49 44
 				else{
45
+					while(WiFi.status() != WL_CONNECTED){
46
+						Serial.println("WAITING : not connected to WiFi");
47
+						connectToWIfi();
48
+					}
49
+					while(client.available()){
50
+						char c = client.read();
51
+					}
50 52
 					while (!client.connected()) {
53
+						Serial.println("WAITING : not connected to server");
51 54
 						connectToServer();
52 55
 					}
53 56
 				}
54 57
 				break;
55 58
 
56
-			case CARD_AVAILABLE:
57
-				#ifdef ENABLE_MFRC552
58
-				if(readCardUID()){
59
-					resetStateMachine();
60
-				}
61
-				else{
62
-					current_state=CARD_READ;
63
-				}
64
-				#endif
65
-				break;
66
-
67 59
 			case CARD_READ:
68 60
 				char res_txid[200];
69 61
 				start_timer=millis();
70 62
 				#ifdef ENABLE_MFRC552
71 63
 				if(send_openning_request(currentCardUID.c_str(), DOOR_ID, res_txid)){
72 64
 					Serial.print(" ---- TXID RES = ");Serial.println(res_txid);
73
-					currentTxid = String(res_txid);
74 65
 					current_state=REQUEST_SENT;
75 66
 				}
76 67
 				#else
77 68
 				if(send_openning_request("test-UID", DOOR_ID, res_txid)){
78
-					currentTxid = String(res_txid);
69
+					Serial.print(" ---- TXID RES = ");Serial.println(res_txid);
79 70
 					current_state=REQUEST_SENT;
80 71
 				}
81 72
 				#endif
82 73
 				else{
83 74
 					resetStateMachine();
84 75
 				}
85
-				//while(1);
86 76
 				break;
87 77
 
88 78
 			case REQUEST_SENT:
89 79
 				if(millis() - start_timer > TIMEOUT_DELAY){
90 80
 					char res[200];
91
-					publish_request_timeout(DOOR_ID, currentTxid.c_str(), res);
81
+					//publish_request_timeout(DOOR_ID, currentTxid.c_str(), res);
92 82
 					Serial.println("	Error : response timeout");
93 83
 					resetStateMachine();
94 84
 					break;
@@ -98,20 +88,18 @@ void runStateMachine(){
98 88
 				if(res==2){
99 89
 					current_state=REQUEST_REJECTED;
100 90
 				}
101
-				// else if(res==3){
102
-				// 	current_state=REQUEST_ACCEPTED;
103
-				// }
104 91
 				else if(res==1){
105 92
 					current_state=REQUEST_ACCEPTED;
106 93
 				}
107 94
 				else if(!res){
108 95
 					resetStateMachine();
109 96
 				}
110
-				//delay(200);
111
-				//while(1);
112 97
 				break;
113 98
 
114 99
 			case REQUEST_REJECTED:
100
+				#ifdef ENABLE_DOOR
101
+				dontOpenDoor();
102
+				#endif
115 103
 				resetStateMachine();
116 104
 				break;
117 105
 
@@ -126,18 +114,18 @@ void runStateMachine(){
126 114
 				resetStateMachine();
127 115
 				break;
128 116
 		}
129
-		#ifdef ENABLE_MFRC552
130
-		if(!card_available) activateRec();
131
-		#endif
132 117
 		delay(10);
133 118
 	}
134 119
 }
135 120
 
136 121
 void resetStateMachine(){
137
-	#ifdef ENABLE_MFRC552
138
-	clearInt();
139
-    #endif
140
-    card_available = false;
141 122
     current_state=WAITING_CARD;
123
+    currentCardUID="";
124
+    currentTxid="";
125
+    currentTimestamp="";
142 126
     Serial.println("\n---- RESET ST_MACHINE ----");
127
+    dontOpenDoor();
128
+    #ifdef ENABLE_MFRC552
129
+	resetMFRC552();
130
+    #endif
143 131
 }

Loading…
Cancel
Save