Hot answers tagged

3

Turns out the ESP crash is caused by the debug settings in the Arduino IDE. As soon as the CORE-level is included, the error occurs. There seems to be a bug in the firmware somewhere. Including other levels seems to be fine. A huge thanks to Juraj for helping me spot this one.


2

Basicly OTA supports the upload of *.bin files. Wether this contains compiled code or a filesystem (SPIFFS/LittleFS) is irrelevant. BUT The space for the OTA (partition) has to be min the size of the *.bin plus an overhead for processing. So with 4MB at all, you would need 2.5MB OTA for 1.5MB App/SPIFFS. To tweak partition sizes (or custom partitions) you ...


2

myFile.read() returns one character. That character can be represented as a number (such as 65 for 'A') or a character, or whatever you want. Everything is just a number. Letters are just our personal representation of certain numbers as humans. You could think of it as the numbers represented in base 256, where each value between 0 and 255 is assigned a ...


2

There is no need for an SD card. You can write all relevant parameters into a file in SPIFFS (e.g. json if you like) before starting the OTA update. During initialization you read the file and set the parameters accordingly. SPIFFS does not get erased when doing an update (at least that's true for the OTA library that I'm using). If it does get erased in ...


2

So, sorry for late response, i figured it out. Because it took lots of time for me and it might be a prevalent issue, i think it worth to contribute my experience for further similar issues. As mentioned buffering can do the job, here are some constraints that should be satisfied to have right buffering mechanism; Writing to SD card SHOULD NOT be handled in ...


1

A local solution would be to use EERAM. This is an EEPROM and an SRAM coupled together with some intelligent power management circuitry - writes get stored in SRAM until the power goes (or an instruction to save is sent) when the contents of SRAM get copied into EEPROM using the power stored in a large capacitor. A good choice is the 47C16 (5V) or 47L16 (3....


1

If you worry about the maximum number of write cycles, you could write the data to an SD card or some FRAM connected to the ESP8266, or you could send the data to a (web) server (if you have access to one) using WiFi. The server can then store the data. If you really care about the data, you could do both. Having a backup is the only protection against ...


1

I directly see 3 problems with your code: Serial.write() will not return the written data, but the number of send bytes. This means that in your for loop you are only assigning the written number of bytes to the variable, not the data. But I guess you want to display the actual data, which was read from the file. You should assign the return value of fr....


1

That would work. Though I feel like your solution isn't easily readable by humans, and also not easily readable by machines. Removing the |s, making the data a fixed length, and putting each alarm on separate line, would help with both. You'd get something like ON MTWTFSS 14:00 OFF MT T S 10:00 Because the data-string is of a fixed length, you know where ...


1

I would suggest a bit field for storing the days of the week when the alarm is supposed to fire: bit 0: fire on Sundays bit 1: fire on Mondays ... This numbering is meant to match the one of DateTime::dayOfTheWeek(). Pack this, together with the hour and minute of the alarm, in a struct (or a class if you prefer). Maybe add a boolean to tell whether the ...


1

Is the missing double dash? esptool.py --chip esp32s2 --port COM3 --baud 115200 write_flash -z 0x110000 filename.spiffs.bin


1

Use file.write(payload, length); for byte array. length should be the count of payload bytes, not the size of the payload array. print and write return the count of bytes written. It is not meaningful to use the return value as boolean.


Only top voted, non community-wiki answers of a minimum length are eligible