Skip to content
Closed
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
28c79fa
Add functionality to copy generated binaries into sketch folder
gneiss15 Aug 2, 2021
8c7445b
Merge branch 'master' into master
gneiss15 Aug 9, 2021
4f6340e
Integrated handling for filesystem and gzipped Binaries
gneiss15 Aug 13, 2021
5509ba4
Forgot to add new tools to git
gneiss15 Aug 13, 2021
71d4213
Minor bugfix
gneiss15 Aug 13, 2021
62ca3b6
Debug for failed check in Pull-Request
gneiss15 Aug 13, 2021
6091823
Ignore files generated by boards.txt.py & my extra files
gneiss15 Aug 13, 2021
158484f
More Debug for failed check in Pull-Request
gneiss15 Aug 13, 2021
cf02d41
Bugfix for check
gneiss15 Aug 13, 2021
dd93598
And another bigfix :-(
gneiss15 Aug 13, 2021
f39b549
Changed mod a+x (as all other .py)
gneiss15 Aug 13, 2021
43f9e21
Syntax error in utilities.py may be the reason for failed import. Cor…
gneiss15 Aug 13, 2021
6849302
instead of external commd, use python module gzip
gneiss15 Aug 18, 2021
d86910c
Integrated handling for filesystem and gzipped binaries (#1)
gneiss15 Aug 18, 2021
ea98d66
Improved handling of "tkinter not awailable"
gneiss15 Aug 18, 2021
fc74ac7
Merge branch 'master' into Integrated-handling-for-filesystem-and-gzi…
gneiss15 Aug 18, 2021
b827489
Improved selection of actions to be performed
gneiss15 Aug 23, 2021
8c06e83
Merge branch 'master' of https://github.com/esp8266/Arduino into esp8…
gneiss15 Sep 5, 2021
cbc8f4d
Merge branch 'esp8266-master' into Integrated-handling-for-filesystem…
gneiss15 Sep 5, 2021
87eacb4
Remover empthy dir
gneiss15 Sep 8, 2021
32d715a
Merge branch 'Integrated-handling-for-filesystem-and-gzipped-Binaries…
gneiss15 Sep 8, 2021
3380148
Changes as requested by d-a-v
gneiss15 Sep 15, 2021
311c9c3
Removed changes not contained inside master
gneiss15 Sep 15, 2021
b7751e3
platformio-build.py forgotten
gneiss15 Sep 15, 2021
9d1ded0
Merge branch 'master' into Integrated-handling-for-filesystem-and-gzi…
gneiss15 Sep 18, 2021
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@ boards.local.txt
.vs/
__vm/
*.vcxproj*

#Ignore files generated by boards.txt.py
*.orig
tools/sdk/ld/backup/*

#Ignore my extra files
*.odt*
tools/Gui.py
tools/Replace2SpceWith4.txt
*(Kopie)*


669 changes: 669 additions & 0 deletions boards.txt

Large diffs are not rendered by default.

61 changes: 0 additions & 61 deletions cores/esp8266/WString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,6 @@ String &String::operator =(const __FlashStringHelper *pstr) {
return *this;
}

String &String::operator =(char c) {
char buffer[2] { c, '\0' };
*this = buffer;
return *this;
}


/*********************************************/
/* concat */
/*********************************************/
Expand Down Expand Up @@ -507,10 +500,6 @@ bool String::equals(const char *cstr) const {
return strcmp(buffer(), cstr) == 0;
}

bool String::equals(const __FlashStringHelper *s) const {
return equals(String(s));
}

bool String::operator<(const String &rhs) const {
return compareTo(rhs) < 0;
}
Expand Down Expand Up @@ -543,10 +532,6 @@ bool String::equalsIgnoreCase(const String &s2) const {
return true;
}

bool String::equalsIgnoreCase(const __FlashStringHelper *s) const {
return equalsIgnoreCase(String(s));
}

unsigned char String::equalsConstantTime(const String &s2) const {
// To avoid possible time-based attacks present function
// compares given strings in a constant time.
Expand Down Expand Up @@ -580,37 +565,18 @@ bool String::startsWith(const String &s2) const {
return startsWith(s2, 0);
}

bool String::startsWith(const char *prefix) const {
return this->startsWith(String(prefix));
}
bool String::startsWith(const __FlashStringHelper *prefix) const {
return this->startsWith(String(prefix));
}

bool String::startsWith(const String &s2, unsigned int offset) const {
if (offset > (unsigned)(len() - s2.len()) || !buffer() || !s2.buffer())
return false;
return strncmp(&buffer()[offset], s2.buffer(), s2.len()) == 0;
}

bool String::startsWith(const __FlashStringHelper *prefix, unsigned int offset) const {
return startsWith(String(prefix), offset);
}

bool String::endsWith(const String &s2) const {
if (len() < s2.len() || !buffer() || !s2.buffer())
return false;
return strcmp(&buffer()[len() - s2.len()], s2.buffer()) == 0;
}

bool String::endsWith(const char *suffix) const {
return this->endsWith(String(suffix));
}
bool String::endsWith(const __FlashStringHelper *suffix) const {
return this->endsWith(String(suffix));
}


/*********************************************/
/* Character Access */
/*********************************************/
Expand Down Expand Up @@ -712,15 +678,6 @@ int String::lastIndexOf(const String &s2, unsigned int fromIndex) const {
return found;
}

int String::lastIndexOf(const __FlashStringHelper *str) const {
return lastIndexOf(String(str));
}

int String::lastIndexOf(const __FlashStringHelper *str, unsigned int fromIndex) const {
return lastIndexOf(String(str), fromIndex);
}


String String::substring(unsigned int left, unsigned int right) const {
if (left > right) {
unsigned int temp = right;
Expand Down Expand Up @@ -799,24 +756,6 @@ void String::replace(const String &find, const String &replace) {
}
}


void String::replace(const char *find, const String &replace) {
this->replace(String(find), replace);
}
void String::replace(const __FlashStringHelper *find, const String &replace) {
this->replace(String(find), replace);
}
void String::replace(const char *find, const char *replace) {
this->replace(String(find), String(replace));
}
void String::replace(const __FlashStringHelper *find, const char *replace) {
this->replace(String(find), String(replace));
}
void String::replace(const __FlashStringHelper *find, const __FlashStringHelper *replace) {
this->replace(String(find), String(replace));
}


void String::remove(unsigned int index, unsigned int count) {
if (index >= len()) {
return;
Expand Down
54 changes: 32 additions & 22 deletions cores/esp8266/WString.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ class String {
String &operator =(const char *cstr);
String &operator =(const __FlashStringHelper *str);
String &operator =(String &&rval) noexcept;
String &operator =(char c);
String &operator =(char c) {
char buffer[2] { c, '\0' };
*this = buffer;
return *this;
}

// concatenate (works w/ built-in types)

Expand Down Expand Up @@ -138,40 +142,39 @@ class String {
int compareTo(const String &s) const;
bool equals(const String &s) const;
bool equals(const char *cstr) const;
bool equals(const __FlashStringHelper *s) const;
bool operator ==(const String &rhs) const {
return equals(rhs);
}
bool operator ==(const char *cstr) const {
return equals(cstr);
}
bool operator ==(const __FlashStringHelper *rhs) const {
return equals(rhs);
}
bool operator !=(const String &rhs) const {
return !equals(rhs);
}
bool operator !=(const char *cstr) const {
return !equals(cstr);
}
bool operator !=(const __FlashStringHelper *rhs) const {
return !equals(rhs);
}
bool operator <(const String &rhs) const;
bool operator >(const String &rhs) const;
bool operator <=(const String &rhs) const;
bool operator >=(const String &rhs) const;
bool equalsIgnoreCase(const String &s) const;
bool equalsIgnoreCase(const __FlashStringHelper *s) const;
unsigned char equalsConstantTime(const String &s) const;
bool startsWith(const String &prefix) const;
bool startsWith(const char *prefix) const;
bool startsWith(const __FlashStringHelper *prefix) const;
bool startsWith(const char *prefix) const {
return this->startsWith(String(prefix));
}
bool startsWith(const __FlashStringHelper *prefix) const {
return this->startsWith(String(prefix));
}
bool startsWith(const String &prefix, unsigned int offset) const;
bool startsWith(const __FlashStringHelper *prefix, unsigned int offset) const;
bool endsWith(const String &suffix) const;
bool endsWith(const char *suffix) const;
bool endsWith(const __FlashStringHelper *suffix) const;
bool endsWith(const char *suffix) const {
return this->endsWith(String(suffix));
}
bool endsWith(const __FlashStringHelper *suffix) const {
return this->endsWith(String(suffix));
}

// character access
char charAt(unsigned int index) const {
Expand Down Expand Up @@ -201,8 +204,6 @@ class String {
int lastIndexOf(char ch, unsigned int fromIndex) const;
int lastIndexOf(const String &str) const;
int lastIndexOf(const String &str, unsigned int fromIndex) const;
int lastIndexOf(const __FlashStringHelper *str) const;
int lastIndexOf(const __FlashStringHelper *str, unsigned int fromIndex) const;
String substring(unsigned int beginIndex) const {
return substring(beginIndex, len());
}
Expand All @@ -211,12 +212,21 @@ class String {
// modification
void replace(char find, char replace);
void replace(const String &find, const String &replace);
void replace(const char *find, const String &replace);
void replace(const __FlashStringHelper *find, const String &replace);
void replace(const char *find, const char *replace);
void replace(const __FlashStringHelper *find, const char *replace);
void replace(const __FlashStringHelper *find, const __FlashStringHelper *replace);

void replace(const char *find, const String &replace) {
this->replace(String(find), replace);
}
void replace(const __FlashStringHelper *find, const String &replace) {
this->replace(String(find), replace);
}
void replace(const char *find, const char *replace) {
this->replace(String(find), String(replace));
}
void replace(const __FlashStringHelper *find, const char *replace) {
this->replace(String(find), String(replace));
}
void replace(const __FlashStringHelper *find, const __FlashStringHelper *replace) {
this->replace(String(find), String(replace));
}
// Pass the biggest integer if the count is not specified.
// The remove method below will take care of truncating it at the end of the string.
void remove(unsigned int index, unsigned int count = (unsigned int)-1);
Expand Down
51 changes: 49 additions & 2 deletions doc/filesystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,55 @@ in the specific subdirectory. This mimics the POSIX behavior for
directory traversal most C programmers are used to.


Uploading files to file system
------------------------------
Uploading files to file system (new)
Copy link
Collaborator

@d-a-v d-a-v Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(new) => (combined firmware and filesystem)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK; good point (Thanks)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I don't understand what happend here. You changed this, but inside the "resolved" view I still see my old version ???
I prefer You Version (with "combined firmware and filesystem" instead of "new"), but that's not shown here ???

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, because that seams to be true for all such comments here, I integrate theses changes into my local copy and commit theses changes later..
If this isn't the right way, please let me know.

------------------------------------

Since PullRequest #8266 Filsystem generation is integrated into the
“compile and/or upload” action of Arduino.
There is no need to download any additional tool.

This integration is done by adding 3 entries (“Upload”, "Filesystem" and “Export”)
to the tools-menu. These entries are presented just like any other options
for esp8266 (“Upload speed” ... “Non-32-Bit Access”) and placed right after
the last.

Menu-Entry “Upload” let You choose between:
- Sketch
- Filesystem
- Both
This Menu controls which parts are uploaded when You choose "Sketch->Upload"
(Ctrl-U) from the Arduino Menu.

Menu-Entry “Filesystem” let You choose between:
- Off
- LitteFs
- SPIFFS
This Menu controls which Fs will be created when You choose "Sketch->Compile"
(Ctrl-R) from the Arduino Menu. The Fs will always be created inside the
"export" dir (see below).

Menu-Entry “Export” let You choose between:
- Off
- .bin & .bin.signed)
- Create & Export gzipped Binaries too
This Menu controls export & generation of (extra) Sketch-Binaries.

The "export" dir
................
After a (successful) compile, the files will be exported to a subdir
“bin/{variant}” of Your sketch directory
(“{variant}” replaced with the name of the board as shown behind
“Tools -> Board:”).
Signed variants of all Binaries are generated similar to the
“automatic signing” done for normal sketch binary.

As valid for the "old" tools mentioned below, it is nessesary to place
files you want to be inside the generated file system into a directory
named ``data`` inside Your sketch directory.


Uploading files to file system (old tools)
------------------------------------------

*ESP8266FS* is a tool which integrates into the Arduino IDE. It adds a
menu item to *Tools* menu for uploading the contents of sketch data
Expand Down
41 changes: 7 additions & 34 deletions libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,26 +276,17 @@ void HTTPClient::setAuthorization(const char * user, const char * password)
}

/**
* set the Authorization for the http request
* set the Authorizatio for the http request
* @param auth const char * base64
*/
void HTTPClient::setAuthorization(const char * auth)
{
if (auth) {
setAuthorization(String(auth));
if(auth) {
_base64Authorization = auth;
_base64Authorization.replace(String('\n'), emptyString);
}
}

/**
* set the Authorization for the http request
* @param auth String base64
*/
void HTTPClient::setAuthorization(String auth)
{
_base64Authorization = std::move(auth);
_base64Authorization.replace(String('\n'), emptyString);
}

/**
* set the timeout for the TCP connection
* @param timeout unsigned int
Expand Down Expand Up @@ -363,14 +354,6 @@ int HTTPClient::GET()
{
return sendRequest("GET");
}
/**
* send a DELETE request
* @return http code
*/
int HTTPClient::DELETE()
{
return sendRequest("DELETE");
}

/**
* sends a post request to the server
Expand Down Expand Up @@ -627,18 +610,8 @@ WiFiClient* HTTPClient::getStreamPtr(void)
*/
int HTTPClient::writeToStream(Stream * stream)
{
return writeToPrint(stream);
}

/**
* write all message body / payload to Print
* @param print Print *
* @return bytes written ( negative values are error codes )
*/
int HTTPClient::writeToPrint(Print * print)
{

if(!print) {
if(!stream) {
return returnError(HTTPC_ERROR_NO_STREAM);
}

Expand All @@ -655,7 +628,7 @@ int HTTPClient::writeToPrint(Print * print)
if(_transferEncoding == HTTPC_TE_IDENTITY) {
// len < 0: transfer all of it, with timeout
// len >= 0: max:len, with timeout
ret = _client->sendSize(print, len);
ret = _client->sendSize(stream, len);

// do we have an error?
if(_client->getLastSendReport() != Stream::Report::Success) {
Expand Down Expand Up @@ -683,7 +656,7 @@ int HTTPClient::writeToPrint(Print * print)
// data left?
if(len > 0) {
// read len bytes with timeout
int r = _client->sendSize(print, len);
int r = _client->sendSize(stream, len);
if (_client->getLastSendReport() != Stream::Report::Success)
// not all data transferred
return returnError(StreamReportToHttpClientReport(_client->getLastSendReport()));
Expand Down
3 changes: 0 additions & 3 deletions libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ class HTTPClient
void setUserAgent(const String& userAgent);
void setAuthorization(const char * user, const char * password);
void setAuthorization(const char * auth);
void setAuthorization(String auth);
void setTimeout(uint16_t timeout);

// Redirections
Expand All @@ -188,7 +187,6 @@ class HTTPClient

/// request handling
int GET();
int DELETE();
int POST(const uint8_t* payload, size_t size);
int POST(const String& payload);
int PUT(const uint8_t* payload, size_t size);
Expand All @@ -215,7 +213,6 @@ class HTTPClient

WiFiClient& getStream(void);
WiFiClient* getStreamPtr(void);
int writeToPrint(Print* print);
int writeToStream(Stream* stream);
const String& getString(void);
static String errorToString(int error);
Expand Down
Loading