it works!
This commit is contained in:
14
src/main.cpp
14
src/main.cpp
@@ -1,5 +1,9 @@
|
|||||||
// The codes that are displayed are not consistent with the GOOGLE Authenticator
|
// to get the code from Google Authenticator you need to decode base32 and
|
||||||
// app.... I guess that TOTP library has an issue...
|
// convert that to hex:
|
||||||
|
/*
|
||||||
|
echo -n "F4ZVI6KKNF4SW5DG" |base32 -d | xxd -ps
|
||||||
|
2f3354794a69792b7466
|
||||||
|
*/
|
||||||
|
|
||||||
// I connected SCL to D22 and SDA to D21
|
// I connected SCL to D22 and SDA to D21
|
||||||
|
|
||||||
@@ -23,10 +27,10 @@
|
|||||||
WiFiUDP ntpUDP;
|
WiFiUDP ntpUDP;
|
||||||
NTPClient timeClient(ntpUDP);
|
NTPClient timeClient(ntpUDP);
|
||||||
|
|
||||||
uint8_t hmacKey[] = {0x62, 0x27, 0x2F, 0x33, 0x54, 0x79, 0x4A,
|
uint8_t hmacKey[] = {0x2F, 0x33, 0x54, 0x79, 0x4A,
|
||||||
0x69, 0x79, 0x2B, 0x74, 0x66, 0x27};
|
0x69, 0x79, 0x2B, 0x74, 0x66};
|
||||||
|
|
||||||
TOTP totp = TOTP(hmacKey, 12);
|
TOTP totp = TOTP(hmacKey, 10);
|
||||||
char code[7];
|
char code[7];
|
||||||
|
|
||||||
unsigned long lastMsg = 0;
|
unsigned long lastMsg = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user