Closed SudhaMaanasa closed 3 years ago
pull the latest version, i just updated fingerprint for raw.githubusercontent.com, need to add a way to auto update fingerprint after fw is deployed.
Can you please specify the steps to collect the fingerprints?
Thank you.. could you please explain to me the meaning of "pulling the latest version"
download updated code from github,
Ok Thank you.. I tried the updated code. But no improvement. the same outcome.
Yes thq it worked.
Hi, check latest version, i've removed fingerprints from code.
My serial monitor shows only the following output: Start ..............Connected to WiFi error in downloading version file:-1 error in downloading version file:-1 error in downloading version file:-1 error in downloading version file:-1 error in downloading version file:-1
Here's my code:
include
include
include
const String FirmwareVer={"1.0"};
define URL_fw_Version "https://raw.githubusercontent.com/SudhaMaanasa/Smart_Device_Updates/main/Version.txt"
define URL_fw_Bin "https://raw.githubusercontent.com/SudhaMaanasa/Smart_Device_Updates/main/FW.bin"
//#define URL_fw_Version "http://cade-make.000webhostapp.com/version.txt" //#define URL_fw_Bin "http://cade-make.000webhostapp.com/firmware.bin" HTTPClient http;
const char ssid = "XXXXXXXXX"; const char password = "XXXXXXXXX";
void FirmwareUpdate() { http.begin(URL_fw_Version,"5F 3F 7A C2 56 9F 50 A4 66 76 47 C6 A1 8C A0 07 AA ED BB 8E"); // check version URL delay(100); int httpCode = http.GET(); // get data from version file delay(100); String payload; if (httpCode == HTTP_CODE_OK) // if version received { payload = http.getString(); // save received version Serial.println(payload ); } else { Serial.print("error in downloading version file:"); Serial.println(httpCode);
}
http.end(); if (httpCode == HTTP_CODE_OK) // if version received { payload.trim(); if(payload.equals(FirmwareVer) ) {
Serial.println("Device already on latest firmware version"); } else { Serial.println("New firmware detected"); WiFiClient client;
} }
}
unsigned long previousMillis = 0; // will store last time LED was updated const long interval = 30000;
void repeatedCall(){ unsigned long currentMillis = millis(); if ((currentMillis - previousMillis) >= interval) { // save the last time you blinked the LED previousMillis = currentMillis; FirmwareUpdate(); } }
void setup() { Serial.begin(115200); Serial.println(""); Serial.println("Start"); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print(".."); }
Serial.println("Connected to WiFi"); pinMode(LED_BUILTIN, OUTPUT); } void loop() { digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second repeatedCall();
}
Can you please specify the steps to collect the sha1 certificate?
Could you please help me with the correction of my code?