Hello, so I am in the same position as the original poster. Using an ESP32, MFCR522, and TFT screen I am unable to have both external peripherals working together. The screen will also display the appropriate data but the card reader never registers that a card has been presented. The inital build was the card reader and an I2C screen and functioned without issues. When upgrading the setup to a 2.8" tft I am unable to resolve what the issue could be.
I found this post and a few other random ones across google but have yet to find a resolution. I have tried your wiring from above and verfied contents of my code against yours but will only get a white screen.
I have another setup with similar code that is running an I2C screen and the RFId reader works just fine. Only when I change it to use the tft screen does the reader stop working
//Version 2
//Includes base prorgam, includes OTA
#include <SPI.h>
//#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <HTTPClient.h>
#include <WiFi.h>
#include <soc/soc.h>
#include <soc/rtc_cntl_reg.h>
#include <MFRC522.h>
#include <time.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include <ESPmDNS.h>
#include <Update.h>
//Define the pins used for the RFID reader and setup RFID for use
#define SS_PIN 5
#define RST_PIN 0
//Initialize the RFID Card reader
MFRC522 rfid(SS_PIN, RST_PIN); // Instance of the class
MFRC522::MIFARE_Key key;
// Define pins for TFT display
#define TFT_CS 13
#define TFT_RST 26
#define TFT_DC 12
//#define TFT_SCK 18
//#define TFT_MOSI 23
//#define TFT_MISO 19
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
//Software Verstion
String ver = "2.0";
// Init array that will store UID
//how many digits of the card should be recorded
int card_digits = 4;
//byte to store the card info into, this should match the number in card_digits
byte uid[4];
int card_counter = 0;
//Define the location device is installed on
const char* location = "Testerv3";
String employee_name = "";
String old_employee_name= "";
String employee_name2 = "";
String old_old_employee_name = "";
//Define the shift hours based on START Time of each shift, as hour only, 24hr clock
int First_Shift = 0;
int Second_Shift = 0;
int Third_Shift = 0;
//input the length in hours of each shift, ie 10 is a ten hour shift
int shift_length = 10;
//input the time of starting first shift each day, ie 6am is 6
int shift_start = 6;
const char* current_shift;
const char* old_current_shift;
//Setup wifi information
const char* ssid = "CEDIRF";
const char* password = "T3cn0l0g14Rf";
const char* serverName = "http://10.96.8.64/post-esp-data.php";
String apiKeyValue = "tPmAT5Ab3j7F9";
const char* host = "ESP32";
//timers for checking wifi status
unsigned long previousMillis = 0; //millis for checking inernet
unsigned long previousMillis2 = 0; //millis for sending data
//Timers for sending data to php server
unsigned long interval = 30000; //check for internet connection every 30 seconds
int reporting_minutes_interval = 60; //interval to send the data to server
long reporting_minutes = 0; //minutes counter to send report
long reporting_seconds = 0;
long reporting_milli_seconds = 0;
long time_to_report = 0;
long old_time_to_report = 0;
//Timers for up time minutes
long uptime_minutes = 0;
long uptime_seconds = 0;
long uptime_seconds_counter = 0;
float uptime = 0;
long old_uptime_minutes = 0;
long old_uptime_seconds = 0;
//Timers for downtime minutes
long downtime_minutes = 0;
long downtime_seconds = 0;
long downtime_seconds_counter = 0;
float downtime = 0;
long old_downtime_minutes = 0;
long old_downtime_seconds = 0;
//Receive the response code from the server, if it is 200 then the data was received
int httpResponseCode = 0;
//counter for registering the number of stops
int stop_counter = 0;
int stop_counter_assistant = 0;
int old_stop_counter = 0;
//used to calculate availability of the machine
float availability = 0;
float old_availability = 0;
//used to calculate the number of stops per minute
float stops_minute = 0;
//setup NTP time server and information
const char* ntpServer = "pool.ntp.org";
const long gmtOffset_sec = -21600;
const int daylightOffset_sec = 3600;
char timeHour[3];
struct tm timeinfo;
//variables for graph
int hour1 = 0;
int hour2 = 0;
int hour3 = 0;
int hour4 = 0;
int hour5 = 0;
int hour6 = 0;
float hour1_perf = 0;
float hour2_perf = 0;
float hour3_perf = 0;
float hour4_perf = 0;
float hour5_perf = 0;
float hour6_perf = 0;
WebServer server(80);
/* Style */
String style =
"<style>#file-input,input{width:100%;height:44px;border-radius:4px;margin:10px auto;font-size:15px}"
"input{background:#f1f1f1;border:0;padding:0 15px}body{background:#3498db;font-family:sans-serif;font-size:14px;color:#777}"
"#file-input{padding:0;border:1px solid #ddd;line-height:44px;text-align:left;display:block;cursor:pointer}"
"#bar,#prgbar{background-color:#f1f1f1;border-radius:10px}#bar{background-color:#3498db;width:0%;height:10px}"
"form{background:#fff;max-width:258px;margin:75px auto;padding:30px;border-radius:5px;text-align:center}"
".btn{background:#3498db;color:#fff;cursor:pointer}</style>";
/* Login page */
String loginIndex =
"<form name=loginForm>"
"<h1>ESP32 Login</h1>"
"<input name=userid placeholder='User ID'> "
"<input name=pwd placeholder=Password type=Password> "
"<input type=submit onclick=check(this.form) class=btn value=Login></form>"
"<script>"
"function check(form) {"
"if(form.userid.value=='admin' && form.pwd.value=='admin')"
"{window.open('/serverIndex')}"
"else"
"{alert('Error Password or Username')}"
"}"
"</script>" + style;
/* Server Index Page */
String serverIndex =
"<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>"
"<form method='POST' action='#' enctype='multipart/form-data' id='upload_form'>"
"<input type='file' name='update' id='file' onchange='sub(this)' style=display:none>"
"<label id='file-input' for='file'> Choose file...</label>"
"<input type='submit' class=btn value='Update'>"
"<br><br>"
"<div id='prg'></div>"
"<br><div id='prgbar'><div id='bar'></div></div><br></form>"
"<script>"
"function sub(obj){"
"var fileName = obj.value.split('\\\\');"
"document.getElementById('file-input').innerHTML = ' '+ fileName[fileName.length-1];"
"};"
"$('form').submit(function(e){"
"e.preventDefault();"
"var form = $('#upload_form')[0];"
"var data = new FormData(form);"
"$.ajax({"
"url: '/update',"
"type: 'POST',"
"data: data,"
"contentType: false,"
"processData:false,"
"xhr: function() {"
"var xhr = new window.XMLHttpRequest();"
"xhr.upload.addEventListener('progress', function(evt) {"
"if (evt.lengthComputable) {"
"var per = evt.loaded / evt.total;"
"$('#prg').html('progress: ' + Math.round(per*100) + '%');"
"$('#bar').css('width',Math.round(per*100) + '%');"
"}"
"}, false);"
"return xhr;"
"},"
"success:function(d, s) {"
"console.log('success!') "
"},"
"error: function (a, b, c) {"
"}"
"});"
"});"
"</script>" + style;
void setup() {
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG,0);
//Initialize serial and wait for port to open
Serial.begin(9600);
delay(1500);
SPI.begin(); // Init SPI bus
rfid.PCD_Init(); // Init MFRC522
for (byte i = 0; i < card_digits; i++)
{
key.keyByte[i] = 0xFF;
}
//Initialize time
configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
// Initialize TFT
tft.begin();
tft.setRotation(-1);
tft.fillScreen(ILI9341_BLACK);
tft.setCursor(0, 0);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.print("Software Version: ");
tft.println(ver);
Serial.println("TFT Initialized");
delay(1500);
WiFi.begin(ssid, password);
tft.fillScreen(ILI9341_BLACK);
tft.print("Connecting");
while(WiFi.status() != WL_CONNECTED)
{
delay(500);
tft.print(".");
}
tft.fillScreen(ILI9341_BLACK);
tft.println("");
tft.print("Connected to WiFi network with IP Address:");
tft.println(WiFi.localIP());
Serial.println(WiFi.localIP());
delay(1500);
/*use mdns for host name resolution*/
if (!MDNS.begin(host))
{
Serial.println("Error setting up MDNS responder!");
tft.println("Error setting up DNS");
while (1)
{
delay(1000);
}
}
tft.println("DNS Server Started");
delay(1500);
Serial.println("mDNS responder started");
/*return index page which is stored in serverIndex */
server.on("/", HTTP_GET, []() {
server.sendHeader("Connection", "close");
server.send(200, "text/html", loginIndex);
});
server.on("/serverIndex", HTTP_GET, []() {
server.sendHeader("Connection", "close");
server.send(200, "text/html", serverIndex);
});
/*handling uploading firmware file */
server.on("/update", HTTP_POST, []() {
server.sendHeader("Connection", "close");
server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
ESP.restart();
}, []() {
HTTPUpload& upload = server.upload();
if (upload.status == UPLOAD_FILE_START) {
Serial.printf("Update: %s\n", upload.filename.c_str());
if (!Update.begin(UPDATE_SIZE_UNKNOWN)) { //start with max available size
Update.printError(Serial);
}
} else if (upload.status == UPLOAD_FILE_WRITE) {
/* flashing firmware to ESP*/
if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
Update.printError(Serial);
}
} else if (upload.status == UPLOAD_FILE_END) {
if (Update.end(true)) { //true to set the size to the current progress
Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
} else {
Update.printError(Serial);
}
}
});
server.begin();
tft.fillScreen(ILI9341_BLACK);
}
void loop()
{
server.handleClient();
delay(1);
unsigned long currentMillis = millis(); //milli counter for checking wifi
int volts = analogRead(34); //positive side of voltage sensor to D34
httpResponseCode = 0;
//Serial.println(timeinfo.tm_hour);
//Define shifts for a ten hour shift day, which would only have a first and second shift
if (shift_length == 10)
{
First_Shift = shift_start;
Second_Shift = shift_start + shift_length;
if ((timeinfo.tm_hour >= First_Shift) && (timeinfo.tm_hour < (First_Shift + shift_length)))
{
current_shift = "First";
}
if ((timeinfo.tm_hour >= Second_Shift) && (timeinfo.tm_hour < (Second_Shift + shift_length)))
{
current_shift = "";
}
}
//Define shifts for a 8 hour shift day, which would only have a first and second shift and third shift
if (shift_length == 8)
{
First_Shift = shift_start;
Second_Shift = shift_start + shift_length;
Third_Shift = shift_start + shift_length + shift_length;
if ((timeinfo.tm_hour >= First_Shift) && (timeinfo.tm_hour < (First_Shift + shift_length)))
{
current_shift = "First";
}
if ((timeinfo.tm_hour >= Second_Shift) && (timeinfo.tm_hour < (Second_Shift + shift_length)))
{
current_shift = "Second";
}
if ((timeinfo.tm_hour >= Third_Shift) && (timeinfo.tm_hour < (Third_Shift + shift_length)))
{
current_shift = "Third";
}
}
//check if a new card has been passed in front of the card reader
if (rfid.PICC_IsNewCardPresent() && rfid.PICC_ReadCardSerial())
{
employee_name2 = "";
for (byte i = 0; i < card_digits; i++)
{
uid[i] = rfid.uid.uidByte[i];
//record the hex number of the card to employee_name
employee_name2.concat(String(uid[i], HEX));
}
//printHex(rfid.uid.uidByte, rfid.uid.size);
//Turn the hex digits received from card reader into employee number, make sake sure that the uid[x] is the same number of digits you are looking for on the card
//employee_name = (String)uid[1] + (String)uid[2] + (String)uid[3] + (String)uid[4];
Serial.println(employee_name2);
rfid.PICC_HaltA();
rfid.PCD_StopCrypto1();
//check if a new card has been waved in front, if its the same card do nothing
if (employee_name2 != old_employee_name)
{
card_counter = 1;
old_old_employee_name = old_employee_name;
old_employee_name = employee_name2;
tft.setTextSize(2);
tft.setCursor(0,0);
tft.println("Card Has");
tft.println("Been");
tft.println("Scanned");
delay(600);
}
}
// if WiFi is down, try reconnecting
if ((WiFi.status() != WL_CONNECTED) && (currentMillis - previousMillis >=interval))
{
tft.setTextSize(1);
tft.setCursor(0,0);
tft.print(millis());
tft.println("Reconnecting to WiFi...");
WiFi.disconnect();
WiFi.reconnect();
previousMillis = currentMillis;
}
//the system will only monior the status of the machine if it is connected to wifi, else it would not have a place to send the data to
if(WiFi.status()==WL_CONNECTED)
{
WiFiClient client;
HTTPClient http;
http.begin(client, serverName);
//Time for monitoring when to send the report, this is not on the hour but every hour since the arduino has started
if (millis() - reporting_milli_seconds > 1000)
{
reporting_seconds ++;
reporting_milli_seconds = millis();
}
if(reporting_seconds == 60)
{
reporting_minutes++;
reporting_seconds = 0;
//Get the hour from the NTP server
getLocalTime(&timeinfo);
configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
//Serial.println(hours);
//setup timeinfo as a data store from the time pulled from NTP server
//pull the hour from the time on the NTP server
strftime(timeHour,3, "%H", &timeinfo);
}
//Countdownt to when the report will be sent
time_to_report = reporting_minutes_interval - reporting_minutes;
//start the counter for up time and downtime minutes based on D34, this is based on if there is an active schedule or not
if( current_shift != "" )
{
//Serial.print("Volts:");
//Serial.println(volts);
if (volts == 0) //if voltage is greater than this the machine is running
{
if ((millis()-uptime_seconds_counter) > 1000)
{
uptime_seconds++;
uptime_seconds_counter = millis();
stop_counter_assistant = 0;
availability = ((float)uptime_minutes / ((float)uptime_minutes + (float)downtime_minutes))*100;
//this calculates the stops per minute out of every hour
stops_minute = (float)stop_counter / ((float)downtime_minutes + (float)uptime_minutes);
}
if (uptime_seconds == 60)
{
uptime_minutes++;
uptime_seconds = 0;
availability = ((float)uptime_minutes / ((float)uptime_minutes + (float)downtime_minutes))*100;
//this calculates the stops per minute out of every hour
stops_minute = (float)stop_counter / ((float)downtime_minutes + (float)uptime_minutes);
}
}
//With the relay, 0 volts is running and positive voltage is down
if (volts > 0) //if voltage is less than this then start downtime timer
{
if ((millis()-downtime_seconds_counter) > 1000)
{
if (stop_counter_assistant == 0)
{
stop_counter++;
}
downtime_seconds++;
downtime_seconds_counter = millis();
stop_counter_assistant = 1;
availability = ((float)uptime_minutes / ((float)uptime_minutes + (float)downtime_minutes))*100;
//this calculates the stops per minute out of every hour
stops_minute = (float)stop_counter / ((float)downtime_minutes + (float)uptime_minutes);
}
if (downtime_seconds == 60)
{
downtime_minutes++;
downtime_seconds = 0;
availability = ((float)uptime_minutes / ((float)uptime_minutes + (float)downtime_minutes))*100;
//this calculates the stops per minute out of every hour
stops_minute = (float)stop_counter / ((float)downtime_minutes + (float)uptime_minutes);
}
}
}
//when the counter hits the reporting interval send the data to php server
//add the or statement here so if someone swipes their rfid card it will send the report right then
while (((reporting_minutes == reporting_minutes_interval) || (card_counter == 1)) && current_shift != "")
{
if (card_counter = 1)
{
employee_name = old_old_employee_name;
}
else employee_name = employee_name2;
//Display status
tft.fillScreen(ILI9341_BLACK);
tft.setTextSize(1);
tft.setCursor(0,0);
tft.println("Sending to Server");
//send data to php server
httpResponseCode = 0;
while (httpResponseCode != 200)
{
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
String httpRequestData = "api_key=" + apiKeyValue + "&location=" + location + "&employee_name=" + employee_name + "¤t_shift=" + current_shift +"&uptime=" + uptime + "&downtime=" + downtime + "&stop_counter=" + stop_counter + "&stops_minute=" + stops_minute + "&availability=" + availability;
//String httpRequestData = "api_key=tPmAT5Ab3j7F9&location=L6W1";
httpResponseCode = http.POST(httpRequestData);
Serial.println(httpResponseCode);
delay(1000);
}
if (httpResponseCode = 200)
{
//reset all of the couners, timers, etc
reporting_minutes = 0;
reporting_milli_seconds = 0;
downtime_minutes = 0;
downtime_seconds = 0;
uptime_minutes = 0;
uptime_seconds = 0;
stop_counter = 0;
stop_counter_assistant =0;
availability = 0;
stops_minute = 0;
uptime = 0;
downtime = 0;
card_counter = 0;
delay(300);
}
}
}
else
{
Serial.println("WiFi Disconnected");
}
if (current_shift = "")
{
reporting_minutes = 0;
}
//Draw Boxes etc
tft.fillRect(0,0,320,10,ILI9341_YELLOW);
tft.drawRect(0,10,315,35,ILI9341_RED);
tft.drawRect(1,11,315,35,ILI9341_RED);
tft.drawRect(2,12,315,35,ILI9341_RED);
tft.drawRect(3,13,315,35,ILI9341_RED);
tft.drawRect(4,14,315,35,ILI9341_RED);
//tft.fillRect(120,120,120,120,ILI9341_RED);
//Registering data to variables to monitor performance, this probably needs to run only when shift is active
if (hour1 != timeinfo.tm_hour)
{
hour1 = timeinfo.tm_hour;
hour2 = hour1 - 1;
hour3 = hour2 - 2;
hour4 = hour3 - 3;
hour5 = hour4 - 4;
hour6 = hour5 - 5;
//hour2_perf = hour1_perf;
//hour3_perf = hour2_perf;
//hour4_perf = hour3_perf;
//hour5_perf = hour4_perf;
//hour6_perf = hour5_perf;
//hour1_perf = availability;
hour2_perf = 90;
hour3_perf = 72;
hour4_perf = 40;
hour5_perf = 60;
hour6_perf = 85;
}
//barss for the Hour 2
if (hour2_perf != 0 )
{
if(hour2_perf>=90)
{
tft.fillRect(20,170,30,60,ILI9341_GREEN);
tft.setCursor(20,232);
tft.setTextColor(ILI9341_WHITE);
tft.fillRect(20,232,10,5,ILI9341_BLACK);
tft.print(hour2);
tft.print(":00");
}
if((hour2_perf >=70) && (hour2_perf<90))
{
tft.fillRect(20,190, 30,40,ILI9341_YELLOW);
tft.setCursor(20,232);
tft.setTextColor(ILI9341_WHITE);
tft.print(hour2);
tft.print(":00");
}
if(hour2_perf < 70)
{
tft.fillRect(20,210,30,20,ILI9341_RED);
tft.setCursor(20,232);
tft.setTextColor(ILI9341_WHITE);
tft.print(hour2);
tft.print(":00");
}
}
//bars for hour 3
if (hour3_perf != 0 )
{
if(hour3_perf>=90)
{
tft.fillRect(70,170,30,60,ILI9341_GREEN);
tft.setCursor(70,232);
tft.setTextColor(ILI9341_WHITE);
tft.print(hour2);
tft.print(":00");
}
if((hour3_perf >=70) && (hour3_perf<90))
{
tft.fillRect(70,190, 30,40,ILI9341_YELLOW);
tft.setCursor(70,232);
tft.setTextColor(ILI9341_WHITE);
tft.print(hour3);
tft.print(":00");
}
if(hour3_perf < 70)
{
tft.fillRect(70,210,30,20,ILI9341_RED);
tft.setCursor(70,232);
tft.setTextColor(ILI9341_WHITE);
tft.print(hour2);
tft.print(":00");
}
}
//clearing the RSSI from the screen
tft.fillRect(175,1,20,8,ILI9341_YELLOW);
//Display the performance of the operator in different colors based on their results
if (availability >= 90)
{
if (old_availability != availability)
{
tft.fillRect(0,100,320,62, ILI9341_GREEN);
tft.setCursor(40,105);
tft.setTextColor(ILI9341_BLACK);
tft.setTextSize(3);
tft.print("Performance: ");
tft.setCursor(105,138);
tft.print(availability, 1);
tft.print("%");
//tft.fillRect(171,223,75,14,ILI9341_GREEN);
old_availability = availability;
}
}
if (availability < 90)
{
if (old_availability != availability)
{
tft.fillRect(0,100,320,62, ILI9341_RED);
tft.setCursor(40,105);
tft.setTextColor(ILI9341_BLACK);
tft.setTextSize(3);
tft.print("Performance: ");
tft.setCursor(105,138);
tft.print(availability, 1);
tft.print("%");
//tft.fillRect(171,223,75,14,ILI9341_RED);
old_availability = availability;
}
}
//display IP Address in top Row
tft.setTextColor(ILI9341_BLACK);
tft.setTextSize(1);
tft.setCursor(0,2);
tft.print("IP: ");
tft.println(WiFi.localIP());
//display RSSI in top Row
tft.setTextColor(ILI9341_BLACK);
tft.setCursor(100,2);
tft.print("Network RSSI:");
tft.setCursor(178,2);
tft.println(WiFi.RSSI());
//display Software version in top row
tft.setTextColor(ILI9341_BLACK);
tft.setCursor(210,2);
tft.print("Software: ");
tft.print(ver);
//Clear the Time to Report number
if (old_time_to_report != time_to_report)
{
tft.fillRect(79,16,17,8,ILI9341_BLACK);
old_time_to_report = time_to_report;
}
tft.setTextColor(ILI9341_WHITE);
tft.setCursor(6,17),
tft.print("Min to Up/L: ");
tft.print(time_to_report);
//Clear the text in the shift spot
if (old_current_shift != current_shift)
{
tft.fillRect(41,26,53,12,ILI9341_BLACK);
old_current_shift = current_shift;
}
tft.setCursor(6,30);
tft.print("Shift: ");
tft.print(current_shift);
//Clear the minutes in uptime
//if (old_uptime_minutes != uptime_minutes)
//{
// tft.fillRect(190,56,27,18,ILI9341_RED);
// old_uptime_minutes = uptime_minutes;
// }
//Clear the seconds in uptime
if (old_uptime_seconds != uptime_seconds)
{
tft.fillRect(190,56,80,20,ILI9341_YELLOW);
old_uptime_seconds = uptime_seconds;
}
tft.setCursor(20,60);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.print("Uptime Min/Hr: ");
tft.print(uptime_minutes);
tft.print(":");
tft.println(uptime_seconds);
//Clear the minutes in downtime
//if (old_downtime_minutes != downtime_minutes)
//{
//tft.fillRect(198,76,30,22,ILI9341_BLUE);
// old_downtime_minutes = downtime_minutes;
// }
//Clear the seconds in the downtime
if (old_downtime_seconds != downtime_seconds)
{
tft.fillRect(198,76,80,20,ILI9341_YELLOW);
old_downtime_seconds = downtime_seconds;
}
tft.setCursor(20,80);
tft.setTextColor(ILI9341_WHITE);
tft.print("Dwntime Min/Hr: ");
tft.print(downtime_minutes);
tft.print(":");
tft.println(downtime_seconds);
//Clear and post data for number of stops
if (old_stop_counter != stop_counter)
{
tft.fillRect(188,16,27,10,ILI9341_BLUE);
tft.setTextSize(1);
tft.setTextColor(ILI9341_WHITE);
tft.setCursor(120,17);
tft.print("# of Stops: ");
tft.println(stop_counter);
}
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(1);
tft.setCursor(120,24);
tft.print("Emploee: ");
tft.print(employee_name2);
//tft.print("Stops/Hr: ");
//tft.println(stops_minute);
//tft.print("Shift: ");
//tft.println(current_shift);
//tft.print("User:");
//tft.println(employee_name2);
//tft.setTextColor(ILI9341_BLACK);
//tft.setCursor(178,0);
//tft.println(WiFi.RSSI());
downtime =downtime_minutes+((float)downtime_seconds / 100);
uptime = uptime_minutes + ((float)uptime_seconds / 100);
//Serial.print("Downtime: ");
//Serial.println(downtime);
//Serial.print("Uptime: ");
//Serial.println(uptime);
}
void printHex(byte *buffer, byte bufferSize)
{
for (byte i = 0; i < bufferSize; i++)
{
Serial.print(buffer[i] < 0x10 ? " 0" : " ");
Serial.print(buffer[i], HEX);
}
}