Skip to content

Report "no filesystem" on OTA uploads w/o a FS #785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions libraries/ArduinoOTA/src/ArduinoOTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,19 @@ void ArduinoOTAClass::_onRx() {
void ArduinoOTAClass::_runUpdate() {
IPAddress ota_ip = _ota_ip;

if (!LittleFS.begin()) {
#ifdef OTA_DEBUG
OTA_DEBUG.println("LittleFS Begin Error");
#endif
_udp_ota->append("ERR: ", 5);
_udp_ota->append("no filesystem", 13);
_udp_ota->send(ota_ip, _ota_udp_port);
delay(100);
_udp_ota->listen(IP_ADDR_ANY, _port);
_state = OTA_IDLE;
return;
}

if (!Update.begin(_size, _cmd)) {
#ifdef OTA_DEBUG
OTA_DEBUG.println("Update Begin Error");
Expand All @@ -261,15 +274,6 @@ void ArduinoOTAClass::_runUpdate() {
_state = OTA_IDLE;
return;
}
if (!LittleFS.begin()) {
_udp_ota->append("ERR: ", 5);
_udp_ota->append("nofilesystem", 6);
_udp_ota->send(ota_ip, _ota_udp_port);
delay(100);
_udp_ota->listen(IP_ADDR_ANY, _port);
_state = OTA_IDLE;
return;
}

_udp_ota->append("OK", 2);
_udp_ota->send(ota_ip, _ota_udp_port);
Expand Down
3 changes: 2 additions & 1 deletion libraries/WiFi/src/BearSSLHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
#include <string.h>
#include <Arduino.h>
#include "StackThunk.h"
//#include <Updater_Signing.h>

#include <Updater_Signing.h>
#ifndef ARDUINO_SIGNING
#define ARDUINO_SIGNING 0
#endif
Expand Down